Skip to content

Commit 1e9dfc7

Browse files
authored
fix(python): fix core import in pyproject.toml and ensure creation of uv.lock (#256)
uv.lock wasn't created properly for new services
1 parent efd2ff1 commit 1e9dfc7

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ jobs:
8282
java-version: ${{ env.JAVA_VERSION }}
8383
- name: Checkout
8484
uses: actions/checkout@v4
85+
- name: install uv
86+
uses: astral-sh/setup-uv@v7
87+
with:
88+
version: "0.10.4"
8589
- name: Build
8690
uses: ./.github/actions/build/python
8791
- name: Generate SDK

.github/workflows/sdk-pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ jobs:
6363
uses: actions/checkout@v4
6464
- name: Build
6565
uses: ./.github/actions/build/python
66-
- name: Generate SDK
67-
uses: ./.github/actions/generate-sdk/python
6866
- name: install uv
6967
uses: astral-sh/setup-uv@v7
7068
with:
7169
version: "0.10.4"
70+
- name: Generate SDK
71+
uses: ./.github/actions/generate-sdk/python
7272
- name: Push SDK
7373
env:
7474
GH_REPO: "stackitcloud/stackit-sdk-python"

languages/python/templates/pyproject.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dev = [
4848
default-groups = "all"
4949

5050
[tool.uv.sources]
51-
stackit-core = { path = "../../stackit-core" }
51+
stackit-core = { path = "../../core" }
5252

5353
[tool.hatch.build.targets.sdist]
5454
include = ["src/stackit"]
@@ -108,4 +108,4 @@ docstring-quotes = '"""'
108108
multiline-quotes = '"""'
109109
ban-relative-imports = true
110110
# Exclude generated code
111-
extend-exclude = [ "src/stackit/*/models/*", "src/stackit/*/api/*", "src/stackit/*/*.py" ]
111+
extend-exclude = [ "src/stackit/*/models/*", "src/stackit/*/api/*", "src/stackit/*/*.py" ]

scripts/generate-sdk/languages/python.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ generate_python_sdk() {
153153
if [ -f "${sdk_services_backup_dir}/${service}/uv.lock" ]; then
154154
echo "Found ${service} \"uv.lock\" file"
155155
cp -r "${sdk_services_backup_dir}/${service}/uv.lock" "${SERVICES_FOLDER}/${service}/uv.lock"
156+
else
157+
uv lock --directory "${SERVICES_FOLDER}/${service}"
156158
fi
157159

158160
# If the service has a CHANGELOG file, move it inside the service folder

0 commit comments

Comments
 (0)