-
Dear @jaraco, I have been trying to find a solution to the following problem. Here is what I would like to be able to do: install_requires = ["A", "B", "C"]
extras = {
"my_extra_a": ["D", "E", "G"] + (["A", "B", "C"] coming from install_requires),
"my_base_extra": ["A"] + (prevent install_requires to be added.)
} For production reason, we would like to be able to release the minimal version possible of our library, which is more restrictive from the current dev env. However, changing the base would be a big breaking change for the users and we don't want to take this route. Ideally, it would be great for setuptools to be more flexible and enable fully independent installs which is more appropriate for production vs dev requirements. install_requires = {
"": default ones,
"a": Whatever I want
"b": Whatever else I want
} Right now, I am investigating if it is possible to implement my own Distribution / Command to prevent the install_requires to be added to one of the extras. But I haven't found yet where the addition is being done. In case it is not possible, the only other solution would be to release a second version of our library with trimmed dep, but I would prefer not to do so. Best, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I also tried the following, but I am not sure to fully understand the behaviour from setup with extras. extras = {
# 'docs': load_requirements(file_name='docs.txt'),
"base": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="base.txt"),
"examples": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="examples.txt"),
"loggers": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="loggers.txt"),
"extra": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="extra.txt"),
"test": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="test.txt"),
"": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="requirements.txt"),
}
extras["dev"] = extras["extra"] + extras["loggers"] + extras["test"] + extras[""]
extras["all"] = extras["dev"] + extras["examples"] # + extras['docs']
setup(
...
setup_requires=[],
install_requires=[]
extras_require=extras, Somehow, Best, |
Beta Was this translation helpful? Give feedback.
-
An extra named
There are open feature requests to provide a "default extras" (#1139), which I believe is what you want, but that feature doesn't exist yet. |
Beta Was this translation helpful? Give feedback.
An extra named
""
gets treated as an "install_requirement" (installed in all cases). That's mainly because of the syntax of requirements and the fact that Setuptools historically allowed for empty extras to be used for environment-markers. e.g.:There are open feature requests to provide a "default extras" (#1139), which I believe is what you want, but that feature doesn't exist yet.