Skip to content

Commit

Permalink
Add version string to __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenthompson committed Aug 2, 2022
1 parent 3d3de85 commit 2d74085
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ dist
htmlcov
**/.DS_Store
.eggs
cppimport/_version.py
7 changes: 7 additions & 0 deletions cppimport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

from cppimport.find import _check_first_line_contains_cppimport

try:
from ._version import version as __version__
from ._version import version_tuple
except ImportError:
__version__ = "unknown version"
version_tuple = (0, 0, "unknown version")

settings = dict(
force_rebuild=False, # `force_rebuild` with multiple processes is not supported
file_exts=[".cpp", ".c"],
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "post-release"
write_to = "cppimport/_version.py"

0 comments on commit 2d74085

Please sign in to comment.