Skip to content

Commit 979e884

Browse files
authored
Merge pull request #1142 from offbyone/build-with-hatch
Modernize the build: switch to hatchling
2 parents 134b68c + 46286be commit 979e884

File tree

10 files changed

+89
-78
lines changed

10 files changed

+89
-78
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
87
runs-on: ubuntu-latest
98
strategy:
109
matrix:
1110
python:
1211
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
13-
- { VERSION: "3.8", TOXENV: "py38",ALLOW_FAILURE: false }
14-
- { VERSION: "3.9", TOXENV: "py39",ALLOW_FAILURE: false }
15-
- { VERSION: "3.10", TOXENV: "py310",ALLOW_FAILURE: false }
16-
- { VERSION: "3.11", TOXENV: "py311",ALLOW_FAILURE: false }
17-
- { VERSION: "3.10", TOXENV: "flake8,doclint,docs,commitlint", ALLOW_FAILURE: false }
18-
- { VERSION: "3.10", TOXENV: "docstrings", ALLOW_FAILURE: true}
12+
- { VERSION: "3.8", TOXENV: "py38", ALLOW_FAILURE: false }
13+
- { VERSION: "3.9", TOXENV: "py39", ALLOW_FAILURE: false }
14+
- { VERSION: "3.10", TOXENV: "py310", ALLOW_FAILURE: false }
15+
- { VERSION: "3.11", TOXENV: "py311", ALLOW_FAILURE: false }
16+
- {
17+
VERSION: "3.11",
18+
TOXENV: "flake8,doclint,docs,commitlint",
19+
ALLOW_FAILURE: false,
20+
}
21+
- { VERSION: "3.11", TOXENV: "docstrings", ALLOW_FAILURE: true }
1922
- { VERSION: "pypy3.9", TOXENV: "pypy", ALLOW_FAILURE: false }
2023

2124
steps:
@@ -29,12 +32,12 @@ jobs:
2932

3033
- name: Upgrade pip
3134
run: |
32-
pip install --constraint=.github/workflows/constraints.txt pip
35+
pip install pip
3336
pip --version
3437
3538
- name: Install Tox
3639
run: |
37-
pip install --constraint=.github/workflows/constraints.txt tox
40+
pip install tox
3841
tox --version
3942
4043
- name: Run Tox

.github/workflows/constraints.txt

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

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,5 @@ Contributors
220220
- Peter Küffner (@kuepe-sl)
221221

222222
- Andrew MacCormack (@amaccormack-lumira)
223+
224+
- Chris R (@offbyone)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ga:
1717
tests: ga
1818

1919
test-deps:
20-
pip install -r dev-requirements.txt
20+
pip install -e .[dev]
2121

2222
htmlcov: .coverage
2323
coverage html --omit=github3/packages/*

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Please read the `CONTRIBUTING`_ document.
3737
Testing
3838
~~~~~~~
3939

40-
You can run either ``pip install -r dev-requirements.txt`` to install the
41-
following before testing or simply ``make test-deps``. It is suggested you do
42-
this in a virtual environment. These need to be installed for the tests to run.
40+
You can run ``pip install -e .[dev]`` to install the following before testing or
41+
simply ``make test-deps``. It is suggested you do this in a virtual environment.
42+
These need to be installed for the tests to run.
4343

4444
- betamax_
4545
- coverage_ by Ned Batchelder

dev-requirements.txt

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

pyproject.toml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,69 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "github3.py"
7+
description = "Python wrapper for the GitHub API(http://developer.github.com/v3)"
8+
readme = "README.rst"
9+
requires-python = ">= 3.7"
10+
url = "https://github3.readthedocs.io"
11+
authors = [
12+
{ name = "Ian Stapleton Cordasco", email="graffatcolmingov@gmail.com" },
13+
]
14+
license = "BSD-3-Clause"
15+
license_file = "LICENSE"
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved",
20+
"License :: OSI Approved :: BSD License",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: Implementation :: CPython",
25+
]
26+
27+
dynamic = ["version"]
28+
29+
dependencies = [
30+
"PyJWT[crypto]>=2.3.0",
31+
"python-dateutil>=2.6.0",
32+
"requests>=2.18",
33+
"uritemplate>=3.0.0",
34+
]
35+
36+
[project.optional-dependencies]
37+
test = [
38+
"pytest>=7.0",
39+
"pytest-xdist[psutil]",
40+
"betamax>=0.5.1",
41+
"betamax_matchers>=0.3.0",
42+
]
43+
44+
dev = [
45+
"github3.py[test]",
46+
"wheel",
47+
"build",
48+
"twine",
49+
"tox>=3.1.3",
50+
]
51+
52+
[tool.hatch.version]
53+
path = "src/github3/__about__.py"
54+
55+
[tool.hatch.build.targets.wheel]
56+
packages = [
57+
"src/github3",
58+
]
59+
60+
61+
[project.urls]
62+
Documentation = "https://github3.readthedocs.io"
63+
Changelog = "https://github3.readthedocs.io/en/latest/release-notes/index.html"
64+
Source = "https://github.com/sigmavirus24/github3.py"
65+
"Released Versions" = "https://github.com/sigmavirus24/github3.py/tags"
66+
167
[tool.black]
268
line-length = 78
369
target-version = ['py37']

setup.cfg

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

setup.py

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

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ passenv = GH_*
77
pip_pre = False
88
deps =
99
requests{env:REQUESTS_VERSION:>=2.0}
10-
pytest
11-
pytest-xdist[psutil]
12-
betamax>=0.5.1
13-
betamax_matchers>=0.3.0
1410
pypy3: unittest2
11+
extras = test
1512
commands = pytest {posargs}
1613

1714
[testenv:flake8]
@@ -97,10 +94,12 @@ deps =
9794
-rdocs/source/requirements.txt
9895
sphinx_rtd_theme
9996
twine >= 3.4.2
97+
build
10098
.
10199
commands =
102100
sphinx-build -E -W -c docs/source/ -b html docs/source/ docs/build/html
103-
twine check --strict {distdir}/*
101+
python -m build
102+
twine check --strict dist/*
104103

105104
[pytest]
106105
addopts = -q -nauto
@@ -112,3 +111,4 @@ ignore-path-errors = docs/source/release-notes/1.0.0.rst;D001
112111
[flake8]
113112
extend-ignore = E203,W503
114113
max-line-length = 80
114+
exclude = src/github3/_version.py

0 commit comments

Comments
 (0)