-
-
Notifications
You must be signed in to change notification settings - Fork 290
Improve packaging [PEP 517 + 621] #1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
057ddb0
Use isolated build environments
cdce8p 58bd603
Use new project metadata format [PEP 621]
cdce8p 65ca53b
Move remaining flake8 config to setup.cfg
cdce8p 37a6874
Remove setup.py
cdce8p f656c06
Update pre-commit config
cdce8p e8f88c3
Revert "Remove setup.py"
cdce8p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
prune .github | ||
prune doc | ||
prune tests | ||
exclude .* | ||
exclude ChangeLog | ||
exclude pylintrc | ||
exclude README.rst | ||
exclude requirements_*.txt | ||
exclude tox.ini | ||
include README.rst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[build-system] | ||
requires = ["setuptools~=62.6", "wheel~=0.37.1"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "astroid" | ||
license = {text = "LGPL-2.1-or-later"} | ||
description = "An abstract syntax tree for Python with inference support." | ||
readme = "README.rst" | ||
authors = [ | ||
{name = "Python Code Quality Authority", email = "[email protected]"} | ||
] | ||
keywords = ["static code analysis", "python", "abstract syntax tree"] | ||
classifiers = [ | ||
"Development Status :: 6 - Mature", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"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", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Software Development :: Quality Assurance", | ||
"Topic :: Software Development :: Testing", | ||
] | ||
requires-python = ">=3.7.2" | ||
dependencies = [ | ||
"lazy_object_proxy>=1.4.0", | ||
"wrapt>=1.11,<2", | ||
"typed-ast>=1.4.0,<2.0;implementation_name=='cpython' and python_version<'3.8'", | ||
"typing-extensions>=3.10;python_version<'3.10'", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
"Docs" = "https://pylint.pycqa.org/projects/astroid/en/latest/" | ||
"Source Code" = "https://github.com/PyCQA/astroid" | ||
"Bug tracker" = "https://github.com/PyCQA/astroid/issues" | ||
"Discord server" = "https://discord.gg/Egy6P8AMB5" | ||
|
||
[tool.setuptools] | ||
license-files = ["LICENSE", "CONTRIBUTORS.txt"] # Keep in sync with setup.cfg | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["astroid*"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "astroid.__pkginfo__.__version__"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,12 @@ | ||
# Setuptools v62.6 doesn't support editable installs with just 'pyproject.toml' (PEP 660). | ||
# Keep this file until it does! | ||
|
||
[metadata] | ||
name = astroid | ||
description = An abstract syntax tree for Python with inference support. | ||
version = attr: astroid.__pkginfo__.__version__ | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
url = https://github.com/PyCQA/astroid | ||
author = Python Code Quality Authority | ||
author_email = [email protected] | ||
license = LGPL-2.1-or-later | ||
# wheel doesn't yet read license_files from pyproject.toml - tools.setuptools | ||
# Keep it here until it does! | ||
license_files = | ||
LICENSE | ||
CONTRIBUTORS.txt | ||
classifiers = | ||
Development Status :: 6 - Mature | ||
Environment :: Console | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2) | ||
Operating System :: OS Independent | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
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 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Programming Language :: Python :: Implementation :: PyPy | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Topic :: Software Development :: Quality Assurance | ||
Topic :: Software Development :: Testing | ||
keywords = static code analysis,python,abstract syntax tree | ||
project_urls = | ||
Bug tracker = https://github.com/PyCQA/astroid/issues | ||
Discord server = https://discord.gg/Egy6P8AMB5 | ||
|
||
[options] | ||
packages = find: | ||
install_requires = | ||
lazy_object_proxy>=1.4.0 | ||
wrapt>=1.11,<2 | ||
typed-ast>=1.4.0,<2.0;implementation_name=="cpython" and python_version<"3.8" | ||
typing-extensions>=3.10;python_version<"3.10" | ||
python_requires = >=3.7.2 | ||
|
||
[options.packages.find] | ||
include = | ||
astroid* | ||
|
||
[aliases] | ||
test = pytest | ||
|
@@ -63,6 +24,14 @@ known_first_party = astroid | |
include_trailing_comma = True | ||
skip_glob = tests/testdata | ||
|
||
[flake8] | ||
cdce8p marked this conversation as resolved.
Show resolved
Hide resolved
|
||
extend-ignore = E203,E266,E501,C901,F401 | ||
max-complexity = 20 | ||
select = B,C,E,F,W,T4,B9 | ||
# Required for flake8-typing-imports (v1.12.0) | ||
# The plugin doesn't yet read the value from pyproject.toml | ||
min_python_version = 3.7.2 | ||
|
||
[mypy] | ||
scripts_are_modules = True | ||
no_implicit_optional = True | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Keep file until dependabot issue is resolved | ||
# https://github.com/dependabot/dependabot-core/issues/4483 | ||
|
||
from setuptools import setup | ||
|
||
setup() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add
3.11
as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm nice catch, I think we forgot to add it in #1584
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support all
3.11
features yet. Especially support forTryStar
is still missing. Tracking issue #1516I should probably continue the work on #1389 soon. With that
TryStar
should be fairly strait forward.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add the 3.11 metadata before supporting all 3.11 features, because we're supporting all the old features and if we don't do that, then there's no astroid at all for 3.11 which is a lot worse than having astroid without some 3.11 exclusive features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't block anyone from installing astroid with Python 3.11.
However, the way I understand the classifier is "All of the features (or at least the major ones) for version x.xx are supported." That's why I would recommend to wait a bit longer before adding it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm right, my bad, pip is using
install_require
not the metadata.