poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Ability to exclude certain dependencies altogether

Open valentincalomme opened this issue 1 year ago • 3 comments

Issue Kind

Brand new capability

Description

In some of my projects, we decide to exclude the use of specific dependencies (i.e. pandas). Whilst it is easy to check during a code review if someone attempted to add it as a dependency by checking the pyproject.toml file, it isn't easy to know if pandas is a sub-dependency of another dependency.

I envision something like an exclude field in the poetry specification that would list packages, and if any of these show up as necessary dependencies, the install should fail.

Impact

This would require a new input type in the pyproject.toml file and additional checks when resolving dependencies.

Workarounds

Right now, I am using tricks using poetry show to list all dependencies and manually check these files, but I wish there were an automatic way to define this in the pyproject.toml file.

Obviously, there are ways to exclude certain versions of a package, but I'd like to exclude all versions of a package.

valentincalomme avatar Mar 14 '24 10:03 valentincalomme

🎉 Thank you for your contribution to Hacktoberfest 2025! Your changes have been noted. ✅ You're officially part of Hacktoberfest 2025! This PR was automatically closed because it only modifies the contributors list. We're managing contributor additions through automated merges to avoid conflicts. Thank you @CynthiaWahome for participating in open source! 🚀 #Hacktoberfest #OpenSource

github-actions[bot] avatar Oct 06 '25 15:10 github-actions[bot]