-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project plugins and forcing a minimum poetry version #9547
base: main
Are you sure you want to change the base?
Conversation
Deploy preview for website ready! ✅ Preview Built with commit be5483c. |
… that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…oetry version the project is compatible with (python-poetry#9547)
3f1bd8e
to
1ab3e2e
Compare
… that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…oetry version the project is compatible with (python-poetry#9547)
1ab3e2e
to
e300c83
Compare
Some bikeshedding from my side. I don't like the new |
Yeah, that has already come to my mind, but I couldn't think of anything better. At least, I like the grouping of required version and required plugins into one section.
That is an option. The drawback is that it is not grouped anymore with the required plugins into one section.
Not sure about that because plugins are only installed if they are not available in the global Poetry installation. (I think that makes more sense than just always installing them into the project.) Maybe, |
Do we need those two features to be grouped together? I don't think so, but maybe you have some good reasons for that |
It just belongs together because both are requirements for Poetry itself. By the way, when running Actually, I still think |
@johnthagen Since you seem to be interested in this PR and have already given valuable input in various user interfacing issues, I would like to ask for your opinion: (Opinions of others are also welcome, of course.) self section example
requires fields example
|
@radoering Thanks for the ping. First, a quick question. Is it assumed that The reason I ask, is that that PR would allow users to move a lot of metadata out of |
Although this could come before |
That is a good point to consider. Are there any fields that we know currently we'd need to use? I do not have a super strong opinion, but given that [project]
# ...
[tool.poetry]
# ...
package-mode = false
requires-poetry = ">=2.0"
[tool.poetry.requires-plugins]
poetry-plugin-bundle = ">=1.3"
poetry-plugin-export = ">=1.7.0" To me this seems like the best long term option. |
@johnthagen Thanks for your input. One thing that came to my mind: Is |
@radoering [tool.poetry.requires-plugins] The |
…gins that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…e Poetry version the project is compatible with (python-poetry#9547)
e300c83
to
ea8b19c
Compare
I updated the PR from |
…gins that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
ea8b19c
to
0419d00
Compare
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…e Poetry version the project is compatible with (python-poetry#9547)
…gins that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…e Poetry version the project is compatible with (python-poetry#9547)
0419d00
to
8bd5a42
Compare
…gins that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…e Poetry version the project is compatible with (python-poetry#9547)
8bd5a42
to
d2372be
Compare
…gins that are required for the project (python-poetry#9547) * when running `poetry install` and required plugins are not available in Poetry's own environment they are installed only for the project into .poetry/plugins inside the project folder * when creating the application .poetry/plugins is added to the front of sys.path Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
…s (especially relevant for installing project plugins if Poetry has been installed via pipx) (python-poetry#9547)
…e Poetry version the project is compatible with (python-poetry#9547)
d2372be
to
be5483c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments after another review pass.
|
||
def add_plugin(self, plugin: Plugin) -> None: | ||
def _add_plugin(self, plugin: Plugin) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: any particular reason for making this private?
self._io = io | ||
self._path = poetry.pyproject_path.parent / self.PATH | ||
self._config_file = self._path / "config.toml" | ||
self._gitignore_file = self._path / ".gitignore" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should point to .poetry/.gitignore
so that if we use .poetry
for another purpose in the future, we don't have to multiply the .gitignore
files.
repo = Repository("poetry-repo") | ||
for package in locked_packages: | ||
repo.add_package(package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo = Repository("poetry-repo") | |
for package in locked_packages: | |
repo.add_package(package) | |
repo = Repository("poetry-repo", locked_packages) |
We can also eliminate that variable all together and put Repository("poetry-repo", locked_packages)
directly in the Installer
init in line 295.
Pull Request Check List
Related-to: #5740 (refines the plugin part, omits the tools part)
Resolves: #5729
Resolves: #3316
Introduces
tool.poetry.requires-poetry
andtool.poetry.requires-plugins
.Example:
tool.poetry.requires-poetry
enforces a Poetry version and raises an error if the used version is not allowed, e.g.:(Of course, this only works for future Poetry versions because older versions do not know this setting.)
In
tool.poetry.requires-plugins
you can define plugins that are required for the project. If these plugins are not installed in Poetry's own environment, they are installed only for the project into.poetry/plugins
inside the project folder.rejected first draft
Introduces a `tool.poetry.self` section in pyproject.toml. Example: