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

Search by entry point #1677

Open
graingert opened this issue Jan 18, 2017 · 6 comments
Open

Search by entry point #1677

graingert opened this issue Jan 18, 2017 · 6 comments
Labels
feature request help needed We'd love volunteers to advise on or help fix/implement this. search Elasticsearch, search filters, and so on

Comments

@graingert
Copy link
Contributor

graingert commented Jan 18, 2017

various modules use entry_points to register plugins etc. It would be neat if users could search by these strings.

eg a search for all the packages that use 'flake8.extension' entrypoint

@zopieux
Copy link

zopieux commented Apr 27, 2017

Entry points and scripts! This feature would be great to find which PyPi package(s) exposes, say, the django-admin script (bad example, but you get the point).

@nlhkabu nlhkabu added the search Elasticsearch, search filters, and so on label May 13, 2017
@brainwane brainwane added this to the Cool but not urgent milestone Feb 17, 2018
@brainwane
Copy link
Contributor

Thanks for the ideas, @graingert and @zopieux, and my apologies on the delayed reply!

For context: the folks working on Warehouse have gotten funding to concentrate on improving and deploying it, and have kicked off work towards our development roadmap -- the most urgent task is to improve Warehouse to the point where we can redirect pypi.python.org to pypi.org so the site is more sustainable and reliable.

Since this feature isn't something that the legacy site has, I've moved it to a future milestone. But it is an interesting idea. Where within the package metadata would Warehouse be able to find the strings you'd like people to be able to search for?

Thanks and sorry again for the wait.

@zopieux
Copy link

zopieux commented Feb 17, 2018

Thanks for the feedback @brainwane!

As for the metadata we would like to be searchable, this would imply parsing:

  • the entry_points setup() parameter, eg. for pytest the argument
    entry_points={'console_scripts': ['pytest=pytest:main', 'py.test=pytest:main']},
    defines two entrypoints (pytest and py.test); searching "by binary path" for one or the other should yield the pytest package as a result
  • the scripts setup() parameter, eg. for ansible the argument
    scripts=[
          'bin/ansible',
          'bin/ansible-playbook',
          … ],
    should yield the ansible package when searching by path for ansible-playbook (this example is a little contrived because ansible had the good idea to namespace its binaries, but many projects do not).

@brainwane brainwane added the help needed We'd love volunteers to advise on or help fix/implement this. label Mar 14, 2018
@wimglenn
Copy link
Contributor

wimglenn commented Nov 18, 2019

+1!

This would be an awesome feature for warehouse, which will benefit any framework that builds a plugin system based around entry points.

For example, packages that are pytest plugins advertise the fact by registering an entry point in the group named "pytest11". Here's an example in pyproject.toml, and here's an example in setup.py.

Unfortunately, there is currently no way (at least not that I know of) to tell if a package is a pytest plugin without actually downloading the source code and looking. There's nothing mentioning "pytest11" in here (built by flit), and nothing in there (built by setuptools) either.

I am hoping the next version of Metadata for Python Software Packages can ratify entry points so that we can really move forward here.

@graingert
Copy link
Contributor Author

graingert commented Sep 13, 2020

@wimglenn the stdlib now defines entry_points: https://docs.python.org/3/library/importlib.metadata.html#entry-points and the pypa defines it here: https://packaging.python.org/specifications/entry-points/

@wimglenn
Copy link
Contributor

wimglenn commented Sep 15, 2020

@graingert That is nice to see but it doesn't seem to offer anything new for the purposes of this issue, i.e. searching of PyPI packages based on their entry points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help needed We'd love volunteers to advise on or help fix/implement this. search Elasticsearch, search filters, and so on
Projects
None yet
Development

No branches or pull requests

6 participants