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

Distinguish core and optional dependencies #20

Open
TomJGooding opened this issue Apr 17, 2024 · 7 comments
Open

Distinguish core and optional dependencies #20

TomJGooding opened this issue Apr 17, 2024 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation stream candidate An issue that would be good to tackle on stream

Comments

@TomJGooding
Copy link

It might be nice to distinguish between core and optional dependencies in the Requires section.

For example, the textual package shows tree-sitter and tree-sitter-languages which are optional extras. Other packages may have defined separate dev only dependencies.

@davep davep self-assigned this Apr 17, 2024
@davep davep added the documentation Improvements or additions to documentation label Apr 17, 2024
@davep
Copy link
Owner

davep commented Apr 17, 2024

Aye, nice idea. I'll add that the next time I stream working on this; seems like a nice self-contained change.

@davep davep added the stream candidate An issue that would be good to tackle on stream label Apr 17, 2024
@davep
Copy link
Owner

davep commented Apr 19, 2024

Note to self: see also #24 from @hugovk - like, sorting is a nice thing to do for folk! (Nobody ask why I didn't do that in the first place).

@davep
Copy link
Owner

davep commented Apr 22, 2024

Note to self: Also noting #25 too it might make sense to tidy up all of this by using Packaging instead.

@davep
Copy link
Owner

davep commented Apr 22, 2024

Looking into the options, either I'm missing the obvious here, or neither of parse_requirements nor Requirement in Package provide a way of getting at that extra value:

    "requires_dist": [
      "markdown-it-py[linkify,plugins]>=2.1.0",
      "rich>=13.3.3",
      "typing-extensions<5.0.0,>=4.4.0",
      "tree-sitter<0.21.0,>=0.20.1; extra == \"syntax\"",
      "tree-sitter-languages==1.10.2; extra == \"syntax\""
    ],

There also seems to be nothing in the metadata as acquired from the metadata that says "oh yeah there's this syntax thing you might want to say you want...".

@TomJGooding
Copy link
Author

TomJGooding commented Apr 22, 2024

I confess I haven't really looked into this in any detail, but perhaps you could use the Requirement.marker?

But now looking at all the possible markers, I've realised it isn't as simple as distinguishing core and extra dependencies, as some might depend on the OS, Python versions, etc. I'm not sure a tool like PISpy should really be expected to drill down to this level of detail...

@davep
Copy link
Owner

davep commented Apr 22, 2024

Yup, was playing around with that this morning. While I've not reached a final conclusion on on it, I think I'm falling down on the side of this not really being a handy thing for PISpy (albeit I am considering a consolidated vs detailed dependency display toggle).

@TomJGooding
Copy link
Author

Sorry I hadn't really considered all the possible dependency "depends" when I suggested this! A consolidated vs detailed dependency display toggle would be a nice feature but only if it isn't too much work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation stream candidate An issue that would be good to tackle on stream
Projects
None yet
Development

No branches or pull requests

2 participants