diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..b7e6ecad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,72 @@ +# Update dependencies: +# +# - python3 -m pip install --user --upgrade pip-tools build +# - git clean -fdx # remove all untracked files! +# - (pip-compile --upgrade -o requirements.txt requirements.in) +# +# Prepare a release: +# +# - git pull --rebase +# - Remove untracked files/dirs: git clean -fdx +# - maybe update version in pyperformance/__init__.py and doc/conf.py +# - set release date in doc/changelog.rst +# - git commit -a -m "prepare release x.y" +# - run tests: tox --parallel auto +# - git push +# - check the CI status: +# https://github.com/python/pyperformance/actions +# +# Release a new version: +# +# - git tag VERSION +# - git push --tags +# - Remove untracked files/dirs: git clean -fdx +# - python -m build +# - twine upload dist/* +# +# After the release: +# +# - set version to n+1: pyperformance/__init__.py and doc/conf.py +# - git commit -a -m "post-release" +# - git push + +[build-system] +requires = ["setuptools >= 61"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyperformance" +dynamic = ["version"] +license = {text = "MIT"} +description = "Python benchmark suite" +readme = "README.rst" +urls = {Homepage = "https://github.com/python/pyperformance"} +authors= [{name = "Collin Winter"}, {name= "Jeffrey Yasskin"}] +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python', +] +requires-python = ">=3.7" +dependencies = ["pyperf", "toml", "packaging"] + +[project.optional-dependencies] +dev = [ + 'tox', +] + +[project.scripts] +pyperformance = "pyperformance.cli:main" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages] +find = {} # Scanning implicit namespaces is active by default + +[tool.setuptools.dynamic] +version = {attr = "pyperformance.__version__"} diff --git a/setup.py b/setup.py deleted file mode 100644 index 6166d76c..00000000 --- a/setup.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python3 - -# FIXME: -# -# - REENABLE HG_STARTUP BENCHMARK. -# -# Update dependencies: -# -# - python3 -m pip install --user --upgrade pip-tools -# - git clean -fdx # remove all untracked files! -# - (pip-compile --upgrade -o requirements.txt requirements.in) -# -# Prepare a release: -# -# - git pull --rebase -# - Remove untracked files/dirs: git clean -fdx -# - maybe update version in pyperformance/__init__.py and doc/conf.py -# - set release date in doc/changelog.rst -# - git commit -a -m "prepare release x.y" -# - run tests: tox --parallel auto -# - git push -# - check the CI status: -# https://github.com/python/pyperformance/actions -# -# Release a new version: -# -# - git tag VERSION -# - git push --tags -# - Remove untracked files/dirs: git clean -fdx -# - python3 setup.py sdist bdist_wheel -# - twine upload dist/* -# -# After the release: -# -# - set version to n+1: pyperformance/__init__.py and doc/conf.py -# - git commit -a -m "post-release" -# - git push - -# Import just to get the version -import pyperformance - -VERSION = pyperformance.__version__ - -DESCRIPTION = 'Python benchmark suite' -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python', -] - - -# put most of the code inside main() to be able to import setup.py in -# unit tests -def main(): - import os.path - from setuptools import setup, find_packages - - with open('README.rst', encoding="utf8") as fp: - long_description = fp.read().strip() - - options = { - 'name': 'pyperformance', - 'version': VERSION, - 'author': 'Collin Winter and Jeffrey Yasskin', - 'license': 'MIT license', - 'description': DESCRIPTION, - 'long_description': long_description, - 'url': 'https://github.com/python/benchmarks', - 'classifiers': CLASSIFIERS, - 'packages': find_packages(), - 'include_package_data': True, - 'entry_points': { - 'console_scripts': ['pyperformance=pyperformance.cli:main'] - }, - 'install_requires': ["pyperf", "toml", "packaging"], - } - setup(**options) - - -if __name__ == '__main__': - main() diff --git a/tox.ini b/tox.ini index 167839e6..a38f48b2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] envlist = py3, pypy3, doc, pep8 +isolated_build = True [testenv] commands = python runtests.py