You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+59-1Lines changed: 59 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ copied to forks).
93
93
#### Installing the Python Client in a virtual environment with pipenv
94
94
Perform the following one-time steps to set up your local environment.
95
95
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.
97
97
98
98
2. Install `pipenv` by running `pip install pipenv`.
99
99
- 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
223
223
#### Integration testing for external collaborators
224
224
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.
225
225
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
+
226
284
### Asynchronous methods
227
285
[Asyncio](https://docs.python.org/3/library/asyncio.html) is the future of the Synapse
228
286
Python Client. As such, the expectation is that all future methods that rely on async
0 commit comments