# Adding a default extra\_require environment

**URL:** <https://discuss.python.org/t/adding-a-default-extra-require-environment/4898>\
**Category:** Packaging\
**Created:** [August 3, 2020, 6:51pm UTC](https://discuss.python.org/t/adding-a-default-extra-require-environment/4898 "2020-08-03T18:51:56Z")\
**Posts on this page:** 1\
**Showing post:** 71

<div class="post-metadata">

**Author:** ![steve.dower](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steve.dower/32/56_2.png) [@steve.dower](https://discuss.python.org/u/steve.dower)\
**Post date:** [August 20, 2020, 8:37am UTC](https://discuss.python.org/t/adding-a-default-extra-require-environment/4898/71 "2020-08-20T08:37:23Z")

</div>

> [@dstufft](#):
>
> The ability to unselect an extra raises the question of what do we do if foo and bar both depend on spam, and one does `spam[-thing]` and the other does `spam[thing]` , how do we resolve the situation?

Because excluding an extra means “install this as if the extra were not specified”, surely this would be resolved exactly as it would be today, by including the packages from thing.

We discussed this a bit in [The ‘extra’ environment marker and its operators](https://discuss.python.org/t/the-extra-environment-marker-and-its-operators/4976), and while there was disagreement, it seems pretty clear that contradictory extras can exist and should be caught at resolution time (or later when things don’t work), and that these are a bug in the package, but it shouldn’t matter here.

As an aside, I regularly use/recommend pip-compile to get all the dependencies into a requirements file, then modify it manually and install with `--no-deps` to exclude dependencies. Would not be opposed to using an extra for more targeted handling, but it works fine.

---

_[View the full topic](https://discuss.python.org/t/adding-a-default-extra-require-environment/4898)._
