From 8f49c9c7b891c37b346d466e7421c729818def07 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 26 Oct 2021 14:25:33 +0100 Subject: [PATCH] Remove setup.py Modern packaging tools no longer need setup.py and they support editable installs too. --- .pre-commit-config.yaml | 4 ++-- constraints.txt | 2 +- setup.cfg | 8 -------- setup.py | 37 ------------------------------------- 4 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 setup.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26703ba7d..b774b924c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,13 +85,13 @@ repos: hooks: - id: pip-compile name: pip-compile - entry: pip-compile --no-annotate --output-file=constraints.txt setup.py setup.cfg --extra test --extra yamllint + entry: pip-compile --no-annotate --output-file=constraints.txt setup.cfg --extra test --extra yamllint language: system files: ^(setup\.cfg|=constraints\.txt)$ pass_filenames: false - id: pip-compile-upgrade name: pip-compile-upgrade - entry: pip-compile -q --upgrade --no-annotate --output-file=constraints.txt setup.py setup.cfg --extra test --extra yamllint + entry: pip-compile -q --upgrade --no-annotate --output-file=constraints.txt setup.cfg --extra test --extra yamllint language: system files: ^(setup\.cfg|=constraints\.txt)$ pass_filenames: false diff --git a/constraints.txt b/constraints.txt index 4bb8fe5b0..e85c124ec 100644 --- a/constraints.txt +++ b/constraints.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with python 3.9 # To update, run: # -# pip-compile --extra=test --extra=yamllint --no-annotate --output-file=constraints.txt setup.cfg setup.py +# pip-compile --extra=test --extra=yamllint --no-annotate --output-file=constraints.txt setup.cfg # ansi2html==1.6.0 ansible-compat==0.5.0 diff --git a/setup.cfg b/setup.cfg index 0b18f50a7..2efed0ce3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[aliases] -dists = clean --all sdist bdist_wheel - [metadata] name = molecule url = https://github.com/ansible-community/molecule @@ -59,11 +56,6 @@ packages = find: include_package_data = True zip_safe = False -# These are required during `setup.py` run: -setup_requires = - setuptools_scm >= 1.15.0 - setuptools_scm_git_archive >= 1.0 - # These are required in actual runtime: install_requires = ansible-compat >= 0.5.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 79778206c..000000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/env python -# Copyright (c) 2019 Red Hat, Inc. -# Copyright (c) 2015-2018 Cisco Systems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -"""Molecule distribution package setuptools installer.""" - -import site -import sys - -import setuptools - -# See https://github.com/pypa/pip/issues/7953 -site.ENABLE_USER_SITE = "--user" in sys.argv[1:] - - -if __name__ == "__main__": - setuptools.setup( - use_scm_version={"local_scheme": "no-local-version"}, - setup_requires=["setuptools_scm[toml]>=3.5.0"], - )