Skip to content

Commit

Permalink
Switch to setuptools-scm (#267)
Browse files Browse the repository at this point in the history
* Switch to setuptools-scm

Signed-off-by: Patrick ZAJDA <[email protected]>

* Exclude version file from Black and flake8

Signed-off-by: Patrick ZAJDA <[email protected]>

* Add version file to .gitignore

Signed-off-by: Patrick ZAJDA <[email protected]>

* Exclude version from codecov

Signed-off-by: Patrick ZAJDA <[email protected]>

* Exclude __init__ from codecov, no code to be tested is in this module

Signed-off-by: Patrick ZAJDA <[email protected]>

---------

Signed-off-by: Patrick ZAJDA <[email protected]>
  • Loading branch information
Nardol authored Jan 11, 2024
1 parent 95e3c91 commit e48642c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Ignore version file
src/pysmsboxnet/_version.py
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
comment: # this is a top-level key
require_changes: true
ignore:
- "src/pysmsboxnet/_version.py"
- "src/pysmsboxnet/__init__.py"
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = [ "setuptools", "setuptools-git-versioning", ]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -48,9 +48,10 @@ include-package-data = false
[tool.black]
target-version = ["py39", "py310"]
exclude = 'generated'
extend-exclude = 'src/pysmsboxnet/_version.py'

[tool.isort]
profile = "black"

[tool.setuptools-git-versioning]
enabled = true
[tool.setuptools_scm]
version_file = "src/pysmsboxnet/_version.py"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build,src/pysmsboxnet/_version.py
max-complexity = 25
doctests = True
# To work with Black
Expand Down
6 changes: 6 additions & 0 deletions src/pysmsboxnet/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
"""Python library to use smsbox.net API."""
try:
from ._version import version as __version__ # type: ignore
from ._version import version_tuple # type: ignore
except ImportError:
__version__ = "unknown version"
version_tuple = (0, 0, "unknown version")

0 comments on commit e48642c

Please sign in to comment.