Skip to content

Commit 5e60d18

Browse files
committed
Convert setup.cfg to pyproject.toml
1 parent 60e3b47 commit 5e60d18

File tree

8 files changed

+240
-89
lines changed

8 files changed

+240
-89
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max_line_length = 88

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
cache: pip
25-
cache-dependency-path: setup.cfg
25+
cache-dependency-path: pyproject.toml
2626

2727
- name: Install Linux dependencies
2828
if: startsWith(matrix.os, 'ubuntu')

.gitignore

+157-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,160 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.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
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
143
.coverage
2-
.DS_Store
3-
.eggs
4-
.testmondata
5-
.tox
6-
*.egg-info*
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
755
*.mo
856
*.pot
9-
*.py[co]
10-
*.sw[po]
11-
build
12-
dist
13-
docs/_build*
14-
htmlcov
15-
site
16-
tags
57+
58+
# Django stuff:
59+
*.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
121+
122+
# Environments
123+
.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
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
#.idea/

.pre-commit-config.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,16 @@ repos:
6565
additional_dependencies: [pytest, types-freezegun, types-setuptools]
6666
args: [--strict]
6767

68-
- repo: https://github.com/asottile/setup-cfg-fmt
69-
rev: v2.2.0
70-
hooks:
71-
- id: setup-cfg-fmt
72-
args: [--max-py-version=3.11, --include-version-classifiers]
73-
7468
- repo: https://github.com/tox-dev/pyproject-fmt
7569
rev: 0.4.1
7670
hooks:
7771
- id: pyproject-fmt
7872

73+
- repo: https://github.com/abravalheri/validate-pyproject
74+
rev: v0.10.1
75+
hooks:
76+
- id: validate-pyproject
77+
7978
- repo: https://github.com/tox-dev/tox-ini-fmt
8079
rev: 0.5.2
8180
hooks:

pyproject.toml

+69-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,79 @@
11
[build-system]
22
build-backend = "setuptools.build_meta"
33
requires = [
4-
"setuptools>=42",
5-
"setuptools_scm[toml]>=3.4",
4+
"setuptools>=61.2",
5+
"setuptools_scm[toml]>=6.2",
66
]
77

8+
[project]
9+
name = "humanize"
10+
description = "Python humanize utilities"
11+
readme = "README.md"
12+
keywords = [
13+
"humanize time size",
14+
]
15+
license = {text = "MIT"}
16+
maintainers = [{name = "Hugo van Kemenade"}]
17+
authors = [{name = "Jason Moiron", email = "[email protected]"}]
18+
requires-python = ">=3.7"
19+
dependencies = [
20+
'importlib-metadata; python_version < "3.8"',
21+
]
22+
dynamic = [
23+
"version",
24+
]
25+
classifiers = [
26+
"Development Status :: 5 - Production/Stable",
27+
"Intended Audience :: Developers",
28+
"License :: OSI Approved :: MIT License",
29+
"Operating System :: OS Independent",
30+
"Programming Language :: Python",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3 :: Only",
33+
"Programming Language :: Python :: 3.7",
34+
"Programming Language :: Python :: 3.8",
35+
"Programming Language :: Python :: 3.9",
36+
"Programming Language :: Python :: 3.10",
37+
"Programming Language :: Python :: 3.11",
38+
"Programming Language :: Python :: Implementation :: CPython",
39+
"Programming Language :: Python :: Implementation :: PyPy",
40+
"Topic :: Text Processing",
41+
"Topic :: Text Processing :: General",
42+
]
43+
[project.optional-dependencies]
44+
tests = [
45+
"freezegun",
46+
"pytest",
47+
"pytest-cov",
48+
]
49+
50+
[project.urls]
51+
Documentation = "https://python-humanize.readthedocs.io/"
52+
Funding = "https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi"
53+
Homepage = "https://github.com/python-humanize/humanize"
54+
"Issue tracker" = "https://github.com/python-humanize/humanize/issues"
55+
"Release notes" = "https://github.com/python-humanize/humanize/releases"
56+
Source = "https://github.com/python-humanize/humanize"
57+
58+
859
[tool.black]
960
target_version = ["py37"]
1061

62+
[tool.hatch]
63+
version.source = "vcs"
64+
65+
[tool.isort]
66+
profile = "black"
67+
68+
[tool.pydocstyle]
69+
convention = "google"
70+
71+
[tool.pytest.ini_options]
72+
addopts = "--color=yes"
73+
74+
[tool.setuptools.packages.find]
75+
where = ["src"]
76+
namespaces = false
77+
1178
[tool.setuptools_scm]
1279
local_scheme = "no-local-version"

setup.cfg

-65
This file was deleted.

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from setuptools import setup
22

3-
setup()
3+
setup(
4+
setup_requires=["setuptools_scm"],
5+
)

tox.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[tox]
22
envlist =
3-
py{py3, 311, 310, 39, 38, 37}
3+
docs
4+
lint
5+
py{py3, 312, 311, 310, 39, 38, 37}
46

57
[testenv]
68
passenv =

0 commit comments

Comments
 (0)