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

Dependency Audit #5720

Closed
danieleades opened this issue May 30, 2022 · 11 comments
Closed

Dependency Audit #5720

danieleades opened this issue May 30, 2022 · 11 comments
Labels
area/project Meta-issues for governance and the project itself good first issue

Comments

@danieleades
Copy link
Contributor

danieleades commented May 30, 2022

We should audit Poetry's dependencies to ensure they are rock solid.

Some of the dependencies could do with a refresh-

Dependency maintained?/last updated notes
cachy 7/8/19 some tidying required. No type annotations. Deps out of date
entrypoints unmaintained this dep should be replaced with importlib-metadata/importlib.metadata
importlib-metadata actively maintained required for python 3.7 only. Should be removed when 3.7 is end-of-life

there may be others worth looking at

@onerandomusername
Copy link
Contributor

Is it possible for poetry to vendor some of its dependencies? I don't think poetry exactly needs 50 dependencies installed, as sometimes those dependencies break

@danieleades
Copy link
Contributor Author

Is it possible for poetry to vendor some of its dependencies? I don't think poetry exactly needs 50 dependencies installed, as sometimes those dependencies break

i count 39 non-dev transitive dependencies.

I don't think that's necessarily an issue, since they are managed and isolated. I'm more interested in ensuring the foundation packages used by Poetry are solid, then in changing the way those packages are distributed. Are there specific dependencies that you think should be vendored? if so, why?

@Secrus
Copy link
Member

Secrus commented May 30, 2022

@danieleades I agree with you on entrypoints. When it comes to importlib-metadata, it will be kept until we drop python 3.7 and that will be 1yr+ as that's how long will 3.7 be officially supported by PSF.

When it comes to cachy, you can try finding some alternative and prepare PR for migrating it. However, as cachy is made by sdispater, I am quite sure it's tailored for Poetry and it might be hard to find good alternative.

Long story short, PRs are welcome :D

@danieleades
Copy link
Contributor Author

@danieleades I agree with you on entrypoints. When it comes to importlib-metadata, it will be kept until we drop python 3.7 and that will be 1yr+ as that's how long will 3.7 be officially supported by PSF.

When it comes to cachy, you can try finding some alternative and prepare PR for migrating it. However, as cachy is made by sdispater, I am quite sure it's tailored for Poetry and it might be hard to find good alternative.

Long story short, PRs are welcome :D

I've got a few open PRs to refresh cachy, though I don't know how active the maintenance is.
Agree that we can't touch importlib-metadata for a while, listing here for awareness.
Had a quick look at removing entrypoint, but it's non-trivial. Hopefully there'll be some time in my future where I can have a proper crack at it, but it won't be in the next few weeks.

@Secrus
Copy link
Member

Secrus commented May 30, 2022

@danieleades I agree with you on entrypoints. When it comes to importlib-metadata, it will be kept until we drop python 3.7 and that will be 1yr+ as that's how long will 3.7 be officially supported by PSF.
When it comes to cachy, you can try finding some alternative and prepare PR for migrating it. However, as cachy is made by sdispater, I am quite sure it's tailored for Poetry and it might be hard to find good alternative.
Long story short, PRs are welcome :D

I've got a few open PRs to refresh cachy, though I don't know how active the maintenance is. Agree that we can't touch importlib-metadata for a while, listing here for awareness. Had a quick look at removing entrypoint, but it's non-trivial. Hopefully there'll be some time in my future where I can have a proper crack at it, but it won't be in the next few weeks.

Sure. Marked it as "Good first issue", maybe someone will take a look at the entrypoints in the meantime.

@abn
Copy link
Member

abn commented May 30, 2022

Regarding, entrypoints, I have a migration to importlib.metadata ready. However, as it stands it's nontrivial to gather entrypoints via importlibs public api when a path to distributions is provided. Once that is solved, will replace entrypoints.

As for cachy, I was thinking we should just pull out relevant bits from cachy (file cache) and pull it into the poetry codebase. This has yet to be discussed. Either we do that, or pull cachy into the poetry org. For the former, a poc PR would be great to start discussions. If anyone is willing.

@Secrus
Copy link
Member

Secrus commented Jun 13, 2022

entrypoints are now removed in favor of importlib version.

@danieleades
Copy link
Contributor Author

entrypoints are now removed in favor of importlib version.

nice one!

looking at it now, it seems to be relying on an undocumented feature. the dist attribute of an Entrypoint is undocumented here - https://docs.python.org/3/library/importlib.metadata.html. It also means importlib-metadata can't be deprecated until python > 3.10.

Ideally it would be refactored to only use the documented api, available in import_lib.metadata in python 3.8+. I'm not sure how non-trivial that is. I had a quick look and it wasn't completely obvious.

@chadac
Copy link
Contributor

chadac commented Jun 18, 2022

Threw together a PR testing to see if what replacing cachy could look like. Looking around, I think cachy's footprint can be shrunk by quite a bit as Poetry only uses a small subset of its features.

@neersighted neersighted added area/project Meta-issues for governance and the project itself good first issue labels Oct 4, 2022
@neersighted
Copy link
Member

Closing this for now as we've addressed all the dependencies here (cachy is now dropped, and we're using newer features of importlib-metadata and thus on a newer version). It would be good to do this again another time, I think, but it would be easier to track in a new issue.

Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/project Meta-issues for governance and the project itself good first issue
Projects
None yet
Development

No branches or pull requests

6 participants