Skip to content

Commit

Permalink
Replace _version_generated.py for _version.py
Browse files Browse the repository at this point in the history
Rename the name of the autogenerated file for storing the version of
Boule. Remove the tracked `boule/_version.py` file. Update mentions of
`_version_generated.py` in multiple files (Makefile, .coveragerc,
.gitignore, pyproject.toml).
  • Loading branch information
santisoler committed May 10, 2024
1 parent 3062c09 commit 5bf5be4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
branch = True
omit =
*/tests/*
*/_version_generated.py
*/_version.py
**/__init__.py
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MANIFEST
dask-worker-space
build/
dist/
boule/_version_generated.py
boule/_version.py
doc/_build
doc/api/generated
doc/tutorials
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ clean:
find . -name "*.pyc" -exec rm -v {} \;
find . -name "*.orig" -exec rm -v {} \;
find . -name ".coverage.*" -exec rm -v {} \;
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache .pytest_cache $(PROJECT)/_version_generated.py
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache .pytest_cache $(PROJECT)/_version.py
rm -rvf $(TESTDIR) dask-worker-space
3 changes: 3 additions & 0 deletions boule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
from ._sphere import Sphere
from ._triaxialellipsoid import TriaxialEllipsoid
from ._version import __version__

# Append a leading "v" to the generated version by setuptools_scm
__version__ = f"v{__version__}"
16 changes: 0 additions & 16 deletions boule/_version.py

This file was deleted.

16 changes: 16 additions & 0 deletions boule/_version_generated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]

Check warning on line 6 in boule/_version_generated.py

View check run for this annotation

Codecov / codecov/patch

boule/_version_generated.py#L5-L6

Added lines #L5 - L6 were not covered by tests
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.4.1.post30'
__version_tuple__ = version_tuple = (0, 4, 1)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "no-local-version"
write_to = "boule/_version_generated.py"
write_to = "boule/_version.py"

# Make sure isort and Black are compatible
[tool.isort]
Expand Down

0 comments on commit 5bf5be4

Please sign in to comment.