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

docs: added documentaion on how to define entry-points for ape plugin #2183

Closed
wants to merge 2 commits into from

Conversation

Aviksaikat
Copy link
Contributor

@Aviksaikat Aviksaikat commented Jul 22, 2024

docs: added documentation on how to define entry-points for ape plugins when using pyproject.toml

What I did

fixes: #2182

How I did it

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@Aviksaikat Aviksaikat changed the title docs: added documentaion on how to define entry-points for ape plugin… docs: added documentaion on how to define entry-points for ape plugin Jul 22, 2024
@antazoey antazoey requested a review from dtdang July 22, 2024 23:06
```yml
[...]
# Make it work with cli like ape myplugin
[project.entry-points.ape_cli_subcommands]
Copy link
Contributor

Choose a reason for hiding this comment

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

I needed to register the entry-point using [<project-name>.entry-points.ape_cli_subcommands] in order for it to register properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's strange. I believe it has to be a property of the project. What env management tool are you using? Have you tried installing it using pip?

Copy link
Contributor

Choose a reason for hiding this comment

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

I installed using pip install -e .. It actually gave me an error when I tried using what you have.

ValueError: invalid pyproject.toml config: `project`.
      configuration error: `project` must contain ['name'] properties

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm that's odd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think you need to define the project name like this

[project]
name = "ape-utils"
[...]

[project.entry-points.ape_cli_subcommands]

[...]

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll probably need to add a new documentation section for using only a pyproject.toml for an ape project since it'll need more configuration than just this. Definitely something to keep in mind when we start development on this later @bitwise-constructs

@Aviksaikat
Copy link
Contributor Author

Any update on this?

@dtdang
Copy link
Contributor

dtdang commented Aug 15, 2024

Any update on this?

I think we're going to hold off on merging this because setting up a plugin entry-point in the pyproject.toml will take more than just this including defining the project and a few other things as well. This will be useful though for when we refactor projects to just need a pyproject.toml but for now, we aren't there yet.

Copy link

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions bot added the stale No activity for 30 days label Sep 15, 2024
Copy link

This PR was closed because it has been inactive for 35 days.

@github-actions github-actions bot added the inactive no recent activity, closed label Sep 21, 2024
@github-actions github-actions bot closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive no recent activity, closed stale No activity for 30 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: Add example on how to set entrypoint for a plugin using pyproject.toml
2 participants