Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYNPY-1517] Deprecate Python 3.8 Support #1134

Merged
merged 27 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

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

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

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
path: |
${{ steps.get-dependencies.outputs.site_packages_loc }}
${{ steps.get-dependencies.outputs.site_bin_dir }}
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v18
key: ${{ runner.os }}-${{ matrix.python }}-build-${{ env.cache-name }}-${{ hashFiles('setup.py') }}-v19
BWMac marked this conversation as resolved.
Show resolved Hide resolved

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

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

- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: set-release-env
shell: bash
Expand Down Expand Up @@ -402,7 +402,7 @@ jobs:
os: [ubuntu-20.04, macos-12, windows-2022]

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

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

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ copied to forks).
#### Installing the Python Client in a virtual environment with pipenv
Perform the following one-time steps to set up your local environment.

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.
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.

2. Install `pipenv` by running `pip install pipenv`.
- If you already have `pipenv` installed, ensure that the version is >=2023.9.8 to avoid compatibility issues.
Expand Down
442 changes: 85 additions & 357 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ or by sending an email to [[email protected]](mailto:python
Installation
------------

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.
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.

**Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.8**
**Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.9**
BWMac marked this conversation as resolved.
Show resolved Hide resolved

### Install using pip

Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ prefer-stubs=no

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

# Discover python modules and packages in the file system subtree.
recursive=no
Expand Down
13 changes: 6 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ platforms = any
classifiers =
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -43,7 +42,7 @@ classifiers =
zip_safe = False
include_package_data = True
packages = find:
python_requires = >=3.8
python_requires = >=3.9
BWMac marked this conversation as resolved.
Show resolved Hide resolved
install_requires =
# "requests>=2.22.0,<2.30.0; python_version<'3.10'",
requests>=2.22.0,<3.0
Expand All @@ -63,6 +62,7 @@ install_requires =
tqdm>=4.66.2,<5.0
async-lru~=2.0.4
psutil~=5.9.8
importlib_resources~=6.0.0
BWMac marked this conversation as resolved.
Show resolved Hide resolved
tests_require =
pytest>=7.0.0,<8.0
pytest-mock>=3.0,<4.0
Expand All @@ -73,7 +73,7 @@ tests_require =
pytest-rerunfailures~=12.0
func-timeout~=4.3
pytest-cov~=4.1.0
pandas>=1.5,<3.0
pandas>=2.1.2,<3.0

[options.extras_require]
dev =
Expand All @@ -88,7 +88,7 @@ dev =
pytest-cov~=4.1.0
black
pre-commit
pandas>=1.5,<3.0
pandas>=2.1.2,<3.0

tests =
pytest>=7.0.0,<8.0
Expand All @@ -100,11 +100,10 @@ tests =
pytest-rerunfailures~=12.0
func-timeout~=4.3
pytest-cov~=4.1.0
pandas>=1.5,<3.0
pandas>=2.1.2,<3.0

pandas =
pandas>=1.5,<3.0
numpy<2.0.0
pandas>=2.1.2,<3.0
BWMac marked this conversation as resolved.
Show resolved Hide resolved

pysftp =
pysftp>=0.2.8,<0.3
Expand Down
11 changes: 4 additions & 7 deletions synapseclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import importlib.resources
import json

import importlib_resources
import requests # ensure user-agent is set to track Synapse Python client usage
BWMac marked this conversation as resolved.
Show resolved Hide resolved

from .activity import Activity
Expand Down Expand Up @@ -31,12 +31,9 @@
from .team import Team, TeamMember, UserGroupHeader, UserProfile
from .wiki import Wiki

# ref = importlib.resources.files(__name__).joinpath("synapsePythonClient")
# with ref.open("r") as fp:
# __version__ = json.load(fp)["latestVersion"]
# TODO: switch to the above after python 3.8 is deprecated
with importlib.resources.path(__name__, "synapsePythonClient") as ref:
__version__ = json.load(open(ref))["latestVersion"]
ref = importlib_resources.files(__name__).joinpath("synapsePythonClient")
with ref.open("r") as fp:
__version__ = json.load(fp)["latestVersion"]

__all__ = [
# objects
Expand Down
11 changes: 4 additions & 7 deletions synapseclient/core/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

"""

import importlib.resources
import json
import re
import sys

import importlib_resources
import requests

import synapseclient
Expand Down Expand Up @@ -165,12 +165,9 @@ def _version_tuple(version, levels=2):

def _get_version_info(version_url=_VERSION_URL):
if version_url is None:
# ref = importlib_resources.files("synapseclient").joinpath("synapsePythonClient")
# with ref.open("r") as fp:
# pkg_metadata = json.loads(fp.read())
# TODO: switch to the above after python 3.8 is deprecated
with importlib.resources.path(__name__, "synapsePythonClient") as ref:
pkg_metadata = json.load(ref)
ref = importlib_resources.files("synapseclient").joinpath("synapsePythonClient")
with ref.open("r") as fp:
pkg_metadata = json.loads(fp.read())
return pkg_metadata
else:
headers = {"Accept": "application/json; charset=UTF-8"}
Expand Down
Loading