-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability for Pants to provide Python via a union (with a pyenv…
… impl) (#18352) Fixes #10447 Adding the ability for an optional union (`PythonProvider`) implementer to return a `PythonExecutable` (newly outfitted with `append_only_caches`) so that Python for user code can be supplied completely by rule-code. Additionally added a `pyenv` union implementation. The dirty details are: - Python is essentially NOT relocatable (hats off to IndyGreg). Python itself, as well as ecosystem tools, are baked with assumptions about absolute paths. - Python installation is not atomic. That means we do our work behind a lock. We run the bash script on every session, but it should be fast as it only does the work if the target python doesnt exist. --------- Co-authored-by: Andreas Stenius <git@astekk.se>
- Loading branch information
1 parent
457e545
commit 7398971
Showing
20 changed files
with
614 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_sources() |
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions
4
src/python/pants/backend/python/providers/experimental/pyenv/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_sources() |
Empty file.
14 changes: 14 additions & 0 deletions
14
src/python/pants/backend/python/providers/experimental/pyenv/register.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
|
||
from pants.backend.python.providers.pyenv.rules import rules as pyenv_rules | ||
from pants.backend.python.providers.pyenv.target_types import PyenvInstall | ||
|
||
|
||
def target_types(): | ||
return [PyenvInstall] | ||
|
||
|
||
def rules(): | ||
return pyenv_rules() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_sources() | ||
python_tests( | ||
name="tests", | ||
overrides={ | ||
"rules_integration_test.py": { | ||
"timeout": 600, | ||
} | ||
}, | ||
) |
Empty file.
Oops, something went wrong.