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: 1.1.0
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: 1.2.0
Choose a head ref
  • 20 commits
  • 81 files changed
  • 12 contributors

Commits on Jan 14, 2025

  1. docs: Add horizontal spacers around filenames in custom toolchain gui…

    …de (#2563)
    
    This improves readability by clearly marking the beginnings and ends of
    the three involved source files.
    
    Follow-up of #2512, as discussed.
    nicholasjng authored Jan 14, 2025
    Configuration menu
    Copy the full SHA
    c0bd668 View commit details
    Browse the repository at this point in the history
  2. fix: Avoid creating URLs with empty path segments from index URLs in …

    …environment variables (#2557)
    
    This change updates `_read_simpleapi` such that it correctly handles the
    case where the index URL is specified in an environment variable and
    contains a trailing slash. The URL construction would have introduced an
    empty path segment, which is now removed.
    
    Fixes: #2554
    
    ---------
    
    Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
    WillMorrison and aignas authored Jan 14, 2025
    Configuration menu
    Copy the full SHA
    eef839b View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2025

  1. docs: update gazelle README.md (#2567)

    There's no longer a python subprocess since switching to tree-sitter in
    #1895
    alexeagle authored Jan 17, 2025
    Configuration menu
    Copy the full SHA
    f219112 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2025

  1. fix: Don't fail in override from a non-root module (#2566)

    This patch enable calls to pypi override from a non-root module without
    failing. The call will instead be silently ignored.
    
    Fixes #2550
    
    ---------
    
    Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
    mailto-jonas and aignas authored Jan 21, 2025
    Configuration menu
    Copy the full SHA
    50a9a2e View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2025

  1. chore: remove internal usage of deprecated py_binary ad py_test (#2569)

    This goes together with #2565 to remove the internal usage of the
    deprecated
    symbols. This also fixes the compile_pip_requirements symbol to print
    the
    correct deprecation message.
    
    Builds on top of 611eda8
    
    The example message that would be printed is as follows:
    ```
    The 'py_test' symbol in '@+python+python_3_11//:defs.bzl'
    is deprecated. It is an alias to the regular rule; use it directly instead:
    
    load("@rules_python//python:py_test.bzl", "py_test")
    
    py_test(
        name = "versioned_py_test",
        srcs = ["dummy.py"],
        main = "dummy.py",
        python_version = "3.11.11",
    )
    ```
    
    ---------
    
    Co-authored-by: Richard Levasseur <richardlev@gmail.com>
    aignas and rickeylev authored Jan 22, 2025
    Configuration menu
    Copy the full SHA
    188598a View commit details
    Browse the repository at this point in the history
  2. fix: Fix encoding of runfiles manifest and repository mapping files. (#…

    …2568)
    
    See
    bazelbuild/bazel#374 (comment):
    
    > all output files produced by Bazel should use UTF-8 and \n line
    endings on
    > all platforms, including Windows.
    
    Previously this would use the legacy ANSI codepage on Windows.
    phst authored Jan 22, 2025
    Configuration menu
    Copy the full SHA
    626b03a View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2025

  1. fix: make coverage work with bootstrap=script (#2574)

    The script based bootstrap wasn't expanding the coverage template
    variable, which prevented
    coverage from activating. This was introduced when it was switched to
    the venv layout.
    
    To fix, expand the `%coverage_tool%` template variable as done
    elsewhere.
    
    Tested manually, per repro instructions in #2572. While I did devise a
    way to mostly
    test this without an integration test, it was thwarted by some other
    bugs.
    
    Along the way, improve some of the bootstrap debug output and fix a
    comment.
    
    Fixes #2572
    rickeylev authored Jan 23, 2025
    Configuration menu
    Copy the full SHA
    ea716fe View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2025

  1. doc: point users to our CHANGELOG at the top of the release note (#2582)

    This is so that we can start pointing users at a more helpful changelog
    that
    has announcements about deprecations, etc.
    aignas authored Jan 25, 2025
    Configuration menu
    Copy the full SHA
    4de99ab View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2025

  1. fix: Enable location expansion for sh_py_run_test (#2583)

    I noticed that my `$(location //path/to:target)` wasn't getting
    expanded when writing a test. This patch fixes the issue by forwarding
    the already-expanded environment from the inner target to the outer
    target.
    philsc authored Jan 26, 2025
    Configuration menu
    Copy the full SHA
    80aab4a View commit details
    Browse the repository at this point in the history
  2. fix(sphinxdocs): do not crash when tag_class does not have doc (#2585)

    It seems that there was a typo in the code and instead of calling
    `self._write` we were calling `self.write`. It went unnoticed because of
    lack of coverage. This adds test code exercising the edge case and fixes
    the typo.
    
    Fixes #2579
    aignas authored Jan 26, 2025
    Configuration menu
    Copy the full SHA
    0475c9e View commit details
    Browse the repository at this point in the history
  3. refactor(uv): move around uv implementation files (#2580)

    This PR starts establishing a structure that will eventually become a
    part of our API. This is a prerequisite for #2578 which removes the
    versions.bzl file in favour of a more dynamic configuration of the
    extension. We also remove the `defs.bzl` to establish a one symbol per
    file convention.
    
    Things that I wish we could change is `//python/uv:extensions.bzl` and
    the fact that we have `extensions` in the load path. I think it cannot
    be removed, because that may break the BCR test. On the other hand,
    maybe we could remove it and do an alpha release to verify this
    assumption.
    
    Work towards #1975
    aignas authored Jan 26, 2025
    Configuration menu
    Copy the full SHA
    18f76f9 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2025

  1. revert: Updated pip and packaging versions to work with free-threadin…

    …g packages (#2514) (#2584)
    
    This reverts commit fbf8bc1 (#2514)
    
    Also, update the CHANGELOG about the reverting.
    
    Fixes #908, which is about the `pip-compile` not using the right files
    for performing the locking. It seems that the `pip` upgrade regressed
    this error.
    aignas authored Jan 28, 2025
    Configuration menu
    Copy the full SHA
    309ee59 View commit details
    Browse the repository at this point in the history
  2. docs: using python_version attribute for specifying python version (#…

    …2589)
    
    Updates examples and docs to tell to use the base rules and the
    python_version attribute
    instead of the wrapper transition rules.
    JeroenSchmidt authored Jan 28, 2025
    Configuration menu
    Copy the full SHA
    466da1d View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2025

  1. fix: make plain zipapp work with bootstrap=script (#2598)

    The `__main__.py` template (zip_main_template.py) was using the wrong
    path when creating
    the interpreter symlinks. It as computing it correctly, just the wrong
    variable was used
    in the symlink() call.
    
    To fix, pass the correct variable.
    
    Also adds a test to check that it's runnable.
    
    Fixes #2596
    rickeylev authored Feb 2, 2025
    Configuration menu
    Copy the full SHA
    33cb431 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2025

  1. fix: add flag to use runtime venv creation when using bootstrap=script (

    #2590)
    
    The bootstrap=script implementation was changed to use declare_symlink()
    to create explicit
    symlinks so its venv works. Unfortunately, this broke packaging rules,
    which would treat
    the symlinks as regular files.
    
    To fix, introduce a flag that stops using declare_symlink() and instead
    creates the venv
    at runtime. Creating a venv at runtime is problematic for various
    reasons, but this should
    work well enough until packaging rules are able to handle these raw
    symlinks.
    
    The location of the venv can be somewhat controlled by setting the
    `RULES_PYTHON_VENVS_ROOT`
    environment variable. This is to better accommodate cases where using
    /tmp is problematic.
    
    Along the way, sort the environment variable docs by their name.
    
    Fixes #2489
    rickeylev authored Feb 3, 2025
    Configuration menu
    Copy the full SHA
    2e6f8ad View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2025

  1. docs: Update URL in gazelle example (#2602)

    The location of gazelle has changed to bazel-contrib, so update the
    example accordingly.
    hofbi authored Feb 4, 2025
    Configuration menu
    Copy the full SHA
    428c1bb View commit details
    Browse the repository at this point in the history
  2. refactor: expose base rule construction via builders to allow customi…

    …zation for testing (#2600)
    
    The py_reconfig rules work by wrapping: The outer reconfig rule applies
    a transition, depends
    on an inner py base rule, then jumps through various hoops to ensure it
    looks and acts
    like the target it's wrapping.
    
    This is error prone, incomplete, and annoying code to maintain. Phil
    recently discovered it wasn't properly propagating the output group, so
    he had to add that. I wasted time trying to fix a bug I _thought_ was in
    it, but actually was working correctly. The logic within it is a bit
    hacky as it tries to emulate some of the platform-specific stuff for
    windows. Every time
    py_reconfig gains something to transition on, there's numerous places to
    define, propagate,
    and extract the pieces necessary to do it.
    
    To fix this, make the py_reconfig rules not wrap an inner base py rule.
    Instead, they use the same underlying rule args that the base rules do.
    This lets them act directly as the rule they're designed to test.
    
    Customization is done by capturing all the rule args in builder objects.
    The py_reconfig code constructs the same builder the base rules do, then
    modifies it as necessary (adding attributes, wrapping the base
    transition function). As a bonus, this sets some ground work to allow
    more easily defining derivative rules without having to copy/paste
    arbitrary parts of how the base rules are defined.
    
    Work towards #1647
    rickeylev authored Feb 4, 2025
    Configuration menu
    Copy the full SHA
    81c6798 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2025

  1. feat: Remove and redirect py_proto_library to protobuf (#2604)

    Protobuf team is taking ownership of `py_proto_library` and the
    implementation was moved to protobuf repository.
    
    Remove py_proto_library from rules_python, to prevent divergent
    implementations.
    
    Make a redirect with a deprecation warning, so that this doesn't break
    any users.
    
    Previously this was attempted in:
    d0e25cf
    
    
    Work towards #2173,
    #2543
    comius authored Feb 11, 2025
    Configuration menu
    Copy the full SHA
    edfb4b3 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2025

  1. chore: updates for 1.2.0 release (#2611)

    Update changelog and VERSION_NEXT markers
    rickeylev authored Feb 14, 2025
    Configuration menu
    Copy the full SHA
    ae361c2 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2025

  1. refactor: cleanup now-unreferenced proto toolchain type (#2620)

    Follow-up to #2604, fixes a breaking change in v1.2.0-rc0
    
    Note that this toolchain_type became unused in that PR. We leave behind
    an alias to make this a non-breaking change.
    
    Verified in a downstream repo that requires the toolchain_type to
    register pre-built `protoc`:
    https://github.com/aspect-build/toolchains_protoc/pull/50/files
    
    ---------
    
    Co-authored-by: Richard Levasseur <rlevasseur@google.com>
    (cherry picked from commit f9779ee)
    alexeagle and rickeylev committed Feb 22, 2025
    Configuration menu
    Copy the full SHA
    2ad2002 View commit details
    Browse the repository at this point in the history
Loading