Skip to content

Commit 3eed8e5

Browse files
fix: python-version parameter and python3.13 compatibility adjustments (#449)
### Description Add python-version parameter to control version of python during tests. Don't install requirements_dev.txt in unit tests. Fix for accessing internal libraries during build job. ### Checklist - [x] `README.md` has been updated or is not required - [ ] push trigger tests - [ ] manual release test - [ ] automated releases test - [x] pull request trigger tests - [ ] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed ### Testing done https://github.com/splunk/splunk-add-on-for-microsoft-cloud-services/actions/runs/19634453703
2 parents 5e16c12 + 75aa3e6 commit 3eed8e5

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ on:
3939
required: false
4040
description: "branch for k8s manifests to run the tests on"
4141
type: string
42-
default: "v3.6"
42+
default: "v4.0"
4343
scripted-inputs-os-list:
4444
required: false
4545
description: "list of OS used for scripted input tests"
@@ -57,6 +57,11 @@ on:
5757
description: "Forces WFE tests to run only on the latest Splunk when set to true. When set to false - will run on all supported Splunk versions required for the release. When not set - default behavior."
5858
type: string
5959
default: "false"
60+
python-version:
61+
required: false
62+
description: "Python version to use for testing"
63+
type: string
64+
default: "3.9"
6065
secrets:
6166
GH_TOKEN_ADMIN:
6267
description: Github admin token
@@ -110,7 +115,7 @@ concurrency:
110115
group: ${{ github.head_ref || github.run_id }}
111116
cancel-in-progress: true
112117
env:
113-
PYTHON_VERSION: "3.9"
118+
PYTHON_VERSION: ${{ inputs.python-version }}
114119
POETRY_VERSION: "2.1.4"
115120
POETRY_EXPORT_PLUGIN_VERSION: "1.9.0"
116121
GS_IMAGE_VERSION: "1.0.0"
@@ -489,16 +494,13 @@ jobs:
489494
run: |
490495
if [ -f "poetry.lock" ]
491496
then
492-
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }} poetry-plugin-export==${{ env.POETRY_EXPORT_PLUGIN_VERSION }}
497+
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }} poetry-plugin-export==${{ env.POETRY_EXPORT_PLUGIN_VERSION }}
493498
mkdir -p package/lib || true
494499
poetry check --lock
495-
poetry export --without-hashes -o package/lib/requirements.txt
496-
fi
497-
if [ ! -f dev_deps/requirements_dev.txt ]; then
498-
echo "No dev_deps/requirements_dev.txt. Migrate your dependencies to dev_deps/requirements_dev.txt"
499-
exit 1
500-
else
501-
echo "Found dev_deps/requirements_dev.txt. Installing dev dependencies in an isolated environment";
500+
poetry export --without-hashes --with dev -o package/lib/requirements.txt
501+
else
502+
echo "No poetry.lock found, make sure your dependencies are managed through poetry, exiting"
503+
exit 1
502504
fi
503505
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
504506
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://[email protected]
@@ -568,6 +570,8 @@ jobs:
568570
python-version: ${{ env.PYTHON_VERSION }}
569571
- name: create requirements file for pip
570572
run: |
573+
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
574+
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://[email protected]
571575
if [ -f "poetry.lock" ]
572576
then
573577
echo " poetry.lock found "

0 commit comments

Comments
 (0)