Skip to content

Commit eea73f9

Browse files
feat: Added automatic version control based in tags
1 parent 0f925b0 commit eea73f9

File tree

3 files changed

+55
-9
lines changed

3 files changed

+55
-9
lines changed

.github/workflows/release.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ on:
2727
jobs:
2828
build:
2929
name: Build distribution 📦
30-
runs-on: ubuntu-latest
31-
30+
runs-on: ubuntu-latest
3231
steps:
3332
- name: Checkout repository
3433
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
with:
35+
fetch-depth: 0
3536

3637
- name: Set up Python
3738
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
@@ -41,8 +42,13 @@ jobs:
4142
- name: Install pypa/build
4243
run: python3 -m pip install build --user
4344

44-
- name: Build a binary wheel and a source tarball
45-
run: python3 -m build
45+
- name: Install and configure Poetry
46+
uses: snok/install-poetry@v1
47+
with:
48+
version: latest
49+
50+
- name: Install using poetry
51+
run: poetry build
4652

4753
- name: Store the distribution packages
4854
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

DEPENDENCIES_TRACTUS-X_SDK

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pypi/pypi/-/iniconfig/2.0.0, MIT, approved, clearlydefined
2828
pypi/pypi/-/jwcrypto/1.5.6, LGPL-3.0-only AND LGPL-3.0-or-later, approved, #15152
2929
pypi/pypi/-/markdown-it-py/3.0.0, MIT, approved, clearlydefined
3030
pypi/pypi/-/mdurl/0.1.2, MIT, approved, clearlydefined
31-
pypi/pypi/-/packaging/24.1, Apache-2.0 AND BSD-3-Clause, approved, clearlydefined
31+
pypi/pypi/-/packaging/24.2, (Apache-2.0 OR BSD-2-Clause) AND MIT, approved, #19866
3232
pypi/pypi/-/pluggy/1.5.0, MIT, approved, clearlydefined
3333
pypi/pypi/-/pycparser/2.22, LGPL-2.0-or-later AND BSD-3-Clause, approved, #14636
3434
pypi/pypi/-/pydantic/2.6.3, MIT, approved, #13069
@@ -39,6 +39,7 @@ pypi/pypi/-/pytest/8.1.1, MIT, approved, #19365
3939
pypi/pypi/-/python-dotenv/1.0.1, BSD-2-Clause AND BSD-3-Clause, approved, clearlydefined
4040
pypi/pypi/-/python-keycloak/4.0.1, MIT, approved, clearlydefined
4141
pypi/pypi/-/python-multipart/0.0.20, Apache-2.0, approved, clearlydefined
42+
pypi/pypi/-/requests-mock/1.12.1, Apache-2.0, approved, clearlydefined
4243
pypi/pypi/-/requests-toolbelt/1.0.0, Apache-2.0, approved, #15024
4344
pypi/pypi/-/requests/2.32.3, Apache-2.0 AND MIT AND Apache-2.0, approved, #14884
4445
pypi/pypi/-/rfc3986/1.5.0, Apache-2.0, approved, #19390

pyproject.toml

+43-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1+
###############################################################
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License, Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0.
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
###############################################################
19+
120
[build-system]
2-
requires = ["poetry-core>=2.0"]
3-
build-backend = "poetry.core.masonry.api"
21+
requires = ["poetry-core>=2.0", "poetry-dynamic-versioning>=1.5.2,<2.0.0"]
22+
build-backend = "poetry_dynamic_versioning.backend"
423

524
[project]
625
name = "tractusx_sdk"
7-
version = "0.0.2"
826
description = "Eclipse Tractus-X Software Development KIT - The Dataspace & Industry Foundation Middleware"
927
license = {text = "Apache-2.0"}
1028
readme = "README.md"
1129
requires-python = ">=3.12,<4.0"
12-
1330
dependencies = [
1431
"annotated-types (==0.7.0)",
1532
"anyio (==4.8.0)",
@@ -71,13 +88,35 @@ dependencies = [
7188
"watchfiles (==1.0.4)",
7289
"websockets (==14.2)"
7390
]
91+
dynamic = ["version"]
7492

7593
[project.urls]
7694
repository = "https://github.com/eclipse-tractusx/tractusx-sdk"
7795
documentation = "https://github.com/eclipse-tractusx/tractusx-sdk/tree/main/docs"
7896
"Issues" = "https://github.com/eclipse-tractusx/tractusx-sdk/issues"
7997
"Changelog" = "https://github.com/eclipse-tractusx/tractusx-sdk/blob/main/CHANGELOG.md"
8098

99+
[tool.poetry]
100+
version = "0.0.0" #Base version for plugin to work
101+
102+
[tool.poetry.requires-plugins]
103+
poetry-dynamic-versioning = { version = ">=1.5.2,<2.0.0", extras = ["plugin"] }
104+
105+
[tool.poetry-dynamic-versioning]
106+
enable = true
107+
vcs = "git"
108+
latest-tag = true
109+
style = "semver" #Ensures semver versioning standard is used - Eclipse Foundation requirement
110+
strict = true
111+
112+
[tool.poetry-dynamic-versioning.substitution]
113+
files = ["*/__init__.py", "src/*/*/__init__.py"]
114+
patterns = [
115+
"(__version__ = ')[0-9]+\\.[0-9]+\\.[0-9]+(')",
116+
"(__version__ = \")[0-9]+\\.[0-9]+\\.[0-9]+(\")"
117+
]
118+
119+
81120
[tool.pytest.ini_options]
82121
minversion = "6.0"
83122
testpaths = ["tests"]

0 commit comments

Comments
 (0)