From 6dec68844af2169a115e4edd7403bc8bc98b46fa Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 25 Feb 2021 18:27:25 +0300 Subject: [PATCH 1/2] Moved the metadata into setup.cfg. Added pyproject.toml. Version is now fetched from git tags. --- .github/workflows/build.yml | 2 +- pyproject.toml | 5 ++++ setup.cfg | 49 +++++++++++++++++++++++++++++++ setup.py | 58 ------------------------------------- 4 files changed, 55 insertions(+), 59 deletions(-) create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0de073e1..3bafa810 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: pip install .[qa] - name: Run Flake8 # Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. - run: flake8 --extend-ignore F401 parso test/*.py setup.py scripts/ + run: flake8 --extend-ignore F401 parso test/*.py scripts/ - name: Run Mypy run: mypy parso test: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..66ddafdb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index 433824a3..d82ccb14 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,52 @@ +[metadata] +name = parso +author = David Halter +author_email = davidhalter88@gmail.com +maintainer = David Halter +maintainer_email = davidhalter88@gmail.com +license = MIT +description = A Python Parser +long_description = file: README.rst, CHANGELOG.rst +keywords = python, parser, parsing +url = https://github.com/davidhalter/parso +classifiers = + Development Status :: 4 - Beta + Environment :: Plugins + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Software Development :: Libraries :: Python Modules + Topic :: Text Editors :: Integrated Development Environments (IDE) + Topic :: Utilities + Typing :: Typed +platforms = any + +[options] +packages = find: +include_package_data = True +python_requires = >=3.6 + +[options.packages.find] +exclude = + test + test.* + +[options.extras_require] +testing = pytest<6.0.0; docopt +qa = flake8==3.8.3; mypy==0.782 + +[options.package_data] +parso = + python/grammar*.txt + py.typed + *.pyi + **/*.pyi + [bdist_wheel] universal=1 diff --git a/setup.py b/setup.py deleted file mode 100755 index 0ead19cb..00000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -from __future__ import with_statement - -from setuptools import setup, find_packages - -import parso - - -__AUTHOR__ = 'David Halter' -__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com' - -readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() - -setup( - name='parso', - version=parso.__version__, - description='A Python Parser', - author=__AUTHOR__, - author_email=__AUTHOR_EMAIL__, - include_package_data=True, - maintainer=__AUTHOR__, - maintainer_email=__AUTHOR_EMAIL__, - url='https://github.com/davidhalter/parso', - license='MIT', - keywords='python parser parsing', - long_description=readme, - packages=find_packages(exclude=['test']), - package_data={'parso': ['python/grammar*.txt', 'py.typed', '*.pyi', '**/*.pyi']}, - platforms=['any'], - python_requires='>=3.6', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Plugins', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Text Editors :: Integrated Development Environments (IDE)', - 'Topic :: Utilities', - 'Typing :: Typed', - ], - extras_require={ - 'testing': [ - 'pytest<6.0.0', - 'docopt', - ], - 'qa': [ - 'flake8==3.8.3', - 'mypy==0.782', - ], - }, -) From d03074603106dda05a42fabc70600834295f6c0f Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Tue, 14 Jun 2022 13:53:08 +0300 Subject: [PATCH 2/2] Move metadata into `PEP 621`-compliant `pyproject.toml`. --- pyproject.toml | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 74 -------------------------------------------------- 2 files changed, 72 insertions(+), 74 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 66ddafdb..e5e91cf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,76 @@ requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" +[project] +name = "parso" +authors = [{name = "David Halter", email = "davidhalter88@gmail.com"}] +maintainers = [{name = "David Halter", email = "davidhalter88@gmail.com"}] +license = {text = "MIT"} +description = "A Python Parser" +keywords = ["python", "parser", "parsing"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Plugins", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Text Editors :: Integrated Development Environments (IDE)", + "Topic :: Utilities", + "Typing :: Typed", +] +urls = {Homepage = "https://github.com/davidhalter/parso"} +dynamic = ["readme", "version"] +requires-python = ">=3.6" + +[project.optional-dependencies] +testing = ["pytest<6.0.0", "docopt"] +qa = ["flake8==3.8.3", "mypy==0.782"] + +[tool.setuptools] +include-package-data = true +platforms = ["any"] + +[tool.setuptools.packages.find] +exclude = [ + "test", + "test.*", +] +namespaces = false + +[tool.setuptools.package-data] +parso = [ + "python/grammar*.txt", + "py.typed", + "*.pyi", + "**/*.pyi", +] + +[tool.setuptools.dynamic] +readme = {file = ["README.rst", "CHANGELOG.rst"]} + [tool.setuptools_scm] + +[tool.distutils.bdist_wheel] +universal = 1 + +[tool.flake8] +max-line-length = "100" +ignore = """ +E722, +E226, +W503,""" + +[tool.mypy] +disallow_subclassing_any = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_return_any = true +warn_unused_configs = true +warn_unreachable = true +strict_equality = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d82ccb14..00000000 --- a/setup.cfg +++ /dev/null @@ -1,74 +0,0 @@ -[metadata] -name = parso -author = David Halter -author_email = davidhalter88@gmail.com -maintainer = David Halter -maintainer_email = davidhalter88@gmail.com -license = MIT -description = A Python Parser -long_description = file: README.rst, CHANGELOG.rst -keywords = python, parser, parsing -url = https://github.com/davidhalter/parso -classifiers = - Development Status :: 4 - Beta - Environment :: Plugins - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Topic :: Software Development :: Libraries :: Python Modules - Topic :: Text Editors :: Integrated Development Environments (IDE) - Topic :: Utilities - Typing :: Typed -platforms = any - -[options] -packages = find: -include_package_data = True -python_requires = >=3.6 - -[options.packages.find] -exclude = - test - test.* - -[options.extras_require] -testing = pytest<6.0.0; docopt -qa = flake8==3.8.3; mypy==0.782 - -[options.package_data] -parso = - python/grammar*.txt - py.typed - *.pyi - **/*.pyi - -[bdist_wheel] -universal=1 - -[flake8] -max-line-length = 100 -ignore = - # do not use bare 'except' - E722, - # don't know why this was ever even an option, 1+1 should be possible. - E226, - # line break before binary operator - W503, - - -[mypy] -disallow_subclassing_any = True - -# Avoid creating future gotchas emerging from bad typing -warn_redundant_casts = True -warn_unused_ignores = True -warn_return_any = True -warn_unused_configs = True -warn_unreachable = True - -strict_equality = True