From 6e6cf82ea110c07808afb4059eb26ef03945f450 Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sat, 29 May 2021 15:58:40 -0400 Subject: [PATCH] Remove setup.py (#757) * Remove setup.py * Use isolated_build for pyproject.toml * Remove 'twine check' from docs build * Add 'twine check' to release * Use build instead of pep517 * Update tox minversion Co-authored-by: Jason R. Coombs * Move 'twine check' back to docs Co-authored-by: Jason R. Coombs --- pyproject.toml | 7 +++++-- setup.cfg | 3 +-- setup.py | 17 ----------------- tox.ini | 13 +++++-------- 4 files changed, 11 insertions(+), 29 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 21b5d297..ef8c00e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ +# pyproject.toml [build-system] -requires = ["setuptools>=40.8", "wheel", "setuptools_scm>=1.15"] -build-backend = "setuptools.build_meta:__legacy__" +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] [tool.towncrier] package = "twine" diff --git a/setup.cfg b/setup.cfg index f338bdae..dc949f20 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,7 @@ author = Donald Stufft and individual contributors author_email = donald@stufft.io description = Collection of utilities for publishing packages on PyPI long_description = file:README.rst +long_description_content_type = text/x-rst url = https://twine.readthedocs.io/ project_urls = Source = https://github.com/pypa/twine/ @@ -43,8 +44,6 @@ install_requires= keyring >= 15.1 rfc3986 >= 1.4.0 colorama >= 0.4.3 -setup_requires = - setuptools_scm >= 1.15 include_package_data = True [options.entry_points] diff --git a/setup.py b/setup.py deleted file mode 100644 index e69bda64..00000000 --- a/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2018 Donald Stufft and individual contributors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import setuptools - - -setuptools.setup(use_scm_version=True) diff --git a/tox.ini b/tox.ini index cb6141d2..d92d8a2b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] -minversion = 2.4 +minversion = 3.3 envlist = lint,types,py{36,37,38,39},integration,docs +isolated_build = True [testenv] deps = @@ -35,8 +36,7 @@ commands = sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html doc8 docs README.rst --ignore-path docs/_build/html sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck - python setup.py sdist - twine check dist/* + python -m twine check --strict {distdir}/* [testenv:watch-docs] deps = @@ -85,13 +85,10 @@ commands = towncrier {posargs} [testenv:release] -# disabled for twine to cause it to upload itself -# skip_install = True # specify Python 3 to use platform's default Python 3 basepython = python3 deps = - pep517>=0.5 - twine>=1.13 + build path.py passenv = TWINE_PASSWORD @@ -100,7 +97,7 @@ setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import path; path.Path('dist').rmtree_p()" - python -m pep517.build . + python -m build python -m twine upload dist/* [testenv:devpi]