diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 0a2db20..68c8b58 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -28,7 +28,7 @@ jobs: - name: Install dependencies run: python -m pip install -r requirements.txt -r test-requirements.txt -r documentation-requirements.txt - name: Install package - run: PYTHONPATH=./:$PYTHONPATH python -m pip install . + run: python -m pip -v install -e . - name: Run tests run: ./run_tests.sh - name: Build documentation diff --git a/.gitignore b/.gitignore index 7ef43d8..f76e0a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ # Ignore virtualenv /ENV -/remu/version.py -/remu.egg-info +_version.py +*.egg-info /dist +/build .coverage *.pyc diff --git a/pyproject.toml b/pyproject.toml index 716a4ed..0fcc762 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools", "setuptools-scm[toml]"] build-backend = "setuptools.build_meta" [project] @@ -47,11 +47,8 @@ mcmc = [ [project.urls] Home = "https://remu.readthedocs.io/en/latest/" -[tool.setuptools] -zip-safe = true - -[tool.setuptools.packages.find] -include = ["remu"] +[tool.setuptools_scm] +write_to = "src/remu/_version.py" [tool.setuptools.dynamic] -version = {attr = "remu.version.version"} +version = {attr = "remu.__version__"} diff --git a/remu/__init__.py b/src/remu/__init__.py similarity index 62% rename from remu/__init__.py rename to src/remu/__init__.py index a325eee..668006a 100644 --- a/remu/__init__.py +++ b/src/remu/__init__.py @@ -4,3 +4,8 @@ events and response matrices. """ + +try: + from ._version import __version__ +except ImportError: + __version__ = None diff --git a/remu/binning.py b/src/remu/binning.py similarity index 100% rename from remu/binning.py rename to src/remu/binning.py diff --git a/remu/likelihood.py b/src/remu/likelihood.py similarity index 100% rename from remu/likelihood.py rename to src/remu/likelihood.py diff --git a/remu/likelihood_utils.py b/src/remu/likelihood_utils.py similarity index 100% rename from remu/likelihood_utils.py rename to src/remu/likelihood_utils.py diff --git a/remu/matrix_utils.py b/src/remu/matrix_utils.py similarity index 100% rename from remu/matrix_utils.py rename to src/remu/matrix_utils.py diff --git a/remu/migration.py b/src/remu/migration.py similarity index 100% rename from remu/migration.py rename to src/remu/migration.py diff --git a/remu/plotting.py b/src/remu/plotting.py similarity index 100% rename from remu/plotting.py rename to src/remu/plotting.py