Skip to content

Commit

Permalink
Merge pull request #25 from linkml/issue-1051
Browse files Browse the repository at this point in the history
Add dynamic versioning
  • Loading branch information
hrshdhgd committed Nov 8, 2022
2 parents cf4e24d + ff17ca4 commit 60667e6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
19 changes: 10 additions & 9 deletions {{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ jobs:
python-version: 3.9

- name: Install Poetry
uses: snok/install-poetry@v1.1.6
with:
virtualenvs-create: true
virtualenvs-in-project: true
run: |
pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
# uses: snok/install-poetry@v1.1.6
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true

- name: Install dependencies
run: poetry install --no-interaction
# - name: Install dependencies
# run: poetry install --no-interaction

- name: Build source and wheel archives
run: |
poetry version $(git describe --tags --abbrev=0)
poetry build
run: poetry build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@v1.2.2
Expand Down
9 changes: 7 additions & 2 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ include = ["README.md", "src/{{cookiecutter.__project_slug}}/schema", "project"]
python = "^3.9"
linkml-runtime = "^1.1.24"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"

[tool.poetry.dev-dependencies]
linkml = "^1.3.5"
mkdocs-material = "^8.2.8"
mkdocs-mermaid2-plugin = "^0.6.0"
schemasheets = "^0.1.14"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry.extras]
docs = ["linkml", "mkdocs-material"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
except PackageNotFoundError:
# package not installed
__version__ = "0.0.0"

0 comments on commit 60667e6

Please sign in to comment.