Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: abravalheri/setuptools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7fe7a419
Choose a base ref
...
head repository: abravalheri/setuptools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d34794d7
Choose a head ref
  • 15 commits
  • 30 files changed
  • 1 contributor

Commits on Jan 24, 2022

  1. Add tomli as vendorised dependency

    This eventually will allow reading project metadata directly from
    `pyproject.toml`
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    91a1152 View commit details
    Browse the repository at this point in the history
  2. Add validate-pyproject as a vendored dependency

    In 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).
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    4ac1f5f View commit details
    Browse the repository at this point in the history
  3. 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).
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    fab3b79 View commit details
    Browse the repository at this point in the history
  4. 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
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    5db4da0 View commit details
    Browse the repository at this point in the history
  5. Make include_package_data=True for pyproject.toml configs

    There 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.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    4500481 View commit details
    Browse the repository at this point in the history
  6. 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
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    7d72983 View commit details
    Browse the repository at this point in the history
  7. 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
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    e338615 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b0e3cf2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    51b9568 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    28efd4e View commit details
    Browse the repository at this point in the history
  11. Add means to apply configuration from pyprojec.toml

    (Merge branch 'dist-config-from-pyproject' into support-pyproject)
    
    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
    https://ini2toml.readthedocs.io/en/latest/setuptools_pep621.html
    is adopted.
    
    The external libraries `tomli` and `validate-pyproject` are vendorised
    to support this operation.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    5666556 View commit details
    Browse the repository at this point in the history
  12. 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.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    3da045e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e010ec4 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    5038561 View commit details
    Browse the repository at this point in the history
  15. Integrate pyproject.toml configuration into existing classes

    (Merge branch 'integration' into support-pyproject)
    
    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.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    d34794d View commit details
    Browse the repository at this point in the history
Loading