From fd2e450ae2b05458699615e39c44009aa4af2d0c Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 16 Feb 2022 22:42:31 -0500 Subject: [PATCH 1/4] Update package metadata --- CHANGELOG.md | 1 + MANIFEST.in | 14 ------------ pyproject.toml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-- setup.cfg | 45 -------------------------------------- setup.py | 14 ------------ 5 files changed, 58 insertions(+), 75 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 77ea5edf21..54a3f40184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [docs] Add more examples - [dev] Change github action job names - [docs] Add additional examples for installation from git repos +- [packaging] Switch to [PEP 621](https://www.python.org/dev/peps/pep-0621/) ## 1.0.0 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 4351b0e610..0000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,14 +0,0 @@ -graft src -include *.md pipx_demo.gif logo.png LICENSE - -exclude .isort.cfg .pre-commit-config.yaml get-pipx.py makefile generate_docs.py .flake8 mkdocs.yml noxfile.py .coveragerc .deepsource.toml -recursive-exclude testdata * - -prune templates -prune tests -prune docs -prune scripts - -global-exclude *.py[cod] -global-exclude __pycache__ -global-exclude .*.swp diff --git a/pyproject.toml b/pyproject.toml index 3198dd9257..d8f36ea9cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,61 @@ [build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=0.14.0"] +build-backend = "hatchling.build" + +[project] +name = "pipx" +description = "Install and Run Python Applications in Isolated Environments" +readme = "README.md" +license = "MIT" +requires-python = ">=3.7" +keywords = [ + "pip", + "install", + "cli", + "workflow", + "Virtual Environment", +] +authors = [ + { name = "Chad Smith", email = "chadsmith.software@gmail.com" }, +] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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", +] +dependencies = [ + "argcomplete>=1.9.4", + "colorama>=0.4.4; sys_platform == 'win32'", + "importlib-metadata>=3.3.0; python_version < '3.8'", + "packaging>=20.0", + "userpath>=1.6.0", +] +dynamic = ["version"] + +[project.urls] +Documentation = "https://pypa.github.io/pipx/" +"Source Code" = "https://github.com/pypa/pipx" +"Bug Tracker" = "https://github.com/pypa/pipx/issues" + +[project.scripts] +pipx = "pipx.main:cli" + +[tool.hatch.version] +source = "code" +path = "src/pipx/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/logo.png", + "/pipx_demo.gif", + "/*.md", +] [tool.isort] profile = "black" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5c1641fccf..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[metadata] -name = pipx -version = attr: pipx.version.__version__ -author = Chad Smith -author_email = Chad Smith -description = Install and Run Python Applications in Isolated Environments -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/pypa/pipx -project_urls = - Documentation = https://pypa.github.io/pipx/ - Source Code = https://github.com/pypa/pipx - Bug Tracker = https://github.com/pypa/pipx/issues -keywords = pip, install, cli, workflow, Virtual Environment -license = License :: OSI Approved :: MIT License -classifiers = - Operating System :: OS Independent - License :: OSI Approved :: MIT License - Programming Language :: Python - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3 :: Only - -[options] -packages = find: -package_dir = - = src -include_package_data = true -zip_safe = true -python_requires = >=3.6 -install_requires = - colorama>=0.4.4;sys_platform=="win32" - userpath>=1.6.0 - argcomplete>=1.9.4 - packaging>=20.0 - importlib-metadata>=3.3.0; python_version < '3.8' - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - pipx = pipx.main:cli diff --git a/setup.py b/setup.py deleted file mode 100755 index 4024e697e5..0000000000 --- a/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -from setuptools import setup # type: ignore - -if sys.version_info < (3, 6, 0): - sys.exit( - "Python 3.6 or later is required. " - "See https://github.com/pypa/pipx " - "for installation instructions." - ) - -setup() From f316fd85319f1622ce3258782c9231eb3427220e Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Thu, 17 Feb 2022 02:08:38 -0500 Subject: [PATCH 2/4] remove manifest check --- noxfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index e1101406a6..4c04ca64b3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -14,7 +14,6 @@ "flake8-bugbear==21.11.29", "mypy==0.930", "types-jinja2", - "check-manifest==0.47", "packaging>=20.0", "isort==5.10.1", ] @@ -173,8 +172,6 @@ def lint(session): "--warn-unused-ignores", *files, ) - session.run("check-manifest") - session.run("python", "setup.py", "check", "--metadata", "--strict") @nox.session(python=PYTHON_ALL_VERSIONS) From 983b7f1561cfb7e3a6e31405a712df4374c07411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Sat, 19 Feb 2022 23:09:13 +0000 Subject: [PATCH 3/4] Format using taplo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- pyproject.toml | 49 +++++++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d8f36ea9cc..c8576c5d2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,32 +8,24 @@ description = "Install and Run Python Applications in Isolated Environments" readme = "README.md" license = "MIT" requires-python = ">=3.7" -keywords = [ - "pip", - "install", - "cli", - "workflow", - "Virtual Environment", -] -authors = [ - { name = "Chad Smith", email = "chadsmith.software@gmail.com" }, -] +keywords = ["pip", "install", "cli", "workflow", "Virtual Environment"] +authors = [{ name = "Chad Smith", email = "chadsmith.software@gmail.com" }] classifiers = [ - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "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", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "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", ] dependencies = [ - "argcomplete>=1.9.4", - "colorama>=0.4.4; sys_platform == 'win32'", - "importlib-metadata>=3.3.0; python_version < '3.8'", - "packaging>=20.0", - "userpath>=1.6.0", + "argcomplete>=1.9.4", + "colorama>=0.4.4; sys_platform == 'win32'", + "importlib-metadata>=3.3.0; python_version < '3.8'", + "packaging>=20.0", + "userpath>=1.6.0", ] dynamic = ["version"] @@ -50,21 +42,14 @@ source = "code" path = "src/pipx/version.py" [tool.hatch.build.targets.sdist] -include = [ - "/src", - "/logo.png", - "/pipx_demo.gif", - "/*.md", -] +include = ["/src", "/logo.png", "/pipx_demo.gif", "/*.md"] [tool.isort] profile = "black" known_first_party = ["helpers", "package_info"] [tool.pytest.ini_options] -markers = [ - "all_packages: test install with maximum number of packages", -] +markers = ["all_packages: test install with maximum number of packages"] [tool.black] skip-magic-trailing-comma = true From 66241ba3ff08940a202fcac7306ce58322ccad68 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Thu, 24 Feb 2022 14:39:51 -0500 Subject: [PATCH 4/4] update version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c8576c5d2c..6167b80847 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling>=0.14.0"] +requires = ["hatchling>=0.15.0"] build-backend = "hatchling.build" [project]