Skip to content

Commit

Permalink
Merge pull request #905 from globus/python-3.12
Browse files Browse the repository at this point in the history
Support Python 3.12
  • Loading branch information
kurtmckee authored Dec 7, 2023
2 parents 10b0d54 + e608404 commit 9023bcc
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 22 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
id: setup-python
with:
python-version: "3.10"
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
.github/workflows/build.yaml
Expand Down Expand Up @@ -60,14 +60,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# we do not want a large number of windows and macos builds, so
# enumerate them explicitly
include:
- os: windows-latest
python-version: "3.10"
python-version: "3.12"
- os: macos-latest
python-version: "3.10"
python-version: "3.12"
name: "test py${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
id: setup-python
with:
python-version: "3.10"
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
.github/workflows/build.yaml
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
id: setup-python
with:
python-version: "3.10"
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
.github/workflows/build.yaml
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
test-sdk-main:
strategy:
matrix:
python-version: ["3.7", "3.11"]
python-version: ["3.7", "3.12"]
runs-on: ubuntu-latest
name: "sdk-main"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: 3.11
python-version: "3.12"
- name: Install CLI
run: |
python -m pip install -e .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
python-version: "3.12"

- run: python -m pip install build

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_test_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.11"
python-version: "3.12"

- run: python -m pip install build

Expand Down
3 changes: 3 additions & 0 deletions changelog.d/20231207_091830_kurtmckee_python_3_12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Other

* Test against Python 3.12 in CI.
3 changes: 3 additions & 0 deletions changelog.d/20231207_094126_kurtmckee_python_3_12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Enhancements

* Support Python 3.12.
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
from setuptools import find_packages, setup

TEST_REQUIREMENTS = [
"coverage<7",
"pytest<7",
"coverage>=7",
"pytest>=7",
"pytest-xdist<3",
"pytest-timeout<2",
"click-type-test==0.0.5;python_version>='3.10'",
"responses==0.23.3",
# loading test fixture data
"ruamel.yaml==0.17.32",
# Python 3.12 needs setuptools.
"setuptools;python_version>='3.12'",
]
DEV_REQUIREMENTS = TEST_REQUIREMENTS + [
"tox>=4",
Expand Down Expand Up @@ -79,5 +81,6 @@ def read_readme():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)
7 changes: 3 additions & 4 deletions src/globus_cli/services/transfer/delegate_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ def create_proxy_cert(
builder = builder.serial_number(serial)

# set the new proxy as valid from now until lifetime_hours have passed
builder = builder.not_valid_before(datetime.datetime.utcnow())
builder = builder.not_valid_after(
datetime.datetime.utcnow() + datetime.timedelta(hours=lifetime_hours)
)
now = datetime.datetime.now(tz=datetime.timezone.utc)
builder = builder.not_valid_before(now)
builder = builder.not_valid_after(now + datetime.timedelta(hours=lifetime_hours))

# set the public key of the new proxy to the given public key
builder = builder.public_key(loaded_public_key)
Expand Down
13 changes: 7 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
clean
py{311,310,39,38,37}
py{312,311,310,39,38,37}
py37-mindeps
cov-combine
cov-report
Expand Down Expand Up @@ -29,13 +29,13 @@ deps =
#
# usage examples:
# GLOBUS_SDK_PATH=../globus-sdk tox -e py311-localsdk
# GLOBUS_SDK_PATH=../globus-sdk tox -e 'py{37,38,39,310,311}-localsdk'
# GLOBUS_SDK_PATH=../globus-sdk tox -e 'py{37,38,39,310,311,312}-localsdk'
commands =
localsdk: python -c 'import os, subprocess, sys; subprocess.run([sys.executable, "-m", "pip", "install", "-e", os.environ["GLOBUS_SDK_PATH"]])'
coverage run -m pytest {posargs}
depends =
py{37,38,39,310,311}{,-mindeps}: clean
cov-combine: py{37,38,39,310,311}{,-mindeps}
py{37,38,39,310,311,312}{,-mindeps}: clean
cov-combine: py{37,38,39,310,311,312}{,-mindeps}
cov-report: cov-combine

[testenv:clean]
Expand Down Expand Up @@ -65,8 +65,9 @@ commands = pre-commit run --all-files

[testenv:mypy]
base_python =
python3.11
python3.10
python3.12
python3.11
python3.10
deps =
mypy==1.7.1
types-jwt
Expand Down

0 comments on commit 9023bcc

Please sign in to comment.