Skip to content

Commit

Permalink
make package version dynamic
Browse files Browse the repository at this point in the history
also adjusting test workflow so that we append the git hash to the current version before publishing to testpypi
  • Loading branch information
radusuciu committed Feb 29, 2024
1 parent abf4e7f commit 26ebc81
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ jobs:
if: matrix.python-version == '3.11'
run: |
source ${{ env.VIRTUAL_ENV }}/bin/activate
# adding the git hash to the current version so that the package
# won't be rejected from the test repository due to version clash
TEMP_VERSION=$(git describe | sed s/\-/\./ | sed s/\-/\+/)
bumpver update --no-commit --no-tag-commit --set-version="${TEMP_VERSION}"
pdm publish --repository testpypi
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pytest-docker-compose-v2"
version = "0.1.1"
dynamic = ["version"]
description = "Manages Docker containers during your integration tests"
authors = [
{name = "Radu Suciu"},
Expand Down Expand Up @@ -56,6 +56,10 @@ dev = [
"pytest>=7.4.4",
]

[tool.pdm.version]
source = "file"
path = "pytest_docker_compose/__init__.py"

[tool.pytest.ini_options]
addopts = "-m 'not (should_fail or multiple_compose_files)' '--docker-compose' './tests/pytest_docker_compose_tests/my_network' '--docker-compose-no-build'"
markers = [
Expand Down Expand Up @@ -137,7 +141,7 @@ sort_commits = "oldest"

[tool.bumpver]
current_version = "0.1.1"
version_pattern = "MAJOR.MINOR.PATCH"
version_pattern = "MAJOR.MINOR.PATCH[GITHASH]"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
tag = true
Expand All @@ -146,5 +150,7 @@ push = false
[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]
"pytest_docker_compose/__init__.py" = [
'__version__ = "{version}"',
]
1 change: 1 addition & 0 deletions pytest_docker_compose/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.1"

0 comments on commit 26ebc81

Please sign in to comment.