From 44bef32af5b6c503be159ac1aafe6f0f81e3c381 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Tue, 11 Jun 2024 12:09:19 +0200 Subject: [PATCH 1/5] datetime.utcnow -> datetime.now(UTC) Fixes deprecation warnings in Python 3.12 --- eve/methods/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eve/methods/common.py b/eve/methods/common.py index ed3d79759..b81ae7306 100644 --- a/eve/methods/common.py +++ b/eve/methods/common.py @@ -14,7 +14,7 @@ import time from collections import Counter from copy import copy -from datetime import datetime, timezone +from datetime import datetime, UTC from functools import wraps import simplejson as json @@ -1531,4 +1531,4 @@ def oplog_push(resource, document, op, id=None): def utcnow(): - return datetime.utcnow().replace(microsecond=0, tzinfo=timezone.utc) + return datetime.now(UTC).replace(microsecond=0) From 3c87100364513baea896f2daa17aea9b55124cfb Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 26 Jul 2024 13:55:45 +0000 Subject: [PATCH 2/5] drop eol python; make sure we use timezone.utc --- eve/methods/common.py | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eve/methods/common.py b/eve/methods/common.py index b81ae7306..f8d46b688 100644 --- a/eve/methods/common.py +++ b/eve/methods/common.py @@ -14,7 +14,7 @@ import time from collections import Counter from copy import copy -from datetime import datetime, UTC +from datetime import datetime, timezone from functools import wraps import simplejson as json @@ -1531,4 +1531,4 @@ def oplog_push(resource, document, op, id=None): def utcnow(): - return datetime.now(UTC).replace(microsecond=0) + return datetime.now(timezone.utc).replace(microsecond=0) diff --git a/tox.ini b/tox.ini index 50d9e902a..c34787e03 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py3{11,10,9,8,7},pypy3{8,7},linting +envlist=py3{12,11,10,9},pypy3{10,9},linting [testenv] extras=tests From d2f4b8cd0faef203b28399c8a63871c67b6543e3 Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Thu, 29 Aug 2024 17:51:42 +0200 Subject: [PATCH 3/5] Bret Curtis --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 359eba26a..2ea09fb77 100644 --- a/AUTHORS +++ b/AUTHORS @@ -28,6 +28,7 @@ Patches and Contributions - Ben Demaree - Bjorn Andersson - Brad P. Crochet +- Bret Curtis - Brian Mego - Bryan Cattle - Carl George From d9366442d685ad0c97b8a06cbcf573de2633ea39 Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Thu, 29 Aug 2024 17:24:43 +0200 Subject: [PATCH 4/5] update CI python matrix; drop obsolete pythons --- .github/workflows/ci.yml | 5 ++--- CHANGES.rst | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c033e8e..fe3fd1a45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,11 @@ jobs: strategy: matrix: include: + - { name: '3.12', python: '3.12', os: ubuntu-20.04, tox: py312, mongodb: '4.4', redis: '6' } - { name: '3.11', python: '3.11', os: ubuntu-20.04, tox: py311, mongodb: '4.4', redis: '6' } - { name: '3.10', python: '3.10', os: ubuntu-20.04, tox: py310, mongodb: '4.4', redis: '6' } - { name: '3.9', python: '3.9', os: ubuntu-20.04, tox: py39, mongodb: '4.4', redis: '6' } - - { name: '3.8', python: '3.8', os: ubuntu-20.04, tox: py38, mongodb: '4.4', redis: '6' } - - { name: '3.7', python: '3.7', os: ubuntu-20.04, tox: py37, mongodb: '4.4', redis-version: '6' } - - { name: 'PyPy', python: 'pypy-3.7', os: ubuntu-20.04, tox: pypy37, mongodb: '4.4', redis: '6' } + - { name: 'PyPy', python: 'pypy-3.10', os: ubuntu-20.04, tox: pypy310, mongodb: '4.4', redis: '6' } steps: - uses: actions/checkout@v2 diff --git a/CHANGES.rst b/CHANGES.rst index e5e234e72..3c7f03995 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,10 +6,15 @@ Here you can see the full list of changes between each Eve release. In Development --------------- +- Fix: deprecation warnings in Python 3.12 (`#1526`_) - Fix: the distribution package should not include the test suite (`#1506`_) +- Python 3.12 added to the CI matrix. - Python 3.11 added to the CI matrix. +- Python 3.9 support dropped. +- Python 3.8 support dropped. - .readthedocs.yml upgraded to V2. +.. _`#1526`: https://github.com/pyeve/eve/issues/1526 .. _`#1506`: https://github.com/pyeve/eve/issues/1506 From e6e10ec4625aef909e206e0b7da98610c5bf90cf Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Thu, 29 Aug 2024 17:32:18 +0200 Subject: [PATCH 5/5] update CI actions --- .github/workflows/ci.yml | 4 ++-- CHANGES.rst | 8 ++++---- CONTRIBUTING.rst | 8 ++++---- docs/index.rst | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3fd1a45..01acd32d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,8 @@ jobs: - { name: 'PyPy', python: 'pypy-3.10', os: ubuntu-20.04, tox: pypy310, mongodb: '4.4', redis: '6' } steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - uses: supercharge/mongodb-github-action@1.3.0 diff --git a/CHANGES.rst b/CHANGES.rst index 3c7f03995..6728f5771 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,10 +8,10 @@ In Development - Fix: deprecation warnings in Python 3.12 (`#1526`_) - Fix: the distribution package should not include the test suite (`#1506`_) -- Python 3.12 added to the CI matrix. -- Python 3.11 added to the CI matrix. -- Python 3.9 support dropped. -- Python 3.8 support dropped. +- Python 3.12 support. +- Python 3.11 support. +- Python 3.9 dropped. +- Python 3.8 dropped. - .readthedocs.yml upgraded to V2. .. _`#1526`: https://github.com/pyeve/eve/issues/1526 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7449f3d66..66c162511 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -111,12 +111,12 @@ Start coding Running the tests ~~~~~~~~~~~~~~~~~ -You should have Python 3.7+ available in your system. Now +You should have Python 3.9+ available in your system. Now running tests is as simple as issuing this command:: - $ tox -e linting,py37,py38 + $ tox -e linting,py310,py39 -This command will run tests via the "tox" tool against Python 3.7 and 3.8 and +This command will run tests via the "tox" tool against Python 3.10 and 3.9 and also perform "lint" coding-style checks. You can pass different options to ``tox``. For example, to run tests on Python @@ -131,7 +131,7 @@ Or to only run tests in a particular test module on Python 3.6:: CI will run the full suite when you submit your pull request. The full test suite takes a long time to run because it tests multiple combinations of -Python and dependencies. You need to have Python 3.7, 3.8, 3.9, 3.10 and PyPy +Python and dependencies. You need to have Python 3.9, 3.10, 3.11, 3.12 and PyPy installed to run all of the environments. Then run:: tox diff --git a/docs/index.rst b/docs/index.rst index cc749fbda..b92053e50 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,7 +33,7 @@ Eve is powered by Flask_ and Cerberus_ and it offers native support for MongoDB_ data stores. Support for SQL, Elasticsearch and Neo4js backends is provided by community extensions_. -The codebase is thoroughly tested under Python 3.7+, and PyPy. +The codebase is thoroughly tested under Python 3.9+, and PyPy. Eve is Simple -------------