Skip to content

Commit a1514eb

Browse files
authored
Merge pull request #239 from hugovk/rm-3.6
2 parents 464de59 + 48506d4 commit a1514eb

File tree

13 files changed

+58
-59
lines changed

13 files changed

+58
-59
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
name: Docs
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88

99
steps:
1010
- uses: actions/checkout@v2
1111

12-
- name: Cache
13-
uses: actions/cache@v2
14-
with:
15-
path: ~/.cache/pip
16-
key: docs-${{ hashFiles('**/tox.ini') }}
17-
restore-keys: |
18-
docs-
19-
2012
- name: Set up Python
2113
uses: actions/setup-python@v2
2214
with:
23-
python-version: 3.8
15+
python-version: "3.x"
16+
pip: cache
17+
pip-dependency-path: tox.ini
2418

2519
- name: Install dependencies
2620
run: |

.github/workflows/labels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ on:
55
- master
66
paths:
77
- .github/labels.yml
8+
workflow_dispatch:
9+
810
jobs:
9-
build:
11+
sync:
1012
runs-on: ubuntu-latest
1113
steps:
1214
- uses: actions/checkout@v2

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
lint:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88

99
steps:
1010
- uses: actions/checkout@v2
1111
- uses: actions/setup-python@v2
12-
- uses: pre-commit/action@v2.0.2
12+
- uses: pre-commit/action@v2.0.3

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ on:
55
# branches to consider in the event; optional, defaults to all
66
branches:
77
- master
8+
workflow_dispatch:
89

910
jobs:
1011
update_release_draft:
11-
if: github.repository == 'jmoiron/humanize'
12+
if: github.repository_owner == 'jmoiron'
1213
runs-on: ubuntu-latest
1314
steps:
1415
# Drafts your next release notes as pull requests are merged into "master"

.github/workflows/test.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: Test
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 1
77

88
jobs:
9-
build:
9+
test:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["pypy-3.8", "3.6", "3.7", "3.8", "3.9", "3.10"]
14+
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10"]
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
include:
1717
# Include new variables for Codecov
@@ -26,21 +26,8 @@ jobs:
2626
uses: actions/setup-python@v2
2727
with:
2828
python-version: ${{ matrix.python-version }}
29-
30-
- name: Get pip cache dir
31-
id: pip-cache
32-
run: |
33-
echo "::set-output name=dir::$(pip cache dir)"
34-
35-
- name: Cache
36-
uses: actions/cache@v2
37-
with:
38-
path: ${{ steps.pip-cache.outputs.dir }}
39-
key:
40-
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{
41-
hashFiles('**/setup.py') }}
42-
restore-keys: |
43-
${{ matrix.os }}-${{ matrix.python-version }}-v1-
29+
cache: pip
30+
cache-dependency-path: setup.cfg
4431

4532
- name: Install Linux dependencies
4633
if: startsWith(matrix.os, 'ubuntu')
@@ -67,7 +54,7 @@ jobs:
6754
tox -e py
6855
6956
- name: Upload coverage
70-
uses: codecov/codecov-action@v1
57+
uses: codecov/codecov-action@v2
7158
with:
7259
flags: ${{ matrix.codecov-flag }}
7360
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.29.0
3+
rev: v2.31.0
44
hooks:
55
- id: pyupgrade
6-
args: ["--py36-plus"]
6+
args: [--py37-plus]
77

88
- repo: https://github.com/psf/black
9-
rev: 21.9b0
9+
rev: 22.1.0
1010
hooks:
1111
- id: black
12-
args: ["--target-version", "py36"]
12+
args: [--target-version=py37]
1313

1414
- repo: https://github.com/PyCQA/isort
15-
rev: 5.9.3
15+
rev: 5.10.1
1616
hooks:
1717
- id: isort
1818

19-
- repo: https://gitlab.com/pycqa/flake8
20-
rev: 3.9.2
19+
- repo: https://github.com/myint/autoflake
20+
rev: v1.4
21+
hooks:
22+
- id: autoflake
23+
name: autoflake
24+
args:
25+
[
26+
"--in-place",
27+
"--remove-unused-variables",
28+
"--remove-all-unused-imports",
29+
]
30+
language: python
31+
files: \.py$
32+
33+
- repo: https://github.com/PyCQA/flake8
34+
rev: 4.0.1
2135
hooks:
2236
- id: flake8
2337
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
@@ -28,7 +42,7 @@ repos:
2842
- id: python-check-blanket-noqa
2943

3044
- repo: https://github.com/pre-commit/pre-commit-hooks
31-
rev: v4.0.1
45+
rev: v4.1.0
3246
hooks:
3347
- id: check-merge-conflict
3448
- id: check-toml
@@ -43,11 +57,14 @@ repos:
4357
files: "src/"
4458

4559
- repo: https://github.com/tox-dev/tox-ini-fmt
46-
rev: 0.5.1
60+
rev: 0.5.2
4761
hooks:
4862
- id: tox-ini-fmt
4963

5064
- repo: https://github.com/asottile/setup-cfg-fmt
51-
rev: v1.18.0
65+
rev: v1.20.0
5266
hooks:
53-
- id: setup-cfg-fmt
67+
- id: setup-cfg-fmt
68+
69+
ci:
70+
autoupdate_schedule: quarterly

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.black]
6-
target_version = ["py36"]
6+
target_version = ["py37"]
77

88
[tool.setuptools_scm]
99
local_scheme = "no-local-version"

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ classifiers =
1717
Programming Language :: Python
1818
Programming Language :: Python :: 3
1919
Programming Language :: Python :: 3 :: Only
20-
Programming Language :: Python :: 3.6
2120
Programming Language :: Python :: 3.7
2221
Programming Language :: Python :: 3.8
2322
Programming Language :: Python :: 3.9
@@ -38,7 +37,7 @@ project_urls =
3837
packages = find:
3938
install_requires =
4039
importlib-metadata;python_version < '3.8'
41-
python_requires = >=3.6
40+
python_requires = >=3.7
4241
include_package_data = True
4342
package_dir = =src
4443
zip_safe = False

src/humanize/number.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ def intcomma(value, ndigits=None):
129129
else:
130130
orig = str(value)
131131

132-
new = re.sub(r"^(-?\d+)(\d{3})", fr"\g<1>{sep}\g<2>", orig)
132+
new = re.sub(r"^(-?\d+)(\d{3})", rf"\g<1>{sep}\g<2>", orig)
133133
if orig == new:
134134
return new
135135
else:
136136
return intcomma(new)
137137

138138

139-
powers = [10 ** x for x in (3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 100)]
139+
powers = [10**x for x in (3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 100)]
140140
human_powers = (
141141
NS_("thousand", "thousand"),
142142
NS_("million", "million"),
@@ -197,7 +197,7 @@ def intword(value, format="%.1f"):
197197
for ordinal, power in enumerate(powers[1:], 1):
198198
if value < power:
199199
chopped = value / float(powers[ordinal - 1])
200-
if float(format % chopped) == float(10 ** 3):
200+
if float(format % chopped) == float(10**3):
201201
chopped = value / float(powers[ordinal])
202202
singular, plural = human_powers[ordinal]
203203
return (

src/humanize/time.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import datetime as dt
99
import math
10-
import warnings
1110
from enum import Enum
1211
from functools import total_ordering
1312

0 commit comments

Comments
 (0)