Skip to content

Commit ba6e627

Browse files
authored
Merge branch 'main' into main
2 parents 301a56b + 7e20f6e commit ba6e627

File tree

7 files changed

+50
-37
lines changed

7 files changed

+50
-37
lines changed

.github/release-drafter.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ categories:
2222
exclude-labels:
2323
- "changelog: skip"
2424

25+
autolabeler:
26+
- label: "changelog: skip"
27+
branch:
28+
- "/pre-commit-ci-update-config/"
29+
2530
template: |
2631
$CHANGES
2732

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- uses: actions/setup-python@v4
1212
with:
13-
python-version: "3.x"
13+
python-version: "3.x"
1414
- uses: pre-commit/action@v3.0.0

.github/workflows/release-drafter.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,27 @@ on:
55
# branches to consider in the event; optional, defaults to all
66
branches:
77
- main
8+
# pull_request event is required only for autolabeler
9+
pull_request:
10+
# Only following types are handled by the action, but one can default to all as well
11+
types: [opened, reopened, synchronize]
12+
# pull_request_target event is required for autolabeler to support PRs from forks
13+
# pull_request_target:
14+
# types: [opened, reopened, synchronize]
815
workflow_dispatch:
916

17+
permissions:
18+
contents: read
19+
1020
jobs:
1121
update_release_draft:
1222
if: github.repository_owner == 'python-humanize'
23+
permissions:
24+
# write permission is required to create a GitHub Release
25+
contents: write
26+
# write permission is required for autolabeler
27+
# otherwise, read permission is required at least
28+
pull-requests: write
1329
runs-on: ubuntu-latest
1430
steps:
1531
# Drafts your next release notes as pull requests are merged into "main"

.pre-commit-config.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ repos:
66
args: [--py37-plus]
77

88
- repo: https://github.com/psf/black
9-
rev: 22.12.0
9+
rev: 23.3.0
1010
hooks:
1111
- id: black
12-
args: [--target-version=py37]
1312

1413
- repo: https://github.com/PyCQA/isort
1514
rev: 5.12.0
1615
hooks:
1716
- id: isort
1817

1918
- repo: https://github.com/PyCQA/autoflake
20-
rev: v2.0.0
19+
rev: v2.0.2
2120
hooks:
2221
- id: autoflake
2322
name: autoflake
@@ -45,11 +44,14 @@ repos:
4544
- repo: https://github.com/pre-commit/pre-commit-hooks
4645
rev: v4.4.0
4746
hooks:
48-
- id: check-json
47+
- id: check-case-conflict
4948
- id: check-merge-conflict
49+
- id: check-json
5050
- id: check-toml
5151
- id: check-yaml
5252
- id: end-of-file-fixer
53+
- id: trailing-whitespace
54+
exclude: \.github/ISSUE_TEMPLATE\.md|\.github/PULL_REQUEST_TEMPLATE\.md
5355

5456
- repo: https://github.com/PyCQA/pydocstyle
5557
rev: 6.3.0
@@ -59,24 +61,24 @@ repos:
5961
files: "src/"
6062

6163
- repo: https://github.com/pre-commit/mirrors-mypy
62-
rev: v0.991
64+
rev: v1.1.1
6365
hooks:
6466
- id: mypy
6567
additional_dependencies: [pytest, types-freezegun, types-setuptools]
6668
args: [--strict]
6769

6870
- repo: https://github.com/tox-dev/pyproject-fmt
69-
rev: 0.5.0
71+
rev: 0.9.2
7072
hooks:
7173
- id: pyproject-fmt
7274

7375
- repo: https://github.com/abravalheri/validate-pyproject
74-
rev: v0.12.1
76+
rev: v0.12.2
7577
hooks:
7678
- id: validate-pyproject
7779

7880
- repo: https://github.com/tox-dev/tox-ini-fmt
79-
rev: 0.6.1
81+
rev: 1.0.0
8082
hooks:
8183
- id: tox-ini-fmt
8284

