Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,22 @@ jobs:
uses: ./.github/actions/build/python
- name: Generate SDK
uses: ./.github/actions/generate-sdk/python
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
- name: install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.4"
python-version: ${{ matrix.python-version }}
- name: Install sdk
working-directory: ./sdk-repo-updated
run: |
pip install poetry
poetry config virtualenvs.create false
python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
make install-dev
run: make install-dev
- name: Lint
working-directory: ./sdk-repo-updated
run: |
. .venv/bin/activate
make lint
run: make lint
- name: Test
working-directory: ./sdk-repo-updated
run: |
. .venv/bin/activate
make test
run: make test

main-java:
name: CI [Java]
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/sdk-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ jobs:
uses: ./.github/actions/build/python
- name: Generate SDK
uses: ./.github/actions/generate-sdk/python
- name: install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.4"
- name: Push SDK
env:
GH_REPO: "stackitcloud/stackit-sdk-python"
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
run: |
set -e
python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
(cd ./sdk-repo-updated && make install-dev)
(cd ./sdk-repo-updated && uv install)
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "git@github.com:stackitcloud/stackit-sdk-python.git" "python"

main-java:
Expand Down
82 changes: 47 additions & 35 deletions languages/python/templates/pyproject.mustache
Original file line number Diff line number Diff line change
@@ -1,55 +1,67 @@
[project]
name = "{{{pythonPackageName}}}"

[tool.poetry]
name = "{{{pythonPackageName}}}"
version = "v0.0.1a"
authors = [
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
]
description = "{{{appName}}}"
authors = [{name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud"}]
requires-python = ">=3.9,<4.0"
readme = "README.md"
#license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
packages = [
{ include = "stackit", from="src" }
dependencies = [
"stackit-core>=0.0.1a",
"requests>=2.32.3",
"pydantic>=2.9.2",
"python-dateutil>=2.9.0.post0",
]

[tool.poetry.dependencies]
python = "^3.9"
stackit-core = ">=0.0.1a"
requests = ">=2.32.3"
pydantic = ">=2.9.2"
python-dateutil = ">=2.9.0.post0"

[tool.poetry.group.dev.dependencies]
black = ">=24.8.0"
pytest = ">=8.3.3"
flake8 = [
{ version= ">=5.0.3", python="<3.12"},
{ version= ">=6.0.1", python=">=3.12"}
]
flake8-black = ">=0.3.6"
flake8-pyproject = ">=1.2.3"
autoimport = ">=1.6.1"
flake8-eol = ">=0.0.8"
flake8-eradicate = ">=1.5.0"
flake8-bandit = ">=4.1.1"
flake8-bugbear = ">=23.1.14"
flake8-quotes = ">=3.4.0"
isort = ">=5.13.2"

[project.urls]
Homepage = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}"
Issues = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}/issues"

[dependency-groups]
dev = [
"black>=24.8.0",
"pytest>=8.3.3",
"flake8>=5.0.3 ; python_full_version < '3.12'",
"flake8>=6.0.1 ; python_full_version >= '3.12'",
"flake8-black>=0.3.6",
"flake8-pyproject>=1.2.3",
"autoimport>=1.6.1",
"flake8-eol>=0.0.8",
"flake8-eradicate>=1.5.0",
"flake8-bandit>=4.1.1",
"flake8-bugbear>=23.1.14",
"flake8-quotes>=3.4.0",
"isort>=5.13.2",
]

[tool.uv]
default-groups = "all"

[tool.uv.sources]
stackit-core = { path = "../../stackit-core" }

[tool.hatch.build.targets.sdist]
include = ["src/stackit"]

[tool.hatch.build.targets.wheel]
include = ["src/stackit"]

[tool.hatch.build.targets.wheel-sources]
"src/stackit" = "stackit"

[build-system]
requires = ["setuptools", "poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
pythonpath = [
Expand Down
8 changes: 4 additions & 4 deletions scripts/generate-sdk/languages/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ generate_python_sdk() {
cp -r "${sdk_services_backup_dir}/${service}/pyproject.toml" "${SERVICES_FOLDER}/${service}/pyproject.toml"
fi

# If the service has a poetry.lock file, move them inside the service folder
if [ -f "${sdk_services_backup_dir}/${service}/poetry.lock" ]; then
echo "Found ${service} \"poetry.lock\" file"
cp -r "${sdk_services_backup_dir}/${service}/poetry.lock" "${SERVICES_FOLDER}/${service}/poetry.lock"
# If the service has a uv.lock file, move them inside the service folder
if [ -f "${sdk_services_backup_dir}/${service}/uv.lock" ]; then
echo "Found ${service} \"uv.lock\" file"
cp -r "${sdk_services_backup_dir}/${service}/uv.lock" "${SERVICES_FOLDER}/${service}/uv.lock"
fi

# If the service has a CHANGELOG file, move it inside the service folder
Expand Down
Loading