From 2b12f173de8137f97e0b5668dd4eec5bf19ced8c Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 23 Sep 2022 19:59:17 +0200 Subject: [PATCH] Remove support for setuptools, use poetry only (#178) That means we also don't need MANIFEST.in and check-manifest any more. --- .github/workflows/lint.yml | 2 +- .github/workflows/publish.yml | 5 ++- MANIFEST.in | 23 ------------- poetry.lock | 64 +---------------------------------- pyproject.toml | 5 +-- setup.cfg | 5 --- setup.py | 46 ------------------------- tests/benchmarks/__init__.py | 2 +- tox.ini | 14 +++----- 9 files changed, 10 insertions(+), 156 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 373eb176..2b8acd4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,4 +22,4 @@ jobs: - name: Run code quality tests with tox run: tox env: - TOXENV: black,flake8,isort,mypy,docs,manifest + TOXENV: black,flake8,isort,mypy,docs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fc166745..f3725b66 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,9 +19,8 @@ jobs: - name: Build wheel and source tarball run: | - pip install wheel - python setup.py sdist bdist_wheel - + pip install poetry + poetry build - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 421aa24f..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,23 +0,0 @@ -include MANIFEST.in - -include CODEOWNERS -include LICENSE -include README.md -include SECURITY.md - -include .bumpversion.cfg -include .editorconfig -include .flake8 -include .readthedocs.yaml - -include tox.ini - -include poetry.lock -include pyproject.toml - -graft src/graphql -graft tests -recursive-include docs *.txt *.rst conf.py Makefile make.bat *.jpg *.png *.gif -prune docs/_build - -global-exclude *.py[co] __pycache__ diff --git a/poetry.lock b/poetry.lock index dbdc8ed0..131f0946 100644 --- a/poetry.lock +++ b/poetry.lock @@ -54,27 +54,6 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] -[[package]] -name = "build" -version = "0.8.0" -description = "A simple, correct PEP 517 build frontend" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -colorama = {version = "*", markers = "os_name == \"nt\""} -importlib-metadata = {version = ">=0.22", markers = "python_version < \"3.8\""} -packaging = ">=19.0" -pep517 = ">=0.9.1" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} - -[package.extras] -docs = ["furo (>=2021.08.31)", "sphinx (>=4.0,<5.0)", "sphinx-argparse-cli (>=1.5)", "sphinx-autodoc-typehints (>=1.10)"] -test = ["filelock (>=3)", "pytest (>=6.2.4)", "pytest-cov (>=2.12)", "pytest-mock (>=2)", "pytest-rerunfailures (>=9.1)", "pytest-xdist (>=1.34)", "setuptools (>=42.0.0)", "setuptools (>=56.0.0)", "toml (>=0.10.0)", "wheel (>=0.36.0)"] -typing = ["importlib-metadata (>=4.6.4)", "mypy (==0.950)", "typing-extensions (>=3.7.4.3)"] -virtualenv = ["virtualenv (>=20.0.35)"] - [[package]] name = "bump2version" version = "1.0.1" @@ -102,22 +81,6 @@ python-versions = ">=3.6.0" [package.extras] unicode_backport = ["unicodedata2"] -[[package]] -name = "check-manifest" -version = "0.48" -description = "Check MANIFEST.in in a Python source package for completeness" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -build = ">=0.1" -setuptools = "*" -tomli = "*" - -[package.extras] -test = ["mock (>=3.0.0)", "pytest"] - [[package]] name = "click" version = "8.1.3" @@ -324,19 +287,6 @@ category = "dev" optional = false python-versions = ">=3.7" -[[package]] -name = "pep517" -version = "0.13.0" -description = "Wrappers to build Python packages using PEP 517 hooks" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -importlib_metadata = {version = "*", markers = "python_version < \"3.8\""} -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -zipp = {version = "*", markers = "python_version < \"3.8\""} - [[package]] name = "platformdirs" version = "2.5.2" @@ -774,7 +724,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "1a1371f2665f410245e83874106f75f160133fe6749d70ba6ca179b4837e50ae" +content-hash = "3f2775172e15ba8491dd4c0eb49800e7f6287e901a4863503317f0e8ec3aef15" [metadata.files] alabaster = [ @@ -814,10 +764,6 @@ black = [ {file = "black-22.8.0-py3-none-any.whl", hash = "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4"}, {file = "black-22.8.0.tar.gz", hash = "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e"}, ] -build = [ - {file = "build-0.8.0-py3-none-any.whl", hash = "sha256:19b0ed489f92ace6947698c3ca8436cb0556a66e2aa2d34cd70e2a5d27cd0437"}, - {file = "build-0.8.0.tar.gz", hash = "sha256:887a6d471c901b1a6e6574ebaeeebb45e5269a79d095fe9a8f88d6614ed2e5f0"}, -] bump2version = [ {file = "bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410"}, {file = "bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6"}, @@ -830,10 +776,6 @@ charset-normalizer = [ {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, ] -check-manifest = [ - {file = "check-manifest-0.48.tar.gz", hash = "sha256:3b575f1dade7beb3078ef4bf33a94519834457c7281dbc726b15c5466b55c657"}, - {file = "check_manifest-0.48-py3-none-any.whl", hash = "sha256:b1923685f98c1c2468601a1a7bed655db549a25d43c583caded3860ad8308f8c"}, -] click = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, @@ -1017,10 +959,6 @@ pathspec = [ {file = "pathspec-0.10.1-py3-none-any.whl", hash = "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93"}, {file = "pathspec-0.10.1.tar.gz", hash = "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d"}, ] -pep517 = [ - {file = "pep517-0.13.0-py3-none-any.whl", hash = "sha256:4ba4446d80aed5b5eac6509ade100bff3e7943a8489de249654a5ae9b33ee35b"}, - {file = "pep517-0.13.0.tar.gz", hash = "sha256:ae69927c5c172be1add9203726d4b84cf3ebad1edcd5f71fcdc746e66e829f59"}, -] platformdirs = [ {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, diff --git a/pyproject.toml b/pyproject.toml index 78d7e9f2..00dc1a47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,9 +31,7 @@ packages = [ { include = '.readthedocs.yaml', format = "sdist" }, { include = 'poetry.lock', format = "sdist" }, { include = 'tox.ini', format = "sdist" }, - { include = 'setup.cfg', format = "sdist" }, { include = 'CODEOWNERS', format = "sdist" }, - { include = 'MANIFEST.in', format = "sdist" }, { include = 'SECURITY.md', format = "sdist" } ] @@ -66,7 +64,6 @@ black = "22.8.0" flake8 = "^5.0" isort = "^5.10" mypy = "0.971" -check-manifest = ">=0.48,<1" bump2version = ">=1.0,<2" [tool.poetry.group.doc] @@ -150,5 +147,5 @@ timeout = "100" filterwarnings = "ignore::pytest.PytestConfigWarning" [build-system] -requires = ["poetry_core>=1.2,<2", "setuptools>=65,<70"] +requires = ["poetry_core>=1.2,<2"] build-backend = "poetry.core.masonry.api" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7daeda08..00000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[bdist_wheel] -python-tag = py3 - -[aliases] -test = pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index c3743a7a..00000000 --- a/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -from re import search - -from setuptools import find_packages, setup - - -with open("src/graphql/version.py") as version_file: - version = search('version = "(.*)"', version_file.read()).group(1) - -with open("README.md") as readme_file: - readme = readme_file.read() - -setup( - name="graphql-core", - version=version, - description="GraphQL implementation for Python, a port of GraphQL.js," - " the JavaScript reference implementation for GraphQL.", - long_description=readme, - long_description_content_type="text/markdown", - keywords="graphql", - url="https://github.com/graphql-python/graphql-core", - author="Christoph Zwerschke", - author_email="cito@online.de", - license="MIT license", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], - install_requires=[ - "typing-extensions>=4.3,<5; python_version < '3.8'", - ], - python_requires=">=3.7,<4", - packages=find_packages("src"), - package_dir={"": "src"}, - # PEP-561: https://www.python.org/dev/peps/pep-0561/ - package_data={"graphql": ["py.typed"]}, - include_package_data=True, - zip_safe=False, -) diff --git a/tests/benchmarks/__init__.py b/tests/benchmarks/__init__.py index 0f0a83c1..4142e203 100644 --- a/tests/benchmarks/__init__.py +++ b/tests/benchmarks/__init__.py @@ -1,6 +1,6 @@ """Benchmarks for graphql -Benchmarks are disabled (only executed as tests) by default in setup.cfg. +Benchmarks are disabled (only executed as tests) by default in pyproject.toml. You can enable them with --benchmark-enable if your want to execute them. E.g. in order to execute all the benchmarks with tox using Python 3.9:: diff --git a/tox.ini b/tox.ini index 7887ed5c..604713ff 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{7,8,9,10}, black, flake8, isort, mypy, docs, manifest +envlist = py3{7,8,9,10}, black, flake8, isort, mypy, docs isolated_build = true [gh-actions] @@ -13,19 +13,19 @@ python = basepython = python3.9 deps = black==22.8.0 commands = - black src tests setup.py -t py39 --check + black src tests -t py39 --check [testenv:flake8] basepython = python3.9 deps = flake8>=5,<6 commands = - flake8 src tests setup.py + flake8 src tests [testenv:isort] basepython = python3.9 deps = isort>=5.10,<6 commands = - isort src tests setup.py --check-only + isort src tests --check-only [testenv:mypy] basepython = python3.9 @@ -43,12 +43,6 @@ deps = commands = sphinx-build -b html -nEW docs docs/_build/html -[testenv:manifest] -basepython = python3.9 -deps = check-manifest>=0.48,<1 -commands = - check-manifest -v - [testenv] deps = pytest>=7.1,<8