Skip to content

Commit f2adf07

Browse files
committed
Merge branch 'synpy-1636-move-to-electron' into synpy-1653-sign-mac-os-standalone
2 parents 3744592 + d069665 commit f2adf07

220 files changed

Lines changed: 44197 additions & 3889 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/delete_evaluations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Evaluation, Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/delete_projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/delete_teams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent team deletions
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/empty_trash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/workflows/build.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
# if changing the below change the run-integration-tests versions and the check-deploy versions
6565
# Make sure that we are running the integration tests on the first and last versions of the matrix
66-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
66+
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
6767

6868
runs-on: ${{ matrix.os }}
6969

@@ -92,7 +92,7 @@ jobs:
9292
path: |
9393
${{ steps.get-dependencies.outputs.site_packages_loc }}
9494
${{ steps.get-dependencies.outputs.site_bin_dir }}
95-
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v28
95+
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v29
9696

9797
- name: Install py-dependencies
9898
if: steps.cache-dependencies.outputs.cache-hit != 'true'
@@ -117,7 +117,7 @@ jobs:
117117
pytest -sv --cov-append --cov=. --cov-report xml tests/unit
118118
- name: Check for Secret availability
119119
id: secret-check
120-
if: ${{ contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.13"]'), matrix.python) }}
120+
if: ${{ contains(fromJSON('["3.10"]'), matrix.python) || contains(fromJSON('["3.14"]'), matrix.python) }}
121121
# perform secret check & put boolean result as an output
122122
shell: bash
123123
run: |
@@ -134,7 +134,7 @@ jobs:
134134
fi
135135
136136
- name: Download Failed Tests from Previous Attempt
137-
if: ${{ github.run_attempt > 1 && (contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.13"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
137+
if: ${{ github.run_attempt > 1 && (contains(fromJSON('["3.10"]'), matrix.python) || contains(fromJSON('["3.14"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
138138
uses: actions/download-artifact@v4
139139
with:
140140
name: failed-tests-${{ matrix.os }}-${{ matrix.python }}
@@ -150,25 +150,25 @@ jobs:
150150
shell: bash
151151

152152
# keep versions consistent with the first and last from the strategy matrix
153-
if: ${{ (contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.13"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
153+
if: ${{ (contains(fromJSON('["3.10"]'), matrix.python) || contains(fromJSON('["3.14"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
154154
run: |
155155
# Set SYNAPSE_PROFILE based on OS and Python version
156156
if [ "${{ startsWith(matrix.os, 'ubuntu') }}" == "true" ]; then
157-
if [ "${{ matrix.python }}" == "3.9" ]; then
157+
if [ "${{ matrix.python }}" == "3.10" ]; then
158158
export SYNAPSE_PROFILE="TestUbuntuMinimumPython"
159-
elif [ "${{ matrix.python }}" == "3.13" ]; then
159+
elif [ "${{ matrix.python }}" == "3.14" ]; then
160160
export SYNAPSE_PROFILE="TestUbuntuMaximumPython"
161161
fi
162162
elif [ "${{ startsWith(matrix.os, 'windows') }}" == "true" ]; then
163-
if [ "${{ matrix.python }}" == "3.9" ]; then
163+
if [ "${{ matrix.python }}" == "3.10" ]; then
164164
export SYNAPSE_PROFILE="TestWindowsMinimumPython"
165-
elif [ "${{ matrix.python }}" == "3.13" ]; then
165+
elif [ "${{ matrix.python }}" == "3.14" ]; then
166166
export SYNAPSE_PROFILE="TestWindowsMaximumPython"
167167
fi
168168
elif [ "${{ startsWith(matrix.os, 'macos') }}" == "true" ]; then
169-
if [ "${{ matrix.python }}" == "3.9" ]; then
169+
if [ "${{ matrix.python }}" == "3.10" ]; then
170170
export SYNAPSE_PROFILE="TestMacosMinimumPython"
171-
elif [ "${{ matrix.python }}" == "3.13" ]; then
171+
elif [ "${{ matrix.python }}" == "3.14" ]; then
172172
export SYNAPSE_PROFILE="TestMacosMaximumPython"
173173
fi
174174
fi
@@ -210,16 +210,6 @@ jobs:
210210
# Setup ignore patterns based on Python version
211211
IGNORE_FLAGS="--ignore=tests/integration/synapseclient/test_command_line_client.py"
212212
213-
if [ "${{ matrix.python }}" == "3.9" ]; then
214-
# For min Python version, ignore async tests
215-
IGNORE_FLAGS="$IGNORE_FLAGS --ignore=tests/integration/synapseclient/models/async/"
216-
echo "Running integration tests for Min Python version (3.9) - ignoring async tests"
217-
elif [ "${{ matrix.python }}" == "3.13" ]; then
218-
# For max Python version, ignore synchronous tests
219-
IGNORE_FLAGS="$IGNORE_FLAGS --ignore=tests/integration/synapseclient/models/synchronous/"
220-
echo "Running integration tests for Max Python version (3.13) - ignoring synchronous tests"
221-
fi
222-
223213
# Check if we should run only failed tests from previous attempt
224214
if [[ -f failed_tests.txt && -s failed_tests.txt ]]; then
225215
echo "::notice::Retry attempt ${{ github.run_attempt }} detected - running only previously failed tests"
@@ -370,7 +360,7 @@ jobs:
370360

371361
- uses: actions/setup-python@v5
372362
with:
373-
python-version: 3.9
363+
python-version: 3.10
374364

375365
- name: set-release-env
376366
shell: bash
@@ -680,7 +670,7 @@ jobs:
680670
os: [ubuntu-24.04, macos-13, windows-2022]
681671

682672
# python versions should be consistent with the strategy matrix and the runs-integration-tests versions
683-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
673+
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
684674

685675
runs-on: ${{ matrix.os }}
686676

.github/workflows/test-cleanup.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ jobs:
1313
permissions:
1414
contents: read
1515

16+
strategy:
17+
matrix:
18+
synapse_profile:
19+
- "TestUbuntuMinimumPython"
20+
- "TestUbuntuMaximumPython"
21+
- "TestWindowsMinimumPython"
22+
- "TestWindowsMaximumPython"
23+
- "TestMacosMinimumPython"
24+
- "TestMacosMaximumPython"
25+
- "" # Empty string for default profile (no SYNAPSE_PROFILE set)
26+
1627
steps:
1728
- name: Checkout repository
1829
uses: actions/checkout@v4
@@ -67,17 +78,33 @@ jobs:
6778
mv test.synapseConfig ~/.synapseConfig
6879
6980
- name: Run evaluation deletion script
81+
shell: bash
7082
run: |
83+
if [ -n "${{ matrix.synapse_profile }}" ]; then
84+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
85+
fi
7186
python .github/scripts/delete_evaluations.py
7287
7388
- name: Run project deletion script
89+
shell: bash
7490
run: |
91+
if [ -n "${{ matrix.synapse_profile }}" ]; then
92+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
93+
fi
7594
python .github/scripts/delete_projects.py
7695
7796
- name: Run team deletion script
97+
shell: bash
7898
run: |
99+
if [ -n "${{ matrix.synapse_profile }}" ]; then
100+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
101+
fi
79102
python .github/scripts/delete_teams.py
80103
81104
- name: Run empty trash script
105+
shell: bash
82106
run: |
107+
if [ -n "${{ matrix.synapse_profile }}" ]; then
108+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
109+
fi
83110
python .github/scripts/empty_trash.py

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ virtualenvs
66
examples_temp
77
.DS_Store
88
deploy.sh
9+
.venv/
910

1011
junk/
1112
nose.cfg
@@ -33,6 +34,7 @@ coverage.xml
3334
.ipynb_checkpoints
3435
*.ipynb
3536
.env
37+
test.synapseConfig
3638
*.spec
3739

3840
synapse-electron/node_modules

CONTRIBUTING.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ copied to forks).
9393
#### Installing the Python Client in a virtual environment with pipenv
9494
Perform the following one-time steps to set up your local environment.
9595
96-
1. This package uses Python, if you have not already, please install [pyenv](https://github.com/pyenv/pyenv#installation) to manage your Python versions. Versions supported by this package are all versions >=3.9 and <=3.13. If you do not install `pyenv` make sure that Python and `pip` are installed correctly and have been added to your PATH by running `python3 --version` and `pip3 --version`. If your installation was successful, your terminal will return the versions of Python and `pip` that you installed. **Note**: If you have `pyenv` it will install a specific version of Python for you.
96+
1. This package uses Python, if you have not already, please install [pyenv](https://github.com/pyenv/pyenv#installation) to manage your Python versions. Versions supported by this package are all versions >=3.10 and <=3.14. If you do not install `pyenv` make sure that Python and `pip` are installed correctly and have been added to your PATH by running `python3 --version` and `pip3 --version`. If your installation was successful, your terminal will return the versions of Python and `pip` that you installed. **Note**: If you have `pyenv` it will install a specific version of Python for you.
9797
9898
2. Install `pipenv` by running `pip install pipenv`.
9999
- If you already have `pipenv` installed, ensure that the version is >=2023.9.8 to avoid compatibility issues.
@@ -223,6 +223,64 @@ When integration tests are ran in the Github CI/CD pipeline it will upload the t
223223
#### Integration testing for external collaborators
224224
As an external collaborator you will not have access to a development account and environment to run the integration tests against. Either request that a Sage Bionetworks staff member run your integration tests via a pull request, or, contact us via the [Service Desk](https://sagebionetworks.jira.com/servicedesk/customer/portal/9) to requisition a development account for integration testing only.
225225
226+
### Managing Python version changes
227+
228+
When adding support for a new Python version or dropping support for an old version, several files across the codebase and CI/CD pipelines must be updated to ensure consistency and proper testing coverage.
229+
230+
#### Adding a new Python version
231+
232+
When adding support for a new Python version (e.g., adding Python 3.15), update the following:
233+
234+
**Code configuration files:**
235+
1. **`setup.cfg`**:
236+
- Add the new version to the `classifiers` list under `[metadata]` (e.g., `Programming Language :: Python :: 3.15`)
237+
- Update the `python_requires` constraint under `[options]` to include the new version (e.g., `>=3.10, <3.16`)
238+
239+
2. **`pyproject.toml`**:
240+
- Update the `target-version` list in the `[tool.black]` section to include the new version if needed
241+
242+
3. **`Dockerfile`**:
243+
- Update the base image to use the new Python version (e.g., `FROM python:3.15-slim`)
244+
245+
**CI/CD configuration files:**
246+
1. **`.github/workflows/build.yml`**:
247+
- Add the new version to the `python` matrix under the `test` job strategy
248+
- Ensure the new version is included in integration test runs (typically the latest version should be tested)
249+
- Update any Python version comments or documentation within the workflow
250+
251+
**Testing:**
252+
- Run the full test suite (both unit and integration tests) on the new Python version locally before submitting a PR
253+
- Verify that all CI/CD pipelines pass with the new version included
254+
255+
#### Dropping an old Python version
256+
257+
When dropping support for an old Python version (e.g., removing Python 3.10), update the following:
258+
259+
**Code configuration files:**
260+
1. **`setup.cfg`**:
261+
- Remove the old version from the `classifiers` list under `[metadata]`
262+
- Update the `python_requires` constraint under `[options]` to reflect the new minimum version (e.g., `>=3.11, <3.15`)
263+
264+
2. **`pyproject.toml`**:
265+
- Update the `target-version` list in the `[tool.black]` section to remove the old version
266+
267+
3. **`Dockerfile`**:
268+
- Ensure the base image uses a supported Python version
269+
270+
**CI/CD configuration files:**
271+
1. **`.github/workflows/build.yml`**:
272+
- Remove the old version from the `python` matrix under the `test` job strategy
273+
- Update the cache key version (e.g., increment `v28` to `v29`) to invalidate old caches
274+
275+
**Documentation:**
276+
- Update the README.md and any getting started documentation to reflect the new supported Python version range
277+
- Update CONTRIBUTING.md (this file) if it mentions specific Python versions in examples
278+
279+
**Important considerations:**
280+
- Python version changes should be coordinated with a release and clearly communicated in release notes
281+
- Breaking compatibility with a Python version is a significant change and should typically coincide with a major or minor version bump
282+
- Always test thoroughly on the minimum and maximum supported Python versions before release
283+
226284
### Asynchronous methods
227285
[Asyncio](https://docs.python.org/3/library/asyncio.html) is the future of the Synapse
228286
Python Client. As such, the expectation is that all future methods that rely on async

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim
1+
FROM python:3.14-slim
22
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
33

44
RUN apt-get update \

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ synapseclient = {file = ".", path = "."}
1010
python_version = "3.12.6"
1111

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

0 commit comments

Comments
 (0)