Skip to content

Commit b2f38ec

Browse files
committed
Move to hatchling and add 3.11
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 4f5d72f commit b2f38ec

File tree

11 files changed

+156
-124
lines changed

11 files changed

+156
-124
lines changed

.github/workflows/check.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
test:
14-
name: test ${{ matrix.py }} - ${{ matrix.os }}
14+
name: test ${{ matrix.py }} on ${{ matrix.os }}
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
@@ -23,30 +23,34 @@ jobs:
2323
- "3.8"
2424
- "3.7"
2525
os:
26-
- ubuntu-22.04
26+
- ubuntu-20.04
2727
- windows-2022
2828
- macos-12
29-
3029
steps:
3130
- name: Setup python for tox
3231
uses: actions/setup-python@v4
3332
with:
3433
python-version: "3.10"
35-
- name: Install tox
36-
run: python -m pip install tox
3734
- uses: actions/checkout@v3
3835
with:
3936
fetch-depth: 0
37+
- name: Install tox
38+
run: python -m pip install tox
39+
- name: Setup python2.7 as test dependency
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: 2.7
4043
- name: Setup python for test ${{ matrix.py }}
4144
uses: actions/setup-python@v4
4245
with:
4346
python-version: ${{ matrix.py }}
4447
- name: Pick environment to run
4548
run: |
46-
import os; import sys; from pathlib import Path
47-
env = f"TOXENV=py3{sys.version_info[1]}\n"
48-
print(f"Picked:\n{env}for{sys.version}")
49-
Path(os.environ["GITHUB_ENV"]).write_text(env)
49+
import os; import platform; import sys; from pathlib import Path
50+
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
51+
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
52+
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
53+
file_handler.write(env)
5054
shell: python
5155
- name: Setup test suite
5256
run: tox -vv --notest
@@ -55,18 +59,19 @@ jobs:
5559
env:
5660
PYTEST_ADDOPTS: "-vv --durations=20"
5761
CI_RUN: "yes"
62+
DIFF_AGAINST: HEAD
5863

5964
check:
60-
name: tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
65+
name: tox env ${{ matrix.tox_env }} on ${{ matrix.os }}
6166
runs-on: ${{ matrix.os }}
6267
strategy:
6368
fail-fast: false
6469
matrix:
6570
tox_env:
71+
- type
6672
- dev
6773
- docs
6874
- pkg_meta
69-
- type
7075
os:
7176
- ubuntu-22.04
7277
- windows-2022
@@ -76,16 +81,16 @@ jobs:
7681
- uses: actions/checkout@v3
7782
with:
7883
fetch-depth: 0
79-
- name: Setup Python "3.10"
84+
- name: Setup Python 3.10
8085
uses: actions/setup-python@v4
8186
with:
8287
python-version: "3.10"
8388
- name: Install tox
8489
run: python -m pip install tox
85-
- name: Setup test suite
86-
run: tox -vv --notest -e ${{ matrix.tox_env }}
87-
- name: Run test suite
88-
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
90+
- name: Run check for ${{ matrix.tox_env }}
91+
run: tox -e ${{ matrix.tox_env }}
92+
env:
93+
UPGRADE_ADVISORY: "yes"
8994

9095
publish:
9196
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
@@ -101,9 +106,9 @@ jobs:
101106
- uses: actions/checkout@v3
102107
with:
103108
fetch-depth: 0
104-
- name: Build sdist and wheel
105-
run: python -m build -s -w . -o dist
106-
- name: Publish to PyPi
109+
- name: Build package
110+
run: pyproject-build -s -w . -o dist
111+
- name: Publish to PyPI
107112
uses: pypa/[email protected]
108113
with:
109114
skip_existing: true

.markdownlint.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
MD013:
2+
code_blocks: false
3+
headers: false
4+
line_length: 120
5+
tables: false
6+
7+
MD046:
8+
style: fenced
9+
10+
MD033:
11+
allowed_elements:
12+
- a

.pre-commit-config.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ repos:
2424
hooks:
2525
- id: isort
2626
- repo: https://github.com/psf/black
27-
rev: 22.6.0
27+
rev: 22.8.0
2828
hooks:
2929
- id: black
3030
args: [--safe]
3131
- repo: https://github.com/asottile/blacken-docs
3232
rev: v1.12.1
3333
hooks:
3434
- id: blacken-docs
35-
additional_dependencies: [black==22.6]
35+
additional_dependencies: [black==22.8]
3636
- repo: https://github.com/pre-commit/pygrep-hooks
3737
rev: v1.9.0
3838
hooks:
@@ -42,16 +42,12 @@ repos:
4242
hooks:
4343
- id: tox-ini-fmt
4444
args: ["-p", "fix"]
45-
- repo: https://github.com/asottile/setup-cfg-fmt
46-
rev: v2.0.0
47-
hooks:
48-
- id: setup-cfg-fmt
4945
- repo: https://github.com/PyCQA/flake8
5046
rev: 5.0.4
5147
hooks:
5248
- id: flake8
5349
additional_dependencies:
54-
- flake8-bugbear==22.7.1
50+
- flake8-bugbear==22.8.23
5551
- flake8-comprehensions==3.10
5652
- flake8-pytest-style==1.6
5753
- flake8-spellcheck==0.28
@@ -63,5 +59,14 @@ repos:
6359
hooks:
6460
- id: prettier
6561
additional_dependencies:
66-
62+
6763
- "@prettier/[email protected]"
64+
args: ["--print-width=120", "--prose-wrap=always"]
65+
- repo: https://github.com/igorshubovych/markdownlint-cli
66+
rev: v0.32.2
67+
hooks:
68+
- id: markdownlint
69+
- repo: meta
70+
hooks:
71+
- id: check-hooks-apply
72+
- id: check-useless-excludes

