Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize the build: switch to hatchling #1142

Merged
merged 8 commits into from
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python:
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
- { VERSION: "3.8", TOXENV: "py38",ALLOW_FAILURE: false }
- { VERSION: "3.9", TOXENV: "py39",ALLOW_FAILURE: false }
- { VERSION: "3.10", TOXENV: "py310",ALLOW_FAILURE: false }
- { VERSION: "3.11", TOXENV: "py311",ALLOW_FAILURE: false }
- { VERSION: "3.10", TOXENV: "flake8,doclint,docs,commitlint", ALLOW_FAILURE: false }
- { VERSION: "3.10", TOXENV: "docstrings", ALLOW_FAILURE: true}
- { VERSION: "3.8", TOXENV: "py38", ALLOW_FAILURE: false }
- { VERSION: "3.9", TOXENV: "py39", ALLOW_FAILURE: false }
- { VERSION: "3.10", TOXENV: "py310", ALLOW_FAILURE: false }
- { VERSION: "3.11", TOXENV: "py311", ALLOW_FAILURE: false }
- {
VERSION: "3.11",
TOXENV: "flake8,doclint,docs,commitlint",
ALLOW_FAILURE: false,
}
- { VERSION: "3.11", TOXENV: "docstrings", ALLOW_FAILURE: true }
- { VERSION: "pypy3.9", TOXENV: "pypy", ALLOW_FAILURE: false }

steps:
Expand All @@ -29,12 +32,12 @@ jobs:

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install pip
staticdev marked this conversation as resolved.
Show resolved Hide resolved
pip --version

- name: Install Tox
run: |
pip install --constraint=.github/workflows/constraints.txt tox
pip install tox
staticdev marked this conversation as resolved.
Show resolved Hide resolved
tox --version

- name: Run Tox
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/constraints.txt

This file was deleted.

2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,5 @@ Contributors
- Peter Küffner (@kuepe-sl)

- Andrew MacCormack (@amaccormack-lumira)

- Chris R (@offbyone)
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ga:
tests: ga

test-deps:
pip install -r dev-requirements.txt
pip install -e .[dev]

htmlcov: .coverage
coverage html --omit=github3/packages/*
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Please read the `CONTRIBUTING`_ document.
Testing
~~~~~~~

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

- betamax_
- coverage_ by Ned Batchelder
Expand Down
7 changes: 0 additions & 7 deletions dev-requirements.txt

This file was deleted.

66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "github3.py"
description = "Python wrapper for the GitHub API(http://developer.github.com/v3)"
readme = "README.rst"
requires-python = ">= 3.7"
url = "https://github3.readthedocs.io"
authors = [
{ name = "Ian Stapleton Cordasco", email="graffatcolmingov@gmail.com" },
]
license = "BSD-3-Clause"
license_file = "LICENSE"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
]

dynamic = ["version"]

dependencies = [
"PyJWT[crypto]>=2.3.0",
"python-dateutil>=2.6.0",
"requests>=2.18",
"uritemplate>=3.0.0",
]

[project.optional-dependencies]
test = [
"pytest>=7.0",
"pytest-xdist[psutil]",
"betamax>=0.5.1",
"betamax_matchers>=0.3.0",
]

dev = [
"github3.py[test]",
"wheel",
"build",
"twine",
"tox>=3.1.3",
]

[tool.hatch.version]
path = "src/github3/__about__.py"

[tool.hatch.build.targets.wheel]
packages = [
"src/github3",
]


[project.urls]
Documentation = "https://github3.readthedocs.io"
Changelog = "https://github3.readthedocs.io/en/latest/release-notes/index.html"
Source = "https://github.com/sigmavirus24/github3.py"
"Released Versions" = "https://github.com/sigmavirus24/github3.py/tags"

[tool.black]
line-length = 78
target-version = ['py37']
Expand Down
47 changes: 0 additions & 47 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ passenv = GH_*
pip_pre = False
deps =
requests{env:REQUESTS_VERSION:>=2.0}
pytest
pytest-xdist[psutil]
betamax>=0.5.1
betamax_matchers>=0.3.0
pypy3: unittest2
extras = test
commands = pytest {posargs}

[testenv:flake8]
Expand Down Expand Up @@ -97,10 +94,12 @@ deps =
-rdocs/source/requirements.txt
sphinx_rtd_theme
twine >= 3.4.2
build
.
commands =
sphinx-build -E -W -c docs/source/ -b html docs/source/ docs/build/html
twine check --strict {distdir}/*
python -m build
twine check --strict dist/*

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