diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90af019d..13892dcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -29,12 +32,12 @@ jobs: - name: Upgrade pip run: | - pip install --constraint=.github/workflows/constraints.txt pip + pip install pip pip --version - name: Install Tox run: | - pip install --constraint=.github/workflows/constraints.txt tox + pip install tox tox --version - name: Run Tox diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt deleted file mode 100644 index ed863a8c..00000000 --- a/.github/workflows/constraints.txt +++ /dev/null @@ -1,2 +0,0 @@ -pip==20.3.3 -tox==3.20.1 diff --git a/AUTHORS.rst b/AUTHORS.rst index 53c92596..841a0b85 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -220,3 +220,5 @@ Contributors - Peter Küffner (@kuepe-sl) - Andrew MacCormack (@amaccormack-lumira) + +- Chris R (@offbyone) diff --git a/Makefile b/Makefile index e176fd67..4801b410 100644 --- a/Makefile +++ b/Makefile @@ -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/* diff --git a/README.rst b/README.rst index 72b3e0e6..1799ee4a 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index c614fcd7..00000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -. -pytest>=7.0 -pytest-xdist[psutil] -wheel -betamax>=0.5.1 -betamax_matchers>=0.3.0 -tox>=3.1.3 diff --git a/pyproject.toml b/pyproject.toml index ff87a2a0..57259d73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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'] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1f422ee8..00000000 --- a/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -[metadata] -name = github3.py -version = attr:github3.__about__.__version__ -description = Python wrapper for the GitHub API(http://developer.github.com/v3) -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github3.readthedocs.io -author = Ian Stapleton Cordasco -author_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 -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 -requires_dist = - requests>=2.0 - uritemplate>=3.0.0 - python-dateutil>=2.6.0 - PyJWT>=2.3.0 - -[options] -packages = find: -install_requires = - PyJWT[crypto]>=2.3.0 - python-dateutil>=2.6.0 - requests>=2.18 - uritemplate>=3.0.0 -python_requires = >=3.7 -package_dir = - =src - -[options.packages.find] -where = src - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100755 index 6d1ca271..00000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Packaging logic.""" -import setuptools - -setuptools.setup() diff --git a/tox.ini b/tox.ini index d0fca657..f937253f 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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 @@ -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