Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap to setuptools-scm #71

Merged
merged 2 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading