Ability to exclude certain dependencies altogether
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.
🎉 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