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

Switch to setuptools-scm #267

Merged
merged 5 commits into from
Jan 11, 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 .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")