-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support pyproject.toml-style configuration (PEP 621) - Round 2 #2970
Commits on Mar 5, 2022
-
Rename
config
toconfig.setupcfg
This will facilitate the implementation of other configuration formats (such as pyproject.toml as initially defined by PEP 621)
1Configuration menu - View commit details
-
Copy full SHA for 49b7a60 - Browse repository at this point
Copy the full SHA 49b7a60View commit details -
Extract post-processing functions from config
We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated list of keywords into an actual Python list of strings). 2. The expansion (or post-processing) of these values according to the semantics ``setuptools`` assign to them (for example a configuration field with the ``file:`` directive should be expanded from a list of file paths to a single string with the contents of those files concatenated) The idea of this change is to extract the functions responsible for (2.) into a new module, so they can be reused between different config file formats.
Configuration menu - View commit details
-
Copy full SHA for f866876 - Browse repository at this point
Copy the full SHA f866876View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d9ecc0 - Browse repository at this point
Copy the full SHA 7d9ecc0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8330040 - Browse repository at this point
Copy the full SHA 8330040View commit details -
Configuration menu - View commit details
-
Copy full SHA for a148c33 - Browse repository at this point
Copy the full SHA a148c33View commit details -
Configuration menu - View commit details
-
Copy full SHA for d96e8bf - Browse repository at this point
Copy the full SHA d96e8bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61a416b - Browse repository at this point
Copy the full SHA 61a416bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ec2071a - Browse repository at this point
Copy the full SHA ec2071aView commit details -
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Configuration menu - View commit details
-
Copy full SHA for 25612c5 - Browse repository at this point
Copy the full SHA 25612c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81c3faa - Browse repository at this point
Copy the full SHA 81c3faaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82779f9 - Browse repository at this point
Copy the full SHA 82779f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5d2bc8 - Browse repository at this point
Copy the full SHA e5d2bc8View commit details -
Add
tomli
as vendorised dependencyThis eventually will allow reading project metadata directly from `pyproject.toml`
Configuration menu - View commit details
-
Copy full SHA for 099ac60 - Browse repository at this point
Copy the full SHA 099ac60View commit details -
Add
validate-pyproject
as a vendored dependencyIn order to minimise dependencies, `validate-pyproject` has the ability to "dump" only the code necessary to run the validations to a given directory. This special strategy is used instead of the default `pip install -t`. The idea of using JSONSchema for validation was suggested in pypa#2671, and the rationale for that approach is further discussed in https://github.com/abravalheri/validate-pyproject/blob/main/docs/faq.rst Using a library such as `validate-pyproject` has the advantage of incentive sing reuse and collaboration with other projects. Currently `validate-pyproject` ships a JSONSchema for the proposed use of `pyproject.toml` as means of configuration for setuptools. In the future, if there is interest, setuptools could also ship its own schema and just use the shared infrastructure of `validate-pyproject` (by advertising the schemas via entry-points).
Configuration menu - View commit details
-
Copy full SHA for 771488d - Browse repository at this point
Copy the full SHA 771488dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78dc278 - Browse repository at this point
Copy the full SHA 78dc278View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7371508 - Browse repository at this point
Copy the full SHA 7371508View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccd2f07 - Browse repository at this point
Copy the full SHA ccd2f07View commit details -
Update vendored tomli to 2.0.1
Enforcing local imports is no longer needed.
Configuration menu - View commit details
-
Copy full SHA for e0d61d4 - Browse repository at this point
Copy the full SHA e0d61d4View commit details -
Improve custom vendoring logic for validate-pyproject
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Configuration menu - View commit details
-
Copy full SHA for 74c7341 - Browse repository at this point
Copy the full SHA 74c7341View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2f07dc - Browse repository at this point
Copy the full SHA e2f07dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f68bb4 - Browse repository at this point
Copy the full SHA 7f68bb4View commit details -
Implement read_configuration from pyproject.toml
This is the first step towards making setuptools understand `pyproject.toml` as a configuration file. The implementation deliberately allows splitting the act of loading the configuration from a file in 2 stages: the reading of the file itself and the expansion of directives (and other derived information).
Configuration menu - View commit details
-
Copy full SHA for af187e8 - Browse repository at this point
Copy the full SHA af187e8View commit details -
Expand dynamic entry_points from pyproject.toml
The user might specify dynamic `entry-points` via a `file:` directive (a similar feature for `setup.cfg` is documented in [declarative config]). The changes introduced here add the ability to expand them when reading the configuration from `pyproject.toml`. [declarative config]: https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
Configuration menu - View commit details
-
Copy full SHA for 8826dc1 - Browse repository at this point
Copy the full SHA 8826dc1View commit details -
Make include_package_data=True for
pyproject.toml
configsThere is frequent an opinion in the community that `include_package_data=True` is a better default (and a quality of life improvement). Since we are migrating to a new configuration file, this change can be implemented in a backward compatible way (to avoid breaking existing packages): - Config from `setup.cfg` defaults to `include_package_data=False` - Config from `pyproject.toml` defaults to `include_package_data=True` This also takes advantage that `ini2toml` (the provided library for automatic conversion between `setup.cfg` and `pyproject.toml`) will backfill `include_package_data=False` when the field is missing.
Configuration menu - View commit details
-
Copy full SHA for a8112d9 - Browse repository at this point
Copy the full SHA a8112d9View commit details -
Add means of applying config read from pyproject.toml to dist
Since the Distrubition and DistributionMetadata classes are modeled after (an old version of) core metadata, it is necessary to add a translation layer between them and the configuration read from pyproject.toml
Configuration menu - View commit details
-
Copy full SHA for 9672a48 - Browse repository at this point
Copy the full SHA 9672a48View commit details -
Add the apply_configuration API to setuptools.config.setupcfg
The apply_configuration is implemented in a way that it is consistent for both pyproject.toml and setup.cfg
Configuration menu - View commit details
-
Copy full SHA for d7363d5 - Browse repository at this point
Copy the full SHA d7363d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26a9264 - Browse repository at this point
Copy the full SHA 26a9264View commit details -
Fix pyproject config when tool table is not present
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 051b825 - Browse repository at this point
Copy the full SHA 051b825View commit details -
Configuration menu - View commit details
-
Copy full SHA for c927227 - Browse repository at this point
Copy the full SHA c927227View commit details -
Configuration menu - View commit details
-
Copy full SHA for 905eed7 - Browse repository at this point
Copy the full SHA 905eed7View commit details -
Prevent resource warnings in test_apply_pyprojecttoml
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Configuration menu - View commit details
-
Copy full SHA for b426b2b - Browse repository at this point
Copy the full SHA b426b2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e91969a - Browse repository at this point
Copy the full SHA e91969aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ee2697 - Browse repository at this point
Copy the full SHA 9ee2697View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5c5519 - Browse repository at this point
Copy the full SHA e5c5519View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d4457e - Browse repository at this point
Copy the full SHA 5d4457eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf32acb - Browse repository at this point
Copy the full SHA cf32acbView commit details -
Back-fill Description-Content-Type according to readme suffix
According to PEP 621, the backend should fill-in the content-type if the `readme` field is passed as a string. The value is derived from the extension of the file (an error should be raised when that is not possible). Previously all READMEs were wrongly assumed rst. This error was reported in: https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/4
Configuration menu - View commit details
-
Copy full SHA for a4b474e - Browse repository at this point
Copy the full SHA a4b474eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0497954 - Browse repository at this point
Copy the full SHA 0497954View commit details -
Configuration menu - View commit details
-
Copy full SHA for d385330 - Browse repository at this point
Copy the full SHA d385330View commit details -
Add deprecation notice for config.{read,parse}_configuration
Since now setuptools supports 2 types of files for configuration (`setup.cfg` and `pyproject.toml`), it is very trick to provide a single `read_configuration` function that will provide compatible outputs for both formats. Instead the `config.{setupcfg,pyprojecttoml}` modules have their own `read_configuration` functions that differ between themselves in terms of arguments and format of the return value. Therefore the users should be importing directly the specific submodule and calling the read function from there. The `config.setupcfg` submodule is advertised as "provisional" in the deprecation note because the main proposal debated in the setuptools issue tracker reached some level of consensus around deprecating `setup.cfg` files.
Configuration menu - View commit details
-
Copy full SHA for dea4be5 - Browse repository at this point
Copy the full SHA dea4be5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b333e9 - Browse repository at this point
Copy the full SHA 2b333e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09f784f - Browse repository at this point
Copy the full SHA 09f784fView commit details -
Replace skip in editable install test with xfail
… as suggested in code review
Configuration menu - View commit details
-
Copy full SHA for 9e8e3d3 - Browse repository at this point
Copy the full SHA 9e8e3d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for aab5899 - Browse repository at this point
Copy the full SHA aab5899View commit details -
Ensure build_meta don't have problems with instructions after setup()
This is a regression test for a problem identified in: pypa#2970 (comment)
Configuration menu - View commit details
-
Copy full SHA for c9cf0da - Browse repository at this point
Copy the full SHA c9cf0daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 98c8edb - Browse repository at this point
Copy the full SHA 98c8edbView commit details -
Test static metadata in pyproject.toml is not overwritten by setup.py
These tests were initially motivated by a discussion in: pybind/pybind11#3711 (comment)
Configuration menu - View commit details
-
Copy full SHA for 86e6a10 - Browse repository at this point
Copy the full SHA 86e6a10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 854969d - Browse repository at this point
Copy the full SHA 854969dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9c1a32 - Browse repository at this point
Copy the full SHA e9c1a32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cc7478 - Browse repository at this point
Copy the full SHA 0cc7478View commit details -
Configuration menu - View commit details
-
Copy full SHA for 298e745 - Browse repository at this point
Copy the full SHA 298e745View commit details -
Separate setup.cfg parsing and extract common post-processing functio…
…ns (pypa#3065) We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated list of keywords into an actual Python list of strings). 2. The expansion (or post-processing) of these values according to the semantics setuptools assign to them (for example a configuration field with the file: directive should be expanded from a list of file paths to a single string with the contents of those files concatenated) The idea of this change is to extract the functions responsible for (2.) into a new module, so they can be reused between different config file formats.
Configuration menu - View commit details
-
Copy full SHA for b44c648 - Browse repository at this point
Copy the full SHA b44c648View commit details -
Add vendored deps: tomli and validate-pyproject (pypa#3066)
Some extra dependencies can be used to support ``pyproject.toml`` configuration. This change just adds them as vendored packages.
Configuration menu - View commit details
-
Copy full SHA for 088d467 - Browse repository at this point
Copy the full SHA 088d467View commit details -
Add means to apply configuration from pyproject.toml (pypa#3067)
This change targets adding a standardised project configuration format as initially proposed by PEP 621 (with the possibility of modification/evolution according to follow-up PEPs). For the configuration fields not covered by the standards, the approach proposed in [ini2toml] is adopted. This operation relies on vendorised external libraries `tomli` and `validate-pyproject`. [ini2toml]: https://ini2toml.readthedocs.io/en/latest/setuptools_pep621.html
Configuration menu - View commit details
-
Copy full SHA for 2cfcf0e - Browse repository at this point
Copy the full SHA 2cfcf0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96adc4f - Browse repository at this point
Copy the full SHA 96adc4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bb0021 - Browse repository at this point
Copy the full SHA 1bb0021View commit details -
Configuration menu - View commit details
-
Copy full SHA for 441a1fa - Browse repository at this point
Copy the full SHA 441a1faView commit details -
Configuration menu - View commit details
-
Copy full SHA for d3e62b1 - Browse repository at this point
Copy the full SHA d3e62b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54f6180 - Browse repository at this point
Copy the full SHA 54f6180View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c334b3 - Browse repository at this point
Copy the full SHA 5c334b3View commit details -
Integrate pyproject.toml configuration into existing classes (pypa#3068)
This change builds on top of the recently added ability to parse and apply configurations from TOML files to distribution objects by tapping into the existing mechanism for handling configuration and making these TOML files to be read by default. A series of deprecation warnings and tests is also added.
Configuration menu - View commit details
-
Copy full SHA for f54e2d9 - Browse repository at this point
Copy the full SHA f54e2d9View commit details -
Add some type hints to the setuptools.config subpackage (pypa#3069)
Type hints can help to increase confidence in the code and prevent unexpected bugs. To typecheck the subpackage the following command can be used: ``` mypy setuptools/config --tb --show-error-codes --show-error-context --pretty ```
Configuration menu - View commit details
-
Copy full SHA for dd75299 - Browse repository at this point
Copy the full SHA dd75299View commit details -
Adopt namespaces by default when discovering packages (pypa#3125)
The adoption of configuration via pyprojec.toml is a perfect opportunity to consider namespaces by default (PEP 420) when automatically finding projects. In projects using `setup.cfg` or `setup.py` nothing will be changed for backward compatibility, but for projects including metadata in `pyproject.toml` (as initially proposed in PEP 621), namespaces will be considered by default.
Configuration menu - View commit details
-
Copy full SHA for 64386ba - Browse repository at this point
Copy the full SHA 64386baView commit details