Skip to content

Commit

Permalink
build: 📦 fix versioning process for PDM build backend
Browse files Browse the repository at this point in the history
  • Loading branch information
darvid committed Aug 10, 2023
1 parent 951b119 commit 564fd78
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pdm_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

from setuptools import Extension

__version__ = "0.6.0"


def pdm_build_hook_enabled(context):
return context.target == "wheel"


def pdm_build_update_setup_kwargs(context, setup_kwargs):
setup_kwargs.update(ext_modules=_get_extension())
setup_kwargs.update(ext_modules=_get_extension(), version=__version__)


def _get_extension(name="hyperscan._ext", **kwargs):
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,20 @@ release = [
build = ["cibuildwheel>=2.14.1", "build>=0.10.0"]
memprofile = ["matplotlib>=3.7.2", "numpy>=1.24.4", "scipy>=1.9.3"]

[tool.pdm.version]
source = "file"
path = "src/hyperscan/_version.py"

[tool.setuptools.dynamic]
version = { attr = "hyperscan._version.__version__" }

[tool.semantic_release]
commit_parser = "emoji"
version_variables = ["src/hyperscan/_version.py:__version__"]
version_variables = [
"src/hyperscan/_version.py:__version__",
"setup.py:__version__",
"pdm_build.py:__version__",
]

[tool.semantic_release.commit_parser_options]
major_tags = [":boom:"]
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
pass


__version__ = "0.6.0"


def _pkgconfig(args):
return subprocess.getoutput(f"pkg-config {args}").strip()

Expand Down Expand Up @@ -68,4 +71,5 @@ def get_platform_specific_options():
**get_platform_specific_options(),
)
],
version=__version__,
)

0 comments on commit 564fd78

Please sign in to comment.