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: 1a1397a4
Choose a base ref
...
head repository: abravalheri/setuptools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a986086
Choose a head ref
  • 7 commits
  • 4 files changed
  • 1 contributor

Commits on Jan 24, 2022

  1. Use run_setup to obtain a dist object in build_meta

    The `run_setup` function from `distutils.core` allows retrieving the
    distribution object before the configuration is read.
    
    This is very useful from the build backend perspective, since will allow
    the direct manipulation of this object instead of just running the
    `setup.py` script.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    f6f4c86 View commit details
    Browse the repository at this point in the history
  2. Use the distribution object to run commands in build_meta

    Once we have access to the distribution object, it is no longer
    necessary to fully run the setup script.
    Instead the backend can have more control over the process.
    
    This change build on top of the `_get_dist` function and the
    `distutils.core.run_commands` to trigger commands on the distribution
    object.
    
    For the legacy backend the setup script still runs traditionally
    (but the corner cases are handled directly by `distutils.core.run_setup`)
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    cb4829e View commit details
    Browse the repository at this point in the history
  3. Replace _get_build_requires by using the dist object

    Now that the dist object is available for the backend, we can simplify
    the workarounds to obtain the `setup_requires` (just reading the
    equivalent attribute in the dist object should suffice)
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    4223ca9 View commit details
    Browse the repository at this point in the history
  4. Add some entry-points to the bootstrap

    These entry-points seem to be required for the using the dist object
    directly on the build_meta:
    
    - dist_info
    - developt
    - install_scripts
    - install_egg_info
    - bdist_egg
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    bd50f4d View commit details
    Browse the repository at this point in the history
  5. Make sure changes in build_meta are compatible with tests

    After the changes in build_meta some changes with the checks and
    tests are required.
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    3ddcf05 View commit details
    Browse the repository at this point in the history
  6. Make script_name on build_meta less error prone

    `distutils.sdist:sdist._add_defaults_standards` will try to add `script_name`
    to the list of files to include in the distribution.
    
    If the SETUP_SCRIPT does not exist, the best is to use some made-up name
    that is unlikely to exist as a file.
    
    If we use `sys.argv[0]` setuptools might try to add things like
    `.tox/python/bin/pytest` to the tar.gz (and this will result in an error)
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    667ad4b View commit details
    Browse the repository at this point in the history
  7. Update build_meta to use dist objects instead of simply running setup.py

    (Merge branch 'use-dist-object-in-built-meta' into support-pyproject)
    
    We can rely on `distutils.core.run_setup` to get access to the
    distribution object while also postponing the execution of the build
    commands.
    
    This allows directly manipulation of the distribution object (which is
    for example useful to add configurations from different files such as
    `pyproject.toml`) as well as introspecting it for metadata (such as
    `setup_requires`).
    abravalheri committed Jan 24, 2022
    Configuration menu
    Copy the full SHA
    4a98608 View commit details
    Browse the repository at this point in the history
Loading