Skip to content

Commit 47e8709

Browse files
BWMacBryanFauble
andauthored
[SYNPY-1517] Deprecate Python 3.8 Support (#1134)
* Run in py 3.12 * Swap to `sysconfig` instead of distutils * Swap to use `get_path` * Unit test patching * Remove kwarg * Run on 3.8 and 3.12 * Test patch * bump up timeout * deprecates python 3.8 * pre-commit * fix importlib import * adds importlib_resources dependency * bump cache version * fix CI * revert docs to 5.0 * remove secrets dupe * fix formatting * updates Pipfile.lock * fix docs versions * restricts 3.13 * undo importlib_resources * revert pandas changes * revert importlib_resources * bump cache * pre-commit --------- Co-authored-by: BryanFauble <[email protected]>
1 parent 97085de commit 47e8709

File tree

8 files changed

+86
-382
lines changed

8 files changed

+86
-382
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
# if changing the below change the run-integration-tests versions and the check-deploy versions
5151
# 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']
52+
python: ['3.9', '3.10', '3.11', '3.12']
5353

5454
runs-on: ${{ matrix.os }}
5555

@@ -78,7 +78,7 @@ jobs:
7878
path: |
7979
${{ steps.get-dependencies.outputs.site_packages_loc }}
8080
${{ steps.get-dependencies.outputs.site_bin_dir }}
81-
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v18
81+
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v20
8282

8383
- name: Install py-dependencies
8484
if: steps.cache-dependencies.outputs.cache-hit != 'true'
@@ -101,7 +101,7 @@ jobs:
101101
pytest -sv --cov-append --cov=. --cov-report xml tests/unit
102102
- name: Check for Secret availability
103103
id: secret-check
104-
if: ${{ contains(fromJSON('["3.8"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python) }}
104+
if: ${{ contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python) }}
105105
# perform secret check & put boolean result as an output
106106
shell: bash
107107
run: |
@@ -160,7 +160,7 @@ jobs:
160160
shell: bash
161161

162162
# keep versions consistent with the first and last from the strategy matrix
163-
if: ${{ (contains(fromJSON('["3.8"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
163+
if: ${{ (contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.12"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
164164
run: |
165165
# decrypt the encrypted test synapse configuration
166166
openssl aes-256-cbc -K ${{ secrets.encrypted_d17283647768_key }} -iv ${{ secrets.encrypted_d17283647768_iv }} -in test.synapseConfig.enc -out test.synapseConfig -d
@@ -264,7 +264,7 @@ jobs:
264264

265265
- uses: actions/setup-python@v5
266266
with:
267-
python-version: 3.8
267+
python-version: 3.9
268268

269269
- name: set-release-env
270270
shell: bash
@@ -402,7 +402,7 @@ jobs:
402402
os: [ubuntu-20.04, macos-12, windows-2022]
403403

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

407407
runs-on: ${{ matrix.os }}
408408

CONTRIBUTING.md

Lines changed: 1 addition & 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.8 and <=3.11. 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.9 and <=3.12. 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.

Pipfile.lock

Lines changed: 69 additions & 357 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ or by sending an email to [[email protected]](mailto:python
3636
Installation
3737
------------
3838

39-
The Python Synapse client has been tested on 3.8, 3.9, 3.10 and 3.11 on Mac OS X, Ubuntu Linux and Windows.
39+
The Python Synapse client has been tested on versions 3.9, 3.10, 3.11 and 3.12 on Mac OS X, Ubuntu Linux and Windows.
4040

41-
**Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.8**
41+
**Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.9**
4242

4343
### Install using pip
4444

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ prefer-stubs=no
9393

9494
# Minimum Python version to use for version dependent checks. Will default to
9595
# the version used to run pylint.
96-
py-version=3.8
96+
py-version=3.9
9797

9898
# Discover python modules and packages in the file system subtree.
9999
recursive=no

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ platforms = any
2323
classifiers =
2424
Development Status :: 5 - Production/Stable
2525
Programming Language :: Python
26-
Programming Language :: Python :: 3.8
2726
Programming Language :: Python :: 3.9
2827
Programming Language :: Python :: 3.10
2928
Programming Language :: Python :: 3.11
@@ -43,7 +42,7 @@ classifiers =
4342
zip_safe = False
4443
include_package_data = True
4544
packages = find:
46-
python_requires = >=3.8
45+
python_requires = >=3.9, <3.13
4746
install_requires =
4847
# "requests>=2.22.0,<2.30.0; python_version<'3.10'",
4948
requests>=2.22.0,<3.0
@@ -104,7 +103,6 @@ tests =
104103

105104
pandas =
106105
pandas>=1.5,<3.0
107-
numpy<2.0.0
108106

109107
pysftp =
110108
pysftp>=0.2.8,<0.3

synapseclient/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@
3131
from .team import Team, TeamMember, UserGroupHeader, UserProfile
3232
from .wiki import Wiki
3333

34-
# ref = importlib.resources.files(__name__).joinpath("synapsePythonClient")
35-
# with ref.open("r") as fp:
36-
# __version__ = json.load(fp)["latestVersion"]
37-
# TODO: switch to the above after python 3.8 is deprecated
38-
with importlib.resources.path(__name__, "synapsePythonClient") as ref:
39-
__version__ = json.load(open(ref))["latestVersion"]
34+
ref = importlib.resources.files(__name__).joinpath("synapsePythonClient")
35+
with ref.open("r") as fp:
36+
__version__ = json.load(fp)["latestVersion"]
4037

4138
__all__ = [
4239
# objects

synapseclient/core/version_check.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,9 @@ def _version_tuple(version, levels=2):
165165

166166
def _get_version_info(version_url=_VERSION_URL):
167167
if version_url is None:
168-
# ref = importlib_resources.files("synapseclient").joinpath("synapsePythonClient")
169-
# with ref.open("r") as fp:
170-
# pkg_metadata = json.loads(fp.read())
171-
# TODO: switch to the above after python 3.8 is deprecated
172-
with importlib.resources.path(__name__, "synapsePythonClient") as ref:
173-
pkg_metadata = json.load(ref)
168+
ref = importlib.resources.files("synapseclient").joinpath("synapsePythonClient")
169+
with ref.open("r") as fp:
170+
pkg_metadata = json.loads(fp.read())
174171
return pkg_metadata
175172
else:
176173
headers = {"Accept": "application/json; charset=UTF-8"}

0 commit comments

Comments
 (0)