diff --git a/.github/workflows/python_package.yaml b/.github/workflows/python_package.yaml index aa3275f0..af5f1878 100644 --- a/.github/workflows/python_package.yaml +++ b/.github/workflows/python_package.yaml @@ -24,6 +24,10 @@ jobs: steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + fetch-tags: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 @@ -40,7 +44,6 @@ jobs: - name: Test with pytest run: | - git submodule update --init --recursive pytest -vv --durations=100 --randomly-seed=42 build-status: diff --git a/.gitignore b/.gitignore index 2a21abb2..02207535 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +jax_galsim/_version.py # PyInstaller # Usually these files are written by a python script from a template diff --git a/jax_galsim/__init__.py b/jax_galsim/__init__.py index fe89288d..8e586d32 100644 --- a/jax_galsim/__init__.py +++ b/jax_galsim/__init__.py @@ -1,3 +1,8 @@ +try: + from ._version import version as __version__ +except ImportError: + __version__ = "0.0.1.dev0" + # Exception and Warning classes from .errors import GalSimError, GalSimRangeError, GalSimValueError from .errors import GalSimKeyError, GalSimIndexError, GalSimNotImplementedError diff --git a/pyproject.toml b/pyproject.toml index 1921ba52..6780330a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ "setuptools>=45", + "setuptools-scm>=8", ] build-backend = "setuptools.build_meta" @@ -10,7 +11,7 @@ authors = [ {name = "GalSim Developers"}, ] description = "The modular galaxy image simulation toolkit, but in JAX" -version = "0.0.1rc1" +dynamic = ["version"] license = {file = "LICENSE"} readme = "README.md" dependencies = [ @@ -31,6 +32,10 @@ home = "https://github.com/GalSim-developers/JAX-GalSim" [tool.setuptools.packages.find] include = ["jax_galsim*"] +[tool.setuptools-scm] +write_to = "jax_galsim/_version.py" +fallback_version = "0.0.1.dev0" + [tool.ruff.lint] select = ["E", "F", "I", "W"] ignore = ["C901", "E203", "E501"]