Skip to content

Commit

Permalink
Drop Python 3.7 support. (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac authored Jun 7, 2024
1 parent 775d57a commit 5a02541
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 26 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ jobs:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-20.04"]
- ["ubuntu", "ubuntu-latest"]
- ["windows", "windows-latest"]
config:
# [Python version, tox env]
- ["3.9", "release-check"]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.11", "release-check"]
- ["3.11", "lint"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.13.0-alpha - 3.13.0", "py313"]
- ["pypy-3.9", "pypy3"]
- ["3.9", "coverage"]
- ["3.13", "py313"]
- ["pypy-3.10", "pypy3"]
- ["3.11", "coverage"]
exclude:
- { os: ["windows", "windows-latest"], config: ["3.9", "release-check"] }
- { os: ["windows", "windows-latest"], config: ["3.9", "lint"] }
- { os: ["windows", "windows-latest"], config: ["3.9", "coverage"] }
- { os: ["windows", "windows-latest"], config: ["3.11", "release-check"] }
- { os: ["windows", "windows-latest"], config: ["3.11", "lint"] }
- { os: ["windows", "windows-latest"], config: ["3.11", "coverage"] }

runs-on: ${{ matrix.os[1] }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: ${{ matrix.os[0] }}-${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config[0] }}
allow-prereleases: true
- name: Pip cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
Expand All @@ -59,7 +59,11 @@ jobs:
python -m pip install --upgrade pip
pip install tox
- name: Test
if: ${{ !startsWith(runner.os, 'Mac') }}
run: tox -e ${{ matrix.config[1] }}
- name: Test (macOS)
if: ${{ startsWith(runner.os, 'Mac') }}
run: tox -e ${{ matrix.config[1] }}-universal2
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
Expand Down
3 changes: 2 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[meta]
template = "zope-product"
commit-id = "8a08ecb4"
commit-id = "b1221c3c"

[python]
with-pypy = true
with-sphinx-doctests = false
with-windows = true
with-future-python = true
with-macos = false
with-docs = false

[coverage]
fail-under = 88
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Changelog
=========

5.6 (unreleased)
6.0 (unreleased)
----------------

- Drop support for Python 3.7.

- Remove Python2 compatiblity code.


Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[bdist_wheel]
universal = 0

[flake8]
doctests = 1
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
with open(os.path.join(here, 'CHANGES.rst')) as f:
CHANGES = f.read()

version = '5.6.dev0'
version = '6.0.dev0'

setup(
name='DateTime',
Expand Down Expand Up @@ -55,7 +55,6 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -64,7 +63,7 @@
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
python_requires='>=3.7',
python_requires='>=3.8',
install_requires=[
'zope.interface',
'pytz',
Expand Down
8 changes: 4 additions & 4 deletions src/DateTime/DateTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def __init__(self, *args, **kw):
except (DateError, TimeError, DateTimeError):
raise
except Exception:
raise SyntaxError('Unable to parse {}, {}'.format(args, kw))
raise SyntaxError(f'Unable to parse {args}, {kw}')

def __getstate__(self):
return (self._micros,
Expand Down Expand Up @@ -812,7 +812,7 @@ def _parse_args(self, *args, **kw):
hr, mn, sc, tz = 0, 0, 0, 0
yr = _correctYear(yr)
if not self._validDate(yr, mo, dy):
raise DateError('Invalid date: {}'.format(args))
raise DateError(f'Invalid date: {args}')
args = args[3:]
if args:
hr, args = args[0], args[1:]
Expand Down Expand Up @@ -956,7 +956,7 @@ def _parse(self, st, datefmt=getDefaultDateFormat()):
i = i + ls
if (ls == 4 and d and d in '+-' and
(len(ints) + (not not month) >= 3)):
tz = '{}{}'.format(d, s)
tz = f'{d}{s}'
else:
v = int(s)
ints.append(v)
Expand Down Expand Up @@ -1764,7 +1764,7 @@ def __repr__(self):
"""Convert a DateTime to a string that looks like a Python
expression.
"""
return '{}(\'{}\')'.format(self.__class__.__name__, str(self))
return f'{self.__class__.__name__}(\'{str(self)}\')'

def __str__(self):
"""Convert a DateTime to a string."""
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ minversion = 3.18
envlist =
release-check
lint
py37
py38
py39
py310
Expand All @@ -18,6 +17,7 @@ envlist =
[testenv]
skip_install = true
deps =
setuptools < 69
zc.buildout >= 3.0.1
wheel > 0.37
setenv =
Expand All @@ -41,7 +41,7 @@ deps =
commands_pre =
commands =
check-manifest
check-python-versions
check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml
python -m build --sdist --no-isolation
twine check dist/*

Expand Down Expand Up @@ -91,6 +91,7 @@ source = DateTime

[coverage:report]
precision = 2
ignore_errors = True
exclude_lines =
pragma: no cover
pragma: nocover
Expand Down

0 comments on commit 5a02541

Please sign in to comment.