Skip to content
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

Validate Requires-Python metadata against the "mindeps" build in CI config #809

Merged
merged 6 commits into from
Oct 4, 2023

Commits on Aug 22, 2023

  1. Add a script to get Requires-Python metadata

    This does a temporary sdist build and extracts the result in order to
    get the (singular) '>=' lower bound.
    
    If the expectations of the script are violated, an error is raised.
    
    The approach is to be "slow but robust" here. We could simply parse
    `setup.cfg`, but that makes the toolchain sensitive to changes in
    packaging tooling. The PKG-INFO data should be reliable in all cases.
    sirosen committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    c5b0d1a View commit details
    Browse the repository at this point in the history
  2. Add a check that mindeps CI tests Requires-Python

    This check requires a YAML parser to pull the github workflow data
    and crawl to the correct node.
    Once there, the check will assert that the version in the CI build
    *exactly* matches the lower bound in `Requires-Python`.
    
    This leverages the `get_python_requires.py` script to extract the
    requirements dir.
    sirosen committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    cab7711 View commit details
    Browse the repository at this point in the history
  3. Put the 'get_python_requires' venv cache in .tox/

    Allow passing a cache directory explicitly to
    `get_python_requires.py`. Subsequently, the wrapping script,
    `ensure_min_python_is_tested.py` can insist on an env var which
    provides the cache dir path.
    Finally, `tox.ini` gets a final tweak to set this value via setenv to
    the `envdir` (the virtualenv dir which also contains the tmp and log
    dirs).
    
    The choice of an env var over parsing an argument is merely that it is
    marginally simpler to read an env var and fail on its absence than it
    is to do the same with an argument. (At the very least, *any* argument
    parsing opens the question of whether or not argparse should be used.)
    sirosen committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    d6c2b2a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    56485c9 View commit details
    Browse the repository at this point in the history
  5. Replace get_python_requires.py with 'mddj'

    mddj is a public packaged version of the same functionality (in Alpha).
    
    Pulling it out of this repo lets us rely on it without having to
    carry the maintenance burden in globus-sdk of all of the relevant logic.
    sirosen committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    becf3f0 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. ensure_min_python_is_tested checks tox versions

    This uses a new feature of `mddj` to read the tox factor list and
    confirm that the minimum version declared in our requires-python data
    is also synchronized with our tox.ini
    sirosen committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    b113409 View commit details
    Browse the repository at this point in the history