pyproject.toml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ license = {text = "MIT"}
1616
maintainers = [{name = "Hugo van Kemenade"}]
1717
authors = [{name = "Jason Moiron", email = "jmoiron@jmoiron.net"}]
1818
requires-python = ">=3.7"
19-
dependencies = [
20-
'importlib-metadata; python_version < "3.8"',
21-
]
22-
dynamic = [
23-
"version",
24-
]
2519
classifiers = [
2620
"Development Status :: 5 - Production/Stable",
2721
"Intended Audience :: Developers",
@@ -40,13 +34,18 @@ classifiers = [
4034
"Topic :: Text Processing",
4135
"Topic :: Text Processing :: General",
4236
]
37+
dynamic = [
38+
"version",
39+
]
40+
dependencies = [
41+
'importlib-metadata; python_version < "3.8"',
42+
]
4343
[project.optional-dependencies]
4444
tests = [
4545
"freezegun",
4646
"pytest",
4747
"pytest-cov",
4848
]
49-
5049
[project.urls]
5150
Documentation = "https://python-humanize.readthedocs.io/"
5251
Funding = "https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi"
@@ -55,10 +54,6 @@ Homepage = "https://github.com/python-humanize/humanize"
5554
"Release notes" = "https://github.com/python-humanize/humanize/releases"
5655
Source = "https://github.com/python-humanize/humanize"
5756

58-
59-
[tool.black]
60-
target_version = ["py37"]
61-
6257
[tool.hatch]
6358
version.source = "vcs"
6459

@@ -70,11 +65,14 @@ artifacts = [
7065
[tool.hatch.version.raw-options]
7166
local_scheme = "no-local-version"
7267

68+
[tool.black]
69+
target_version = ["py37"]
70+
7371
[tool.isort]
7472
profile = "black"
7573

76-
[tool.pydocstyle]
77-
convention = "google"
78-
7974
[tool.pytest.ini_options]
8075
addopts = "--color=yes"
76+
77+
[tool.pydocstyle]
78+
convention = "google"

tests/test_time.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ def test_date_and_delta() -> None:
7474
# Tests for the public interface of humanize.time
7575

7676

77-
def nd_nomonths(d: dt.timedelta) -> str:
78-
return humanize.naturaldelta(d, months=False)
79-
80-
8177
@pytest.mark.parametrize(
8278
"test_input, expected",
8379
[
@@ -88,7 +84,7 @@ def nd_nomonths(d: dt.timedelta) -> str:
8884
],
8985
)
9086
def test_naturaldelta_nomonths(test_input: dt.timedelta, expected: str) -> None:
91-
assert nd_nomonths(test_input) == expected
87+
assert humanize.naturaldelta(test_input, months=False) == expected
9288

9389

9490
@pytest.mark.parametrize(
@@ -173,10 +169,6 @@ def test_naturaltime(test_input: dt.datetime, expected: str) -> None:
173169
assert humanize.naturaltime(test_input) == expected
174170

175171

176-
def nt_nomonths(d: dt.datetime) -> str:
177-
return humanize.naturaltime(d, months=False)
178-
179-
180172
@freeze_time("2020-02-02")
181173
@pytest.mark.parametrize(
182174
"test_input, expected",
@@ -215,7 +207,7 @@ def nt_nomonths(d: dt.datetime) -> str:
215207
],
216208
)
217209
def test_naturaltime_nomonths(test_input: dt.datetime, expected: str) -> None:
218-
assert nt_nomonths(test_input) == expected
210+
assert humanize.naturaltime(test_input, months=False) == expected
219211

220212

221213
@freeze_time("2020-02-02")

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ envlist =
55
py{py3, 312, 311, 310, 39, 38, 37}
66

77
[testenv]
8-
passenv =
9-
FORCE_COLOR
108
extras =
119
tests
10+
passenv =
11+
FORCE_COLOR
1212
commands =
1313
{envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs}
1414

@@ -19,11 +19,11 @@ commands =
1919
mkdocs build
2020

2121
[testenv:lint]
22-
passenv =
23-
PRE_COMMIT_COLOR
2422
skip_install = true
2523
deps =
2624
pre-commit
25+
passenv =
26+
PRE_COMMIT_COLOR
2727
commands =
2828
pre-commit run --all-files --show-diff-on-failure
2929

0 commit comments

Comments
 (0)