Skip to content

feat: support backends requirements#19406

Merged
kaos merged 11 commits intopantsbuild:mainfrom
idan-at:main
Jul 5, 2023
Merged

feat: support backends requirements#19406
kaos merged 11 commits intopantsbuild:mainfrom
idan-at:main

Conversation

@idan-at
Copy link
Contributor

@idan-at idan-at commented Jul 4, 2023

Closes #19183

Before this change, the only way backends could use external dependencies is
by adding them to the [GLOBAL].plugins section.
This change allow backends to declare their dependencies in a
requirements.txt file, next to their register.py module, and those
will be loaded before the backends, together with the global plugins.

Idan Attias added 3 commits July 4, 2023 14:19
Before this change, the only way backends
could use external dependencies is by adding
them to the [GLOBAL].plugins section.
This change allow backends to declare their
dependencies in a requirements.txt file, next
to their register.py module, and those will be
loaded before the backends, together with the
global plugins.
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing stuff!

Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huzzah!

I'm really excited about this change, and very well executed, thank you :)

@kaos
Copy link
Member

kaos commented Jul 4, 2023

Come to think of it, would also be great to mention this in the docs, perhaps around here: https://www.pantsbuild.org/docs/plugins-overview#building-in-repo-plugins-with-pants

Building in-repo plugins with Pants
-----------------------------------

@idan-at
Copy link
Contributor Author

idan-at commented Jul 5, 2023

Thanks! updated the docs :)

Idan Attias added 2 commits July 5, 2023 10:57
@idan-at
Copy link
Contributor Author

idan-at commented Jul 5, 2023

@kaos any idea why this test fails?

@kaos
Copy link
Member

kaos commented Jul 5, 2023

@kaos any idea why this test fails?

That's likely a flake.

@kaos kaos merged commit 0cada92 into pantsbuild:main Jul 5, 2023
@benjyw
Copy link
Contributor

benjyw commented Jul 5, 2023

Thanks @idan-at, this is great!

idan-at added a commit to idan-at/pants that referenced this pull request Dec 31, 2023
This fixed the change that was introduced on pantsbuild#19406: Due to the fact sys.path was not yet altered, `_collect_backends_requirements` fails to load in-repo plugins, thus ignoring the requirements.txt file.
idan-at added a commit to idan-at/pants that referenced this pull request Jan 8, 2024
This fixed the change that was introduced on pantsbuild#19406: Due to the fact sys.path was not yet altered, `_collect_backends_requirements` fails to load in-repo plugins, thus ignoring the requirements.txt file.
kaos pushed a commit that referenced this pull request Jan 9, 2024
This fixes the change that was introduced on #19406: Due to the fact
sys.path was not yet altered, `_collect_backends_requirements` fails to
load in-repo plugins, thus ignoring the requirements.txt file.

---------

Co-authored-by: Idan Attias <idanat@google.com>
WorkerPants pushed a commit that referenced this pull request Jan 9, 2024
This fixes the change that was introduced on #19406: Due to the fact
sys.path was not yet altered, `_collect_backends_requirements` fails to
load in-repo plugins, thus ignoring the requirements.txt file.

---------

Co-authored-by: Idan Attias <idanat@google.com>
kaos pushed a commit that referenced this pull request Jan 29, 2024
…) (#20381)

This fixes the change that was introduced on #19406: Due to the fact
sys.path was not yet altered, `_collect_backends_requirements` fails to
load in-repo plugins, thus ignoring the requirements.txt file.

Co-authored-by: Idan Attias <idanzii@gmail.com>
Co-authored-by: Idan Attias <idanat@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python_requirement not working in a plugin

3 participants