Skip to content

Commit 97085de

Browse files
authored
[SYNPY-1520] Support python 3.12 (#1133)
* Support py 3.12
1 parent 35db9a9 commit 97085de

File tree

10 files changed

+227
-246
lines changed

10 files changed

+227
-246
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/checkout@v4
3636
- uses: actions/setup-python@v5
3737
with:
38-
python-version: '3.11'
38+
python-version: '3.12'
3939
- uses: pre-commit/[email protected]
4040

4141

@@ -48,7 +48,8 @@ jobs:
4848
os: [ubuntu-20.04, macos-12, windows-2022]
4949

5050
# if changing the below change the run-integration-tests versions and the check-deploy versions
51-
python: [3.8, '3.9', '3.10', '3.11']
51+
# Make sure that we are running the integration tests on the first and last versions of the matrix
52+
python: [3.8, '3.9', '3.10', '3.11', '3.12']
5253

5354
runs-on: ${{ matrix.os }}
5455

@@ -62,8 +63,8 @@ jobs:
6263
- name: get-dependencies-location
6364
shell: bash
6465
run: |
65-
SITE_PACKAGES_LOCATION=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
66-
SITE_BIN_DIR=$(python3 -c "import os; import platform; import distutils.sysconfig; pre = distutils.sysconfig.get_config_var('prefix'); bindir = os.path.join(pre, 'Scripts' if platform.system() == 'Windows' else 'bin'); print(bindir)")
66+
SITE_PACKAGES_LOCATION=$(python -c "from sysconfig import get_path; print(get_path('purelib'))")
67+
SITE_BIN_DIR=$(python3 -c "import os; import platform; import sysconfig; pre = sysconfig.get_config_var('prefix'); bindir = os.path.join(pre, 'Scripts' if platform.system() == 'Windows' else 'bin'); print(bindir)")
6768
echo "site_packages_loc=$SITE_PACKAGES_LOCATION" >> $GITHUB_OUTPUT
6869
echo "site_bin_dir=$SITE_BIN_DIR" >> $GITHUB_OUTPUT
6970
id: get-dependencies
@@ -100,7 +101,7 @@ jobs:
100101
pytest -sv --cov-append --cov=. --cov-report xml tests/unit
101102
- name: Check for Secret availability
102103
id: secret-check
103-
if: ${{ contains(fromJSON('["3.9"]'), matrix.python) }}
104+
if: ${{ contains(fromJSON('["3.8"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python) }}
104105
# perform secret check & put boolean result as an output
105106
shell: bash
106107
run: |
@@ -159,7 +160,7 @@ jobs:
159160
shell: bash
160161

161162
# keep versions consistent with the first and last from the strategy matrix
162-
if: ${{ contains(fromJSON('["3.9"]'), matrix.python) && steps.secret-check.outputs.secrets_available == 'true'}}
163+
if: ${{ (contains(fromJSON('["3.8"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
163164
run: |
164165
# decrypt the encrypted test synapse configuration
165166
openssl aes-256-cbc -K ${{ secrets.encrypted_d17283647768_key }} -iv ${{ secrets.encrypted_d17283647768_iv }} -in test.synapseConfig.enc -out test.synapseConfig -d
@@ -192,7 +193,7 @@ jobs:
192193
fi
193194
194195
# use loadscope to avoid issues running tests concurrently that share scoped fixtures
195-
pytest -sv --reruns 3 --cov-append --cov=. --cov-report xml tests/integration -n auto --ignore=tests/integration/synapseclient/test_command_line_client.py --dist loadscope
196+
pytest -sv --reruns 3 --cov-append --cov=. --cov-report xml tests/integration -n 8 --ignore=tests/integration/synapseclient/test_command_line_client.py --dist loadscope
196197
197198
# Execute the CLI tests in a non-dist way because they were causing some test instability when being run concurrently
198199
pytest -sv --reruns 3 --cov-append --cov=. --cov-report xml tests/integration/synapseclient/test_command_line_client.py
@@ -206,7 +207,7 @@ jobs:
206207
- name: Upload coverage report
207208
id: upload_coverage_report
208209
uses: actions/upload-artifact@v4
209-
if: ${{ contains(fromJSON('["3.9"]'), matrix.python) && contains(fromJSON('["ubuntu-20.04"]'), matrix.os)}}
210+
if: ${{ contains(fromJSON('["3.12"]'), matrix.python) && contains(fromJSON('["ubuntu-20.04"]'), matrix.os)}}
210211
with:
211212
name: coverage-report
212213
path: coverage.xml
@@ -401,7 +402,7 @@ jobs:
401402
os: [ubuntu-20.04, macos-12, windows-2022]
402403

403404
# python versions should be consistent with the strategy matrix and the runs-integration-tests versions
404-
python: [3.8, '3.9', '3.10', '3.11']
405+
python: [3.8, '3.9', '3.10', '3.11', '3.12']
405406

406407
runs-on: ${{ matrix.os }}
407408

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ verify_ssl = true
77
synapseclient = {file = ".", editable = true, path = "."}
88

99
[requires]
10-
python_version = "3.11.3"
10+
python_version = "3.12.6"
1111

1212
[dev-packages]
1313
synapseclient = {file = ".", editable = true, path = ".", extras = ["dev", "tests", "pandas", "pysftp", "boto3", "docs"]}

0 commit comments

Comments
 (0)