# Proposal for dynamic metadata plugins

**URL:** <https://discuss.python.org/t/proposal-for-dynamic-metadata-plugins/25237>\
**Category:** Packaging\
**Created:** [March 27, 2023, 8:47pm UTC](https://discuss.python.org/t/proposal-for-dynamic-metadata-plugins/25237 "2023-03-27T20:47:21Z")\
**Posts on this page:** 1\
**Showing post:** 41

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [March 29, 2023, 2:22pm UTC](https://discuss.python.org/t/proposal-for-dynamic-metadata-plugins/25237/41 "2023-03-29T14:22:08Z")

</div>

> [@rgommers](#):
>
> > [@CAM-Gerlach](#):
> >
> > ```toml
> > optional-dependencies.test.file = “test-requirements.in”
> > 
> > ```
> 
> This should not be optimized for imho. The better solution is to have `pip` and installers be able to install from
> 
> ```toml
> [project.optional-dependencies]
> test = [....]
> 
> ```
> 
> We have a proper section in `pyproject.toml`, so let’s use it.

Just to note, since I was quoted, I wasn’t necessarily endorsing that aspect of the proposal, just pointing out a more concise alternative syntax for it. FWIW, I don’t use or favor this pattern myself, though it’s already fully possible to do this without this proposal using the current `dynamic`.

> [@rgommers](#):
>
> There’s discussion on the `pip` issue tracker about gaining the ability to install the various groups of dependencies listed in `pyproject.toml`.

Err, maybe getting a little OT, but isn’t that perfectly possible right now with `pip install -e .[test]`, etc. (except you get the package built and installed too)? Or are you referring to a `--deps-only` flag which would enable installing dependency groups (and package deps in general) without installing the package itself, which would replace that use case for `requirements.txt` (which is certainly something I’ve missed from using it in Conda, and would very much like to see in `pip`)?

> [@rgommers](#):
>
> My impression so far is that I quite like the core argument @henryiii is making about allowing specifying metadata statically _and_ adding them to dynamic.

To note, this would partially, but not completely address what you’re asking for in [the other thread](https://discuss.python.org/t/relaxing-or-clarifying-pep-621-requirements-regarding-dynamic-dependencies/24752/); your backend could add additional requirements, but not alter the specifiersets for existing ones…unless either there was a special case allowing additional specifiers for when `SpecifierSet(<modified>) in SpecifierSet(<original>)`, i.e. the modified version specifierset was a subset (i.e. contained within, stricter than) the original—or multiple specifiersets were allowed for the same distribution name key, in which case the intersection was taken (which could potentially result in impossible to satisfy dependencies if the sets are disjoint).

---

_[View the full topic](https://discuss.python.org/t/proposal-for-dynamic-metadata-plugins/25237)._
