Skip to content

Commit 6ed367f

Browse files
authored
Drop support for EOL Python 3.10 (#440)
2 parents 1a04966 + 8bf85bb commit 6ed367f

10 files changed

Lines changed: 53 additions & 177 deletions

File tree

‎.github/release-drafter.yml‎

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,37 @@ name-template: "$RESOLVED_VERSION"
22
tag-template: "$RESOLVED_VERSION"
33

44
categories:
5+
- type: "pre-exclude"
6+
when:
7+
label: "changelog: skip"
58
- title: "Added"
6-
labels:
7-
- "changelog: Added"
8-
- "enhancement"
9+
semver-increment: "minor"
10+
when:
11+
labels:
12+
- "changelog: Added"
13+
- "enhancement"
914
- title: "Changed"
10-
label: "changelog: Changed"
15+
semver-increment: "minor"
16+
when:
17+
label: "changelog: Changed"
1118
- title: "Deprecated"
12-
label: "changelog: Deprecated"
19+
semver-increment: "minor"
20+
when:
21+
label: "changelog: Deprecated"
1322
- title: "Removed"
14-
label: "changelog: Removed"
23+
semver-increment: "major"
24+
when:
25+
label: "changelog: Removed"
1526
- title: "Fixed"
16-
labels:
17-
- "changelog: Fixed"
18-
- "bug"
27+
semver-increment: "patch"
28+
when:
29+
labels:
30+
- "changelog: Fixed"
31+
- "bug"
1932
- title: "Security"
20-
label: "changelog: Security"
21-
22-
exclude-labels:
23-
- "changelog: skip"
33+
semver-increment: "minor"
34+
when:
35+
label: "changelog: Security"
2436

2537
autolabeler:
2638
- label: "changelog: skip"
@@ -29,20 +41,3 @@ autolabeler:
2941

3042
template: |
3143
$CHANGES
32-
33-
version-resolver:
34-
major:
35-
labels:
36-
- "changelog: Removed"
37-
minor:
38-
labels:
39-
- "changelog: Added"
40-
- "changelog: Changed"
41-
- "changelog: Deprecated"
42-
- "enhancement"
43-
44-
patch:
45-
labels:
46-
- "changelog: Fixed"
47-
- "bug"
48-
default: minor

‎.github/workflows/test.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
python-version:
18+
- "pypy3.12"
1819
- "pypy3.11"
1920
- "3.15t"
2021
- "3.15"
@@ -23,7 +24,6 @@ jobs:
2324
- "3.13"
2425
- "3.12"
2526
- "3.11"
26-
- "3.10"
2727
os: [windows-latest, macos-latest, ubuntu-latest]
2828

2929
steps:
@@ -70,9 +70,12 @@ jobs:
7070
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
7171

7272
success:
73+
if: always()
7374
needs: test
7475
runs-on: ubuntu-latest
7576
name: Test successful
7677
steps:
7778
- name: Success
78-
run: echo Test successful
79+
env:
80+
TEST_RESULT: ${{ needs.test.result }}
81+
run: test "$TEST_RESULT" = "success"

‎.gitignore‎

Lines changed: 3 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,36 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
84

95
# Distribution / packaging
10-
.Python
116
build/
12-
develop-eggs/
137
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
248
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
389

3910
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
4311
.coverage
4412
.coverage.*
45-
.cache
46-
nosetests.xml
4713
coverage.xml
48-
*.cover
49-
*.py,cover
5014
.hypothesis/
51-
.pytest_cache/
52-
cover/
5315

5416
# Translations
5517
*.mo
56-
*.pot
5718

58-
# Django stuff:
19+
# Logs
5920
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
103-
104-
# pdm
105-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106-
#pdm.lock
107-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108-
# in version control.
109-
# https://pdm.fming.dev/#use-with-ide
110-
.pdm.toml
111-
112-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113-
__pypackages__/
114-
115-
# Celery stuff
116-
celerybeat-schedule
117-
celerybeat.pid
118-
119-
# SageMath parsed files
120-
*.sage.py
12121

12222
# Environments
12323
.env
124-
.venv
125-
env/
126-
venv/
127-
ENV/
128-
env.bak/
129-
venv.bak/
130-
131-
# Spyder project settings
132-
.spyderproject
133-
.spyproject
134-
135-
# Rope project settings
136-
.ropeproject
13724

13825
# mkdocs documentation
13926
/site
27+
node_modules/
14028

14129
# mypy
142-
.mypy_cache/
14330
.dmypy.json
14431
dmypy.json
14532

146-
# Pyre type checker
147-
.pyre/
148-
149-
# pytype static type analyzer
150-
.pytype/
151-
152-
# Cython debug symbols
153-
cython_debug/
154-
155-
# Jetbrains IDEs
33+
# PyCharm
15634
.idea/
15735

15836
# hatch-vcs

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ priorities:
77

88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.16.5
10+
rev: v0.16.10
1111
hooks:
1212
- id: ruff-check
1313
args: [--exit-non-zero-on-fix]
@@ -47,7 +47,7 @@ repos:
4747
priority: fix-whitespace
4848

4949
- repo: https://github.com/python-jsonschema/check-jsonschema
50-
rev: 0.38.0
50+
rev: "0.38.2"
5151
hooks:
5252
- id: check-github-workflows
5353
priority: check
@@ -61,13 +61,13 @@ repos:
6161
priority: check
6262

6363
- repo: https://github.com/zizmorcore/zizmor-pre-commit
64-
rev: v1.29.0
64+
rev: v1.30.1
6565
hooks:
6666
- id: zizmor
6767
priority: check
6868

6969
- repo: https://github.com/tox-dev/pyproject-fmt
70-
rev: v2.28.2
70+
rev: v2.30.0
7171
hooks:
7272
- id: pyproject-fmt
7373
priority: fix
@@ -91,7 +91,7 @@ repos:
9191
priority: fix
9292

9393
- repo: https://github.com/rbubley/mirrors-prettier
94-
rev: v3.9.6
94+
rev: v3.9.9
9595
hooks:
9696
- id: prettier
9797
args: [--prose-wrap=always, --print-width=88]

‎pyproject.toml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ license = "MIT"
1616
license-files = [ "LICENCE" ]
1717
maintainers = [ { name = "Hugo van Kemenade" } ]
1818
authors = [ { name = "Jason Moiron", email = "jmoiron@jmoiron.net" } ]
19-
requires-python = ">=3.10"
19+
requires-python = ">=3.11"
2020
classifiers = [
2121
"Development Status :: 5 - Production/Stable",
2222
"Intended Audience :: Developers",
2323
"Operating System :: OS Independent",
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3 :: Only",
26-
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
2827
"Programming Language :: Python :: 3.12",
2928
"Programming Language :: Python :: 3.13",
@@ -57,7 +56,7 @@ build.hooks.vcs.version-file = "src/humanize/_version.py"
5756

5857
[tool.ruff]
5958
fix = true
60-
lint.select = [
59+
lint.extend-select = [
6160
"C4", # flake8-comprehensions
6261
"D", # pydocstyle
6362
"E", # pycodestyle errors
@@ -89,11 +88,13 @@ lint.ignore = [
8988
]
9089
lint.per-file-ignores."tests/*" = [
9190
"D",
91+
"DTZ", # naive local datetimes are intentional
9292
]
9393
lint.flake8-import-conventions.aliases.datetime = "dt"
9494
lint.flake8-import-conventions.banned-from = [ "datetime" ]
9595
lint.flake8-pytest-style.parametrize-names-type = "csv"
96-
lint.flake8-tidy-imports.banned-api."typing.TYPE_CHECKING".msg = "Use TYPE_CHECKING = False instead"
96+
lint.flake8-tidy-imports.banned-api."re.match".msg = "use re.fullmatch() or re.search() instead"
97+
lint.flake8-tidy-imports.banned-api."typing.TYPE_CHECKING".msg = "use TYPE_CHECKING = False instead"
9798
lint.isort.known-first-party = [ "humanize" ]
9899
lint.isort.required-imports = [ "from __future__ import annotations" ]
99100
lint.pydocstyle.convention = "google"
@@ -115,6 +116,8 @@ minversion = "9.0"
115116
testpaths = [ "tests" ]
116117

117118
[tool.coverage]
119+
run.disable_warnings = [ "no-sysmon" ] # 3.11
120+
run.core = "sysmon" # default for 3.14+, available for 3.12+
118121
# Regexes for lines to exclude from consideration
119122
report.exclude_also = [
120123
# Don't complain if non-runnable code isn't run:

‎src/humanize/time.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __lt__(self, other: Any) -> Any:
4949
def _now() -> dt.datetime:
5050
import datetime as dt
5151

52-
return dt.datetime.now()
52+
return dt.datetime.now() # noqa: DTZ005 # naive local time is intentional
5353

5454

5555
def _abs_timedelta(delta: dt.timedelta) -> dt.timedelta:
@@ -321,7 +321,7 @@ def _convert_aware_datetime(
321321
import datetime as dt
322322

323323
if isinstance(value, dt.datetime) and value.tzinfo is not None:
324-
value = dt.datetime.fromtimestamp(value.timestamp())
324+
value = dt.datetime.fromtimestamp(value.timestamp()) # noqa: DTZ006
325325
return value
326326

327327

@@ -341,7 +341,7 @@ def naturalday(value: dt.date | dt.datetime, format: str = "%b %d") -> str:
341341
if isinstance(value, dt.datetime) and value.tzinfo is not None:
342342
today = dt.datetime.now(value.tzinfo).date()
343343
else:
344-
today = dt.date.today()
344+
today = dt.date.today() # noqa: DTZ011
345345
value = dt.date(value.year, value.month, value.day)
346346
except AttributeError:
347347
# Passed value wasn't date-ish
@@ -372,7 +372,7 @@ def naturaldate(value: dt.date | dt.datetime) -> str:
372372
if isinstance(value, dt.datetime) and value.tzinfo is not None:
373373
today = dt.datetime.now(value.tzinfo).date()
374374
else:
375-
today = dt.date.today()
375+
today = dt.date.today() # noqa: DTZ011
376376
value = dt.date(value.year, value.month, value.day)
377377
except AttributeError:
378378
# Passed value wasn't date-ish

‎tests/test_filesize.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
"""Tests for filesize humanizing."""
42

53
from __future__ import annotations

0 commit comments

Comments
 (0)