From dc383cad639e4d0023b947eb3ef4abc28b2f733f Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 18 Jul 2025 21:46:51 -0400 Subject: [PATCH 1/5] Migrate from setup.py and setup.cfg to pyproject.toml --- pyproject.toml | 62 ++++++++++++++++++++++++++++++++++++ setup.cfg | 10 ------ setup.py | 85 -------------------------------------------------- 3 files changed, 62 insertions(+), 95 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2157e585 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "fire" +version = "0.7.1" +description = "A library for automatically generating command line interfaces." +readme = "README.md" +license = "Apache-2.0" +authors = [ + {name = "David Bieber", email = "dbieber@google.com"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: Unix", +] +keywords = ["command", "line", "interface", "cli", "python", "fire", "interactive", "bash", "tool"] +requires-python = ">=3.7" +dependencies = [ + "termcolor", +] + +[project.urls] +Homepage = "https://github.com/google/python-fire" +Repository = "https://github.com/google/python-fire" + +[project.optional-dependencies] +test = [ + "hypothesis", + "levenshtein", +] + +[tool.setuptools.packages.find] +include = ["fire*"] + +[tool.setuptools.package-data] +fire = ["console/*"] + +[tool.pytest.ini_options] +addopts = [ + "--ignore=fire/test_components_py3.py", + "--ignore=fire/parser_fuzz_test.py" +] + +[tool.pytype] +inputs = "." +output = ".pytype" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ed53d83b..00000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[aliases] -test = pytest - -[tool:pytest] -addopts = --ignore=fire/test_components_py3.py - --ignore=fire/parser_fuzz_test.py - -[pytype] -inputs = . -output = .pytype diff --git a/setup.py b/setup.py deleted file mode 100644 index 23b7b472..00000000 --- a/setup.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2018 Google Inc. -# -# 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 -# -# http://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. - -"""The setup.py file for Python Fire.""" - -from setuptools import setup - -LONG_DESCRIPTION = """ -Python Fire is a library for automatically generating command line interfaces -(CLIs) with a single line of code. - -It will turn any Python module, class, object, function, etc. (any Python -component will work!) into a CLI. It's called Fire because when you call Fire(), -it fires off your command. -""".strip() - -SHORT_DESCRIPTION = """ -A library for automatically generating command line interfaces.""".strip() - -DEPENDENCIES = [ - 'termcolor', -] - -TEST_DEPENDENCIES = [ - 'hypothesis', - 'levenshtein', -] - -VERSION = '0.7.1' -URL = 'https://github.com/google/python-fire' - -setup( - name='fire', - version=VERSION, - description=SHORT_DESCRIPTION, - long_description=LONG_DESCRIPTION, - url=URL, - - author='David Bieber', - author_email='dbieber@google.com', - license='Apache Software License', - - classifiers=[ - 'Development Status :: 4 - Beta', - - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Libraries :: Python Modules', - - 'License :: OSI Approved :: Apache Software License', - - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - - 'Operating System :: OS Independent', - 'Operating System :: POSIX', - 'Operating System :: MacOS', - 'Operating System :: Unix', - ], - - keywords='command line interface cli python fire interactive bash tool', - - requires_python='>=3.7', - packages=['fire', 'fire.console'], - - install_requires=DEPENDENCIES, - tests_require=TEST_DEPENDENCIES, -) From 3d040efc952d046964c8d04fa771b9e60d9c4fe1 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 18 Jul 2025 21:52:19 -0400 Subject: [PATCH 2/5] Move requirements files into pyproject.toml --- .github/scripts/build.sh | 3 +-- .github/scripts/requirements.txt | 9 --------- pyproject.toml | 11 +++++++++++ requirements.txt | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 .github/scripts/requirements.txt delete mode 100644 requirements.txt diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 111257ae..9c8b0d3a 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -19,8 +19,7 @@ set -e PYTHON_VERSION=${PYTHON_VERSION:-3.7} -pip install -U -r .github/scripts/requirements.txt -python setup.py develop +pip install -e .[ci] python -m pytest # Run the tests without IPython. pip install ipython python -m pytest # Now run the tests with IPython. diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt deleted file mode 100644 index 882dd440..00000000 --- a/.github/scripts/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -setuptools <=80.9.0 -pip -pylint <3.3.7 -pytest <=8.3.5 -pytest-pylint <=1.1.2 -pytest-runner <7.0.0 -termcolor <3.2.0 -hypothesis <6.133.0 -levenshtein <=0.27.1 diff --git a/pyproject.toml b/pyproject.toml index 2157e585..63f369e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,17 @@ test = [ "hypothesis", "levenshtein", ] +ci = [ + "setuptools<=80.9.0", + "pip", + "pylint<3.3.7", + "pytest<=8.3.5", + "pytest-pylint<=1.1.2", + "pytest-runner<7.0.0", + "termcolor<3.2.0", + "hypothesis<6.133.0", + "levenshtein<=0.27.1", +] [tool.setuptools.packages.find] include = ["fire*"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9c558e35..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -. From 2b843a09609f2200591a21d9dfb61ee00b81aa25 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 18 Jul 2025 21:56:27 -0400 Subject: [PATCH 3/5] Use [test] in favor of [ci] --- .github/scripts/build.sh | 2 +- pyproject.toml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 9c8b0d3a..7f5cf491 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -19,7 +19,7 @@ set -e PYTHON_VERSION=${PYTHON_VERSION:-3.7} -pip install -e .[ci] +pip install -e .[test] python -m pytest # Run the tests without IPython. pip install ipython python -m pytest # Now run the tests with IPython. diff --git a/pyproject.toml b/pyproject.toml index 63f369e6..e85f2bd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,10 +41,6 @@ Repository = "https://github.com/google/python-fire" [project.optional-dependencies] test = [ - "hypothesis", - "levenshtein", -] -ci = [ "setuptools<=80.9.0", "pip", "pylint<3.3.7", From 91b6a8c8efa68ee3e9c77c9832e6f59b9f4773c0 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 18 Jul 2025 21:57:02 -0400 Subject: [PATCH 4/5] Fix license formatting error --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e85f2bd0..6a6ba63e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "fire" version = "0.7.1" description = "A library for automatically generating command line interfaces." readme = "README.md" -license = "Apache-2.0" +license = {text = "Apache-2.0"} authors = [ {name = "David Bieber", email = "dbieber@google.com"} ] From aded80712c54063eb0160539319e33420614e418 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 18 Jul 2025 21:59:32 -0400 Subject: [PATCH 5/5] Point dependabot at the pyproject file --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ba1b7f19..8be46672 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,7 @@ version: 2 updates: # Enable version updates for python - package-ecosystem: "pip" - directory: ".github/scripts/" + directory: "/" schedule: interval: "monthly" labels: ["dependabot"]