conda-forge / pydantic-feedstock

A conda-smithy repository for pydantic.
BSD 3-Clause "New" or "Revised" License
4 stars 17 forks source link

Add extra dependencies to recipe #55

Open jwodder opened 3 years ago

jwodder commented 3 years ago

I am attempting to add a recipe to conda-forge that depends on pydantic with the [email] extra. However, conda does not support extras, and email-validator is not listed as a runtime dependency in pydantic's conda-forge recipe. I would like to request that email-validator (and python-dotenv, for completeness) be added to the runtime dependencies in pydantic's conda-forge recipe so that they will be available to packages that depend on pydantic. (The alternative course of action, in which projects that need extras explicitly list the packages in the extras in their recipes, would shift responsibility for keeping pydantic's dependencies up to date from the maintainers of this recipe to the maintainters of all recipes that depend on pydantic, which seems undesirable.)

dgasmith commented 3 years ago

Having a batteries included approach is also undesirable as it can add up to many unused packages and I wouldn't be in favor of extending the current repository since pydantic is lightweight. conda-forge generally takes the x-core/x/x-extras strategy, see dask as an example.

jwodder commented 3 years ago

@dgasmith Then could you please consider creating a pydantic-email formula that depends on email-validator?

samuelcolvin commented 3 years ago

Is there no way to install email-validator with conda-forge?

jwodder commented 3 years ago

@samuelcolvin There is, but if I declare email-validator as an explicit dependency of my package, then, in the event that pydantic ever changes its [email] extra to install a different package or set of packages, I — and all other maintainers of conda-forge packages that explicitly depend on pydantic and email-validator — would have to update our packages' recipes, whereas if there were a pydantic-email recipe, then only a single update would be needed, to that recipe.

samuelcolvin commented 3 years ago

That would be the same in pypi/pip land and seems extremely unlikely.

I don't think it's sufficient reason to create a new package. Although I guess no one is stopping you creating it...?

jwodder commented 3 years ago

@samuelcolvin

That would be the same in pypi/pip land and seems extremely unlikely.

No, in pip land, I can declare a dependency on pydantic[email], and I won't have to worry about changes to the [email] spec. There is no built-in equivalent in conda-forge.

dgasmith commented 3 years ago

@samuelcolvin conda in general doesn't support optional dependancies (apart from making more packages).

@jwodder I don't have time at the moment to make another recipe, conda-forge is open submission. Happy to review/maintain another package!

BastianZim commented 2 years ago

Just my two cents: The easiest approach is to create a multi-output recipe like here: https://github.com/conda-forge/sagemaker-inference-toolkit-feedstock/blob/master/recipe/meta.yaml

The package should then be called base-extra and just depend on base + extras without having any content itself.