- Jul 24, 2025
-
-
Alex Tercete authored
We can't load a runfiles folder when `RUNFILES_MANIFEST_FILE` is set, as it won't be listed explicitly there.
-
- Jul 06, 2025
-
-
Tomer Shterenberg authored
-
Tomer Shterenberg authored
-
Tomer Shterenberg authored
-
- Jun 03, 2025
-
-
Matthew Clarkson authored
-
Matthew Clarkson authored
We can use the `TemporaryRedirectFile` class directly as it implements the `SupportsWriteFlush[str]` protocol.
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
When a `CSafeDumper` is not available, we fallback to `SafeDumper`. This correctly invokes the `__del__` function in the order that the garbage collector runs. It results in the following error: ``` Exception ignored in: <function Closer.__del__ at 0x7f9547c3b420> Traceback (most recent call last): File ".../pre-commit/config/cli.runfiles/_main/pre-commit/config/cli.py", line 175, in __del__ self.close() File ".../pre-commit/config/cli.runfiles/_main/pre-commit/config/cli.py", line 170, in close self.__file.flush() File ".../python3.13/tempfile.py", line 499, in func_wrapper return func(*args, **kwargs) ValueError: I/O operation on closed file. ``` This occurs because the `NamedTemporaryFile.__del__` runs before the `Closer.__del__`. The `NamedTemporaryFile.__del__` closes then, then deletes the file. Setting `delete=False` will not help. We move the `NamedTemporaryFile` into the `Closer` (renamed to `TemporaryRedirectFile`) to correct the closing order.
-
- May 16, 2025
-
-
Sebastian Birunt authored
All `pip.parse` extensions from `rules_python` should have `experimental_index_url` attribute for correct platform dependent packages checkout. See: https://github.com/bazel-contrib/rules_python/blob/main/docs/pypi-dependencies.md#bazel-downloader-and-multi-platform-wheel-hub-repository
-
Sebastian Birunt authored
Remove redundant `print()` call to `stdout`.
-
- May 12, 2025
-
-
Sebastian Birunt authored
Add `experimental_index_url` to fetch available wheel repos for needed platforms. This does not mean that rules_python is fetching the wheels eagerly, but it rather means that it is calling the PyPI server to get the Simple API response to get the list of all available source and wheel distributions.
-
- May 06, 2025
-
-
Sebastian Birunt authored
Having: ```py pip.parse( hub_name = "pre-commit-hook-{}".format(version), python_version = version, requirements_lock = "//pre-commit/hook/requirements:lock.txt", ), ``` and using `requirements_lock` attribute will create pip spoke whl repositories just for the host platform. This can have potential issues when the repository is platform dependent and the host platform is different of execution platform (common case for RBE build). The change sets pip requirements for different platforms separately. Specifying platforms as: - `"linux_*"` - `"osx_*"` - `"windows_*"` allows the pip to create repositories for different platforms and picks up correct one for the execution platform.
-
- Mar 23, 2025
-
-
Tomer Shterenberg authored
-
- Mar 10, 2025
-
-
Alex Tercete authored
-
Alex Tercete authored
Leftover from aeea1465.
-
- Mar 07, 2025
-
-
Alex Tercete authored
Users shouldn't need to register an additional toolchain if they're already using a different version of Python.
-
- Mar 05, 2025
-
-
Matthew Clarkson authored
-
Matthew Clarkson authored
Setting the compatiblilty for the configuration generation rule ensures that we do not support Windows. There is no technical barrier here, it just needs thorough testing. Currently, the hermetic bootstrap script for `rules_python` is failing on Windows. See #1
-
Matthew Clarkson authored
-
- Feb 28, 2025
-
-
When integrated with `@pre-commit-hooks`, the YAML config was being generated with `@pre-commit-hooks~` as the workspace name, which caused errors when trying to run the hooks. In Bazel 8 the separator is `+`.
-
Matthew Clarkson authored
-
- Feb 27, 2025
-
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
Easy for the user. Does not describe the dependnecy relationship chain. #YOLO
-
Matthew Clarkson authored
-
Matthew Clarkson authored
Prevents regenerating the lockfile.
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
It is valid to pass zero hooks and generate a blank configuration.
-
Matthew Clarkson authored
-
Matthew Clarkson authored
-
Matthew Clarkson authored
`semantic-release` sets it for us.
-
Matthew Clarkson authored
Will be set by `semantic-release`.
-
Matthew Clarkson authored
This is a **huge** patch that implements the functionality to use Bazel run targets as `pre-commit` hooks. It provides the following rules: - `pre_commit`: a macro that bundles the below rules - `pre_commit_hook`: a macro to select a specific Bazel command rule such as `pre_commit_hook_run` - `pre_commit_hook_run`: creates a `pre-commit` hook description that executes `bazel run` for the provided target - `pre_commit_hooks`: bundles multiple `pre_commit_hook` rules together for easy usage - `pre_commit_config`: accepts `pre_commit_hook{,s}` and generates a `.pre-commit-config.yaml` file - `pre_commit_install`: installs a provided `.pre-commit-config.yaml` file into `.git/hooks` - `pre_commit_run`: performs `pre-commit run` against the provided `.pre-commit-config.yaml` file - `pre_commit_stage`: describes a `pre-commit` hook stage to be used with `pre_commit_hook` - `pre_commit_tag`: describes a `pre-commit` hook file type tag to be used with `pre_commit_hook` It has the following providers: - `PreCommitConfigInfo`: a generated configuration file - `PreCommitHookJSONInfo`: a provider that can be serialized to JSON for ingestion into `pre_commit_config` - `PreCommitHookInfo`: a generated JSON file that `pre_commit_config` can parse and generate a configuration from - `PreCommitHooksInfo`: contains a `depset` of `PreCommitHookInfo` providers - `PreCommitTagInfo`: contains a `identify` file kind tag - `PreCommitStageInfo`: contains a `pre-commit` hook stage It has the following public labels: - `@pre-commit`: a monkey patched `pre-commit` to ensure it works with Bazel effectively and provides a hermetic `git` and `bazel` implementation for running the hooks - `@pre-commit//pre-commit:pkg`: a `py_library` that provdes the `pre_commit` Python module. Uses universal lockfiles and Python version `select` to provide the correct module to downstream users. - `@pre-commit//pre-commit/git`: a `label_flag` for changing the hermetic `git` implementation used - `@pre-commit//pre-commit/bazel`: a `label_flag` for changing the hermetic `bazel` implementation used - `@pre-commit//pre-commit/stage:*`: stages to be used with `pre_commit_hook#stages` - `@pre-commit//pre-commit/tag:*`: tags to be used with `pre_commit_hook#types{,_or}`
-
- Feb 20, 2025
-
-
Matthew Clarkson authored
-