Skip to content

Commit

Permalink
Fix poetry dynamic versioning from Git commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davedittrich committed Oct 16, 2024
1 parent 6460cf6 commit 2759f5e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
14 changes: 9 additions & 5 deletions psec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
PackageNotFoundError,
)

from psec._version import (
__version__,
__version_tuple__,
)

__author__ = 'Dave Dittrich'
__email__ = '[email protected]'
__release__ = '24.10.7'

try:
from psec._version import (
__version__,
__version_tuple__,
)
except ModuleNotFoundError:
__version__ = __release__
__version_tuple__ = tuple(__version__.split('.'))

if __version__ in ['0.0.0', '0.1.0']:
try:
__version__ = version("python-secrets")
Expand Down
18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
style = "pep440"
latest-tag = true
pattern = '(?P<base>\d+\.\d+\.\d+)'
metadata = true
pattern = "((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*)([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\\d+)?))?"

[tool.poetry-dynamic-versioning.files."psec/_version.py"]
persistent-substitution = true
Expand All @@ -21,6 +22,7 @@ initial-content = """

[tool.poetry]
name = "python-secrets"
package-mode = true
version = "0.1.0"
description = "Python CLI for decoupling secrets (passwords, API keys, etc.) from source code"
license = "Apache-2.0"
Expand Down Expand Up @@ -68,8 +70,11 @@ classifiers = [
"Topic :: System :: Systems Administration",
"Topic :: Utilities"
]
include = [
{ path = "psec/_version.py" },
]
packages = [
{include = "psec", to = "python-secrets"}
{include = "psec"}
]

[tool.poetry.scripts]
Expand Down Expand Up @@ -130,21 +135,20 @@ ipwhois = "^1.2.0"
jinja2 = "^3.1.4"
lxml = "^5.3.0"
pexpect = "^4.9.0"
poetry = "^1.8.3"
poetry = ">=1.8.3"
poetry-dynamic-versioning = "^1.4.1"
psutil = "^6.0.0"
requests = "^2.32.3"
requests = ">=2.31.0"
sphinx = "^8.0.2"
setuptools = "^75.1.0"
xkcdpass ="^1.19.9"
ruff = "^0.6.9"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
tox = "^4.8.1"
bandit = "^1.7.9"
ruff = "^0.6.9"

[tool.poetry.group.test]
optional = true
Expand Down

0 comments on commit 2759f5e

Please sign in to comment.