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: bazel-contrib/rules_python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: bazel-contrib/rules_python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: release/1.4
Choose a head ref
  • 11 commits
  • 53 files changed
  • 3 contributors

Commits on Apr 20, 2025

  1. fix: load target_platforms through the hub (#2781)

    This PR moves the parsing of `Requires-Dist` to the loading phase
    within the `whl_library_targets_from_requires` macro. The original
    `whl_library_targets` macro has been left unchanged so that I don't have
    to reinvent the unit tests - it is well covered under tests.
    
    Before this PR we had to wire the `target_platforms` via the
    `experimental_target_platforms` attr in the `whl_library`, which means
    that whenever this would change (e.g. the minor Python version changes),
    the wheel would be re-extracted even though the final result may be the
    same.
    
    This refactor uncovered that the dependency graph creation was incorrect
    if we had multiple target Python versions due to various heuristics that
    this had. In hindsight I had them to make the generated `BUILD.bazel`
    files more readable when the unit test coverage was not great. Now this
    is unnecessary and since everything is happening in Starlark I thought
    that having a simpler algorithm that does the right thing always is the
    best way.
    
    This also cleans up the code by removing left over TODO notes or code
    that no longer make sense.
    
    Work towards #260, #2319
    
    (cherry picked from commit a19e1e4)
    aignas committed Apr 20, 2025
    Configuration menu
    Copy the full SHA
    079bea3 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2025

  1. fix: escape more invalid repo string characters (#2801)

    Also escape plus and percent when generating the repo name from the
    wheel version.
    Sometimes they have such characters in them.
    
    Fixes #2799
    
    Co-authored-by: Richard Levasseur <rlevasseur@google.com>
    (cherry picked from commit e14cd37)
    2 people authored and aignas committed Apr 22, 2025
    Configuration menu
    Copy the full SHA
    7dd901c View commit details
    Browse the repository at this point in the history
  2. fix: parsing metadata with inline licenses (#2806)

    The wheel `METADATA` parsing implemented in 1.4 missed the fact
    that whitespace is significant and sometimes License is included
    inline in the `METADATA` file itself.
    
    This change ensures that we stop parsing the `METADATA` file only
    on first completely empty line.
    
    Fixes #2796
    
    ---------
    
    Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
    (cherry picked from commit 1d69ad6)
    keith and aignas committed Apr 22, 2025
    Configuration menu
    Copy the full SHA
    f3fb481 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2025

  1. fix: use the python micro version to parse whl metadata in bzlmod (#2793

    )
    
    Add `<micro>` version to the target platform. Instead of `cpxy_os_cpu`
    the target platform string format becomes `cpxy.z_os_cpu`. This is a
    temporary measure until we get a better API for defining target
    platforms.
    
    Summary:
    - [x] test `select_whls` function needs to be tested to ensure that the
      whl selection is not impacted when we have the full version in the
      target platform.
    - [ ] `download_only` legacy whl code path in `bzlmod` needs further
      testing.
    - [x] test `whl_config_setting` handling and config setting creation.
      The config settings in the hub repo should not use the full version,
      because from the outside, the whl is compatible with all `micro`
      versions of a given `3.<minor_version>` of the Python interpreter.
      This means that the already documented config setting do not need to
      be changed.
    - [x] `pep508_deps` tests for handling the `full_python_version`
      correctly.
    - [x] `pep508_deps` tests for ensuring the `default_abi` is being
      handled correctly.
    
    Fixes #2319
    
    (cherry picked from commit 1e21dbd)
    aignas authored and rickeylev committed Apr 24, 2025
    Configuration menu
    Copy the full SHA
    be79b5e View commit details
    Browse the repository at this point in the history
  2. fix(pypi): call python --version before marker eval (#2819)

    `bzlmod` has the full python version information statically and we don't
    need to call Python to get its version, but for `WORKSPACE` that is not
    the case and we have to call it before evaluating the markers in
    universal requirements files.
    
    This also fixes transitions in the `compile_pip_requirements` macro
    where
    the `.update` target would not transition correctly based on the
    `python_version` parameter.
    
    Fixes #2818
    
    (cherry picked from commit ee34409)
    aignas authored and rickeylev committed Apr 24, 2025
    Configuration menu
    Copy the full SHA
    5605215 View commit details
    Browse the repository at this point in the history
  3. chore: remove a stray file (#2795)

    Remove a stray file
    
    (cherry picked from commit c981569)
    aignas authored and rickeylev committed Apr 24, 2025
    Configuration menu
    Copy the full SHA
    6a7ef8b View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2025

  1. revert(pypi): bring back Python PEP508 code with tests (#2831)

    This just adds the code back at the original state before the following
    PRs have been made to remove them: #2629, #2781. This has not been
    hooked up yet in `evaluate_markers` and `whl_library` yet and I'll need
    extra PRs to do that.
    
    No CHANGELOG entries for now, will be done once the integration is back.
    
    Work towards #2830
    
    (cherry picked from commit 61c91fe)
    aignas committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    3209c66 View commit details
    Browse the repository at this point in the history
  2. fix(pypi) backport python_full_version fix to Python (#2833)

    Handling of `python_full_version` correctly has been fixed in the
    Starlark
    implementation in #2793 and in this PR I am backporting the changes to
    handle
    the full python version target platform strings so that we can have the
    same
    behaviour for now.
    
    At the same time I have simplified and got rid of the specialization
    handling
    in the Python algorithm just like I did in the starlark, which
    simplifies the
    tests and makes the algorithm more correct.
    
    Summary:
    * Handle `cp3x.y_os_arch` strings in the `platform.py`
    * Produce correct strings when the `micro_version` is unset. Note, that
    we use version `0` in evaluating but we use the default version in the
    config setting. This is to keep compatibility with the current behaviour
    when the target platform is not fully specified (which would be the case
    for WORKSPACE users).
    * Adjust the tests and the code to be more similar to the starlark impl.
    
    Work towards #2830
    
    (cherry picked from commit 9e613d5)
    aignas committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    46ff357 View commit details
    Browse the repository at this point in the history
  3. revert(pypi): use Python for marker eval and METADATA parsing (#2834)

    Summary:
    - Revert to using Python for marker evaluation during parsing of
      requirements (partial revert of #2692).
    - Use Python to parse whl METADATA.
    - Bugfix the new simpler algorithm and add a new unit test.
    
    Fixes #2830
    
    (cherry picked from commit 5b9d545)
    aignas committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    4dc0665 View commit details
    Browse the repository at this point in the history
  4. fix(pypi): handle more URL patterns for requirement sources (#2843)

    Summary:
    - Better handle git references for sdists.
    - Better handle direct whl references.
    - Add an extra test that turned out to be not needed in the end, but I
      left it to increase the code coverage.
    
    Work towards #2363
    Fixes #2828
    
    (cherry picked from commit a79bbfa)
    aignas committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    f2b6747 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2025

  1. fix(pypi): fix a typo in parse_simpleapi_html (#2866)

    It seems that the integration tests that I thought were covering this
    had the same time. Added an assertion to the unit tests as well
    
    Fixes #2863.
    
    (cherry picked from commit 9dfa3ab)
    aignas authored and rickeylev committed May 8, 2025
    Configuration menu
    Copy the full SHA
    4f5a693 View commit details
    Browse the repository at this point in the history
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy