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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ jobs:
run: make lint
- name: Test
working-directory: ./sdk-repo-updated
run: make test
run: make test
2 changes: 1 addition & 1 deletion .github/workflows/sdk-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
GH_REPO: 'stackitcloud/stackit-sdk-python'
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
run: |
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"
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"
7 changes: 5 additions & 2 deletions scripts/generate-sdk/languages/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ generate_python_sdk() {
rm "${SERVICES_FOLDER}/${service}/stackit/__init__.py"
rm "${SERVICES_FOLDER}/${service}/.github/workflows/python.yml"

# Create source layout
mkdir "${SERVICES_FOLDER}/${service}/src"
mv "${SERVICES_FOLDER}/${service}/stackit/" "${SERVICES_FOLDER}/${service}/src/"

# If the service has a wait package files, move them inside the service folder
if [ -d ${sdk_services_backup_dir}/${service}/wait ]; then
if [ -d ${sdk_services_backup_dir}/${service}/src/wait ]; then
echo "Found ${service} \"wait\" package"
cp -r ${sdk_services_backup_dir}/${service}/wait ${SERVICES_FOLDER}/${service}/wait
cp -r ${sdk_services_backup_dir}/${service}/src/wait ${SERVICES_FOLDER}/${service}/src/wait
fi

# If the service has a CHANGELOG file, move it inside the service folder
Expand Down
64 changes: 38 additions & 26 deletions templates/python/pyproject.mustache
Original file line number Diff line number Diff line change
@@ -1,48 +1,60 @@
[project]
[tool.poetry]
name = "{{{pythonPackageName}}}"
version = "{{{packageVersion}}}"
authors = [
{ name="{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}}", email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}" },
"{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>",
]
description = "{{{appName}}}"
#readme = "README.md"
#license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
dependencies = [
"requests ~= 2.32.3",
"python_dateutil ~= 2.5.3",
"pydantic ~= 2.9.2",
"stackit-core ~= 0.0.1",
packages = [
{ include = "stackit", from="src" }
]

[project.optional-dependencies]
dev = [
"black >= 24.8.0",
"pytest ~= 8.3.2",
"flake8 ~= 7.1.0",
"flake8-black ~= 0.3.6",
"flake8-pyproject ~= 1.2.3",
"flake8-quotes ~= 3.4.0",
"flake8-bandit ~= 4.1.1",
"flake8-bugbear ~= 24.8.19",
"flake8-eradicate ~= 1.5.0",
"flake8-eol ~= 0.0.8",
"autoimport ~= 1.6.1",
"isort ~= 5.13.2",
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
stackit-core = "^0.0.1"
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"

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

[tool.pytest.ini_options]
pythonpath = [
"src"
]
testpaths = [
"tests"
]

[tool.black]
line-length = 120
Expand Down Expand Up @@ -85,9 +97,9 @@ per-file-ignores = """
./tests/*: S101,
# F841: some variables get generated but may not be used, depending on the api-spec
# E501: long descriptions/string values might lead to lines that are too long
./stackit/*/models/*: F841,E501
./src/stackit/*/models/*: F841,E501
# F841: some variables get generated but may not be used, depending on the api-spec
# E501: long descriptions/string values might lead to lines that are too long
# B028: stacklevel for deprecation warning is irrelevant
./stackit/*/api/default_api.py: F841,B028,E501
./src/stackit/*/api/default_api.py: F841,B028,E501
"""
Loading