docs/changelog.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
Release History
22
===============
33

4-
v1.0.1 - (2021-12-30)
4+
v1.0.0 - (2022-09-10)
5+
---------------------
6+
- Use hatchling as build backend
7+
- 3.11 support
8+
9+
v0.0.1 - (2021-12-30)
510
---------------------
611
- Drop Python 3.6 support
712

8-
v1.0.0 - (2021-10-21)
13+
v0.1.0 - (2021-10-21)
914
---------------------
1015
- first version

pyproject.toml

Lines changed: 79 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,87 @@
11
[build-system]
2-
requires = ["setuptools>=65.1.1", "setuptools_scm>=7.0.5"]
3-
build-backend = "setuptools.build_meta"
2+
build-backend = "hatchling.build"
3+
requires = ["hatchling>=1.8.1", "hatch-vcs>=0.2"]
4+
5+
[project]
6+
name = "pyproject_api"
7+
description = "API to interact with the python pyproject.toml based projects"
8+
readme.file = "README.md"
9+
readme.content-type = "text/markdown"
10+
keywords = ["virtual", "environments", "isolated", "testing"]
11+
license = "MIT"
12+
urls.Homepage = "http://pyproject_api.readthedocs.org"
13+
urls.Source = "https://github.com/tox-dev/pyproject-api"
14+
urls.Tracker = "https://github.com/tox-dev/pyproject-api/issues"
15+
authors = [{ name = "Bernát Gábor", email = "[email protected]" }]
16+
maintainers = [
17+
{ name = "Bernát Gábor", email = "[email protected]" },
18+
]
19+
requires-python = ">=3.7"
20+
dependencies = [
21+
"packaging>=21.3", 'tomli>=2.0.1;python_version<"3.11"',
22+
]
23+
optional-dependencies.docs = [
24+
"furo>=2022.6.21",
25+
"sphinx>=5.1.1",
26+
"sphinx-autodoc-typehints>=1.19.2",
27+
]
28+
optional-dependencies.testing = [
29+
"covdefaults>=2.2",
30+
"pytest>=7.1.3",
31+
"pytest-cov>=3",
32+
"pytest-mock>=3.8.2",
33+
'importlib-metadata>=4.12; python_version < "3.8"',
34+
]
35+
dynamic = ["version"]
36+
classifiers = [
37+
"Development Status :: 5 - Production/Stable",
38+
"Framework :: tox",
39+
"Intended Audience :: Developers",
40+
"License :: OSI Approved :: MIT License",
41+
"Operating System :: MacOS :: MacOS X",
42+
"Operating System :: Microsoft :: Windows",
43+
"Operating System :: POSIX",
44+
"Programming Language :: Python :: 3",
45+
"Programming Language :: Python :: 3 :: Only",
46+
"Programming Language :: Python :: 3.7",
47+
"Programming Language :: Python :: 3.8",
48+
"Programming Language :: Python :: 3.9",
49+
"Programming Language :: Python :: 3.10",
50+
"Programming Language :: Python :: 3.11",
51+
"Topic :: Software Development :: Libraries",
52+
"Topic :: Software Development :: Testing",
53+
"Topic :: Utilities",
54+
]
55+
56+
[tool.hatch]
57+
build.hooks.vcs.version-file = "src/pyproject_api/_version.py"
58+
version.source = "vcs"
459

560
[tool.black]
661
line-length = 120
762

63+
[tool.coverage]
64+
html.show_contexts = true
65+
html.skip_covered = false
66+
paths.source = [
67+
"src",
68+
".pyproject_api*/*/lib/python*/site-packages",
69+
".pyproject_api*/pypy*/site-packages",
70+
".pyproject_api*\\*\\Lib\\site-packages",
71+
"*/src",
72+
"*\\src",
73+
]
74+
report.fail_under = 88
75+
report.omit = []
76+
run.parallel = true
77+
run.plugins = ["covdefaults"]
78+
879
[tool.isort]
9-
line_length = 120
80+
known_first_party = ["pyproject_api"]
1081
profile = "black"
11-
known_first_party = ["pyproject_api", "tests"]
12-
13-
[tool.setuptools_scm]
14-
write_to = "src/pyproject_api/_version.py"
15-
16-
[tool.coverage.run]
17-
plugins = ["covdefaults"]
18-
19-
[tool.coverage.html]
20-
show_contexts = true
21-
skip_covered = true
82+
line_length = 120
2283

23-
[tool.coverage.paths]
24-
source = [
25-
".",
26-
".tox/*/lib/*/site-packages/",
27-
'.tox\\*\\Lib\\site-packages\\',
28-
]
84+
[tool.mypy]
85+
python_version = "3.10"
86+
show_error_codes = true
87+
strict = true

setup.cfg

Lines changed: 0 additions & 67 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)