From af9c88c7873da678f6b93030a81502a407a67879 Mon Sep 17 00:00:00 2001 From: Noah Pendleton <2538614+noahp@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:52:22 -0400 Subject: [PATCH] Python 3.12 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/requirements-pip.txt | 5 +++++ .python-version | 11 ++++++----- puncover/renderers.py | 2 +- requirements-test.txt | 7 +++++-- setup.py | 1 + tox.ini | 2 +- 7 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/requirements-pip.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c367605..bd38352 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: matrix: # note: 3.5 + 3.6 are EOL as of 2022-09-16. tests do fail on python3.5, # see https://github.com/HBehrens/puncover/issues/36 - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # it's convenient to stay on an older ubuntu as long as we need # python3.6: # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json @@ -36,9 +36,9 @@ jobs: - name: Install dependencies run: | - # this is the latest version of pip that supports python 3.6 - # install a specific version to hopefully avoid breakage - pip install --upgrade pip==21.3.1 + # bind pip to a specific version to hopefully avoid breakage + pip install -r .github/workflows/requirements-pip.txt + pip install -r requirements-test.txt - name: Run tox diff --git a/.github/workflows/requirements-pip.txt b/.github/workflows/requirements-pip.txt new file mode 100644 index 0000000..76bc2f9 --- /dev/null +++ b/.github/workflows/requirements-pip.txt @@ -0,0 +1,5 @@ +# install pip 23.3 on python 3.12+ +pip==23.3 ; python_version >= "3.12" + +# this is the latest version of pip that supports python 3.6 +pip==21.3.1 ; python_version < "3.12" diff --git a/.python-version b/.python-version index da9d619..7a6a29c 100644 --- a/.python-version +++ b/.python-version @@ -1,6 +1,7 @@ 3.6.15 -3.7.16 -3.8.16 -3.9.16 -3.10.10 -3.11.2 +3.7.17 +3.8.18 +3.9.18 +3.10.13 +3.11.6 +3.12.0 diff --git a/puncover/renderers.py b/puncover/renderers.py index 3b2f45f..6627982 100644 --- a/puncover/renderers.py +++ b/puncover/renderers.py @@ -250,7 +250,7 @@ def __init__(self, collector): "all_symbols": collector.all_symbols(), "all_functions": collector.all_functions(), "all_variables": collector.all_variables(), - "now": datetime.utcnow(), + "now": datetime.now(), } def render_template(self, template_name, file_name): diff --git a/requirements-test.txt b/requirements-test.txt index fd7d24b..a6a3c39 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,7 +2,10 @@ codecov==2.1.13 mock==4.0.3 pytest==7.0.1 pytest-cov==3.0.0 -tox==3.27.1 -tox-pyenv==1.1.0 +tox==3.27.1 ; python_version < '3.12' +tox==4.11.3 ; python_version >= '3.12' + +# 3.12 needs this for some reason 🤷 +setuptools==68.2.2 ; python_version >= '3.12' -r requirements.txt diff --git a/setup.py b/setup.py index 3320f0b..f1a2b7c 100755 --- a/setup.py +++ b/setup.py @@ -58,6 +58,7 @@ def run(self): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, diff --git a/tox.ini b/tox.ini index ad36e16..ba6e206 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] # Python3.5 unit tests fail -envlist = py{36,37,38,39,3.10,3.11} +envlist = py{36,37,38,39,3.10,3.11,3.12} [testenv] deps = -rrequirements-test.txt