Skip to content

Commit

Permalink
Swap to setuptools-scm (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBoothroyd authored Jul 27, 2024
1 parent 7f03241 commit 453f51f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 744 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
descent/_version.py export-subst
.git_archival.txt export-subst
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ PACKAGE_DIR := $(PACKAGE_NAME)

CONDA_ENV_RUN := conda run --no-capture-output --name $(PACKAGE_NAME)

.PHONY: pip-install env lint format test test-examples

pip-install:
$(CONDA_ENV_RUN) pip install --no-build-isolation --no-deps -e .
.PHONY: env lint format test test-examples docs-build docs-deploy docs-insiders

env:
mamba create --name $(PACKAGE_NAME)
mamba env update --name $(PACKAGE_NAME) --file devtools/envs/base.yaml
$(CONDA_ENV_RUN) pip install --no-build-isolation --no-deps -e .
$(CONDA_ENV_RUN) pip install --no-deps -e .
$(CONDA_ENV_RUN) pre-commit install || true

lint:
Expand All @@ -20,8 +17,6 @@ lint:
format:
$(CONDA_ENV_RUN) ruff format $(PACKAGE_DIR)
$(CONDA_ENV_RUN) ruff check --fix --select I $(PACKAGE_DIR)
$(CONDA_ENV_RUN) nbqa 'ruff format' examples
$(CONDA_ENV_RUN) nbqa 'ruff check' --fix --select=I examples

test:
$(CONDA_ENV_RUN) pytest -v --cov=$(PACKAGE_NAME) --cov-report=xml --color=yes $(PACKAGE_DIR)/tests/
Expand Down
8 changes: 6 additions & 2 deletions descent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
Optimize classical force field parameters against reference data
"""

from . import _version
import importlib.metadata

try:
__version__ = importlib.metadata.version("descent")
except importlib.metadata.PackageNotFoundError:
__version__ = "0+unknown"

__version__ = _version.get_versions()["version"]
__all__ = ["__version__"]
Loading

0 comments on commit 453f51f

Please sign in to comment.