Skip to content
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

Support for extra entrypoints / plugins / scripts #1454

Closed
2 tasks done
funkyfuture opened this issue Oct 9, 2019 · 12 comments
Closed
2 tasks done

Support for extra entrypoints / plugins / scripts #1454

funkyfuture opened this issue Oct 9, 2019 · 12 comments
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@funkyfuture
Copy link
Contributor

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

package metadata allows entrypoints (plugins and scripts in poetry) to depend on specific extras. here this example is given:

[console_scripts]
foobar = foomod:main_bar [bar,baz]

so the console script foobar would only get installed when the extras bar and baz are specified.

afaict this is currently not supported. if i'm wrong with that, i'd be happy to extend the docs in this regards, but i would need advice about the configurations syntax.

@funkyfuture funkyfuture added the kind/feature Feature requests/implementations label Oct 9, 2019
@bradsbrown
Copy link
Contributor

@funkyfuture I opened a PR to extend the docs for this very topic a while back that is still pending but may be helpful to you -- https://github.com/sdispater/poetry/pull/1181/files

@funkyfuture
Copy link
Contributor Author

funkyfuture commented Oct 10, 2019

thanks for the hint!

@funkyfuture
Copy link
Contributor Author

looking at the schema, it seems that isn't implemented for plugins yet.

@pawamoy
Copy link

pawamoy commented Nov 28, 2019

So if I understand correctly, extras are implemented for poetry's scripts but not for poetry's plugins? And a PR is pending to improve the documentation on that matter.

In this case, @funkyfuture could you change the title to something like "Support for plugins extras"?

@funkyfuture
Copy link
Contributor Author

yes, that is correct.

i deliberately chose all the terms in the title in order for the issue to be found. eg me would search for entrypoints.

@pawamoy
Copy link

pawamoy commented Nov 29, 2019

And I found your issue too but it was a false positive haha 😄 But I do get your point

@funkyfuture
Copy link
Contributor Author

@sdispater i think this feature should be available with the first major release.

@abn abn added the status/triage This issue needs to be triaged label Apr 14, 2020
@abn
Copy link
Member

abn commented Apr 14, 2020

This should looked at after #2310 is ready. We could add this as a property of the script or the better the extras themselves similar to optional dependencies.

@Nicoretti
Copy link

Nicoretti commented May 23, 2023

Hi @ all,

I would be eager to know what the status of this issue is. Because we have a use case for the plugin extras 😄 .

Our use case is, to optionally provide a pytest plugin for a tool (prysk) .
If we can't selectively (based on extras) enable/disable the installation of the plugin hook, users which do
not use the plugin, may run into problems. E.g. see here: prysk/prysk#190.

I think the only legit solution, without an selective enable/disable, would be to have two projects/packages on pypi
so the extra can be on a package dependency level rather than on a plugin level.

Looking forward to hear your perspective.

best
Nico

P.S.: @ maintainers & contributors: Huge thanks for your work, I am a happy user of poetry 👍 !

@Secrus
Copy link
Member

Secrus commented May 23, 2023

I am going to pull the plug on this. According to this:

Using extras for an entry point is no longer recommended. Consumers should support parsing them from existing distributions, but may then ignore them. New publishing tools need not support specifying extras. The functionality of handling extras was tied to setuptools’ model of managing ‘egg’ packages, but newer tools such as pip and virtualenv use a different model.

So basically, while I understand that this could be a nice option, this is something that is not supported by other tools in Python ecosystem. We are working towards better integration with official standards, so as this is not recommended, it's unlikely that Poetry will support it.

@Secrus Secrus closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2023
@Nicoretti
Copy link

Nicoretti commented May 24, 2023

@Secrus thanks for the fast feedback!
It isn't the answer I was hoping to hear, but it is one I can work with, thx.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

6 participants