Open hoffch opened 6 months ago
There are no runtime dependencies for xdoctest. Poetry is being too aggressive extracting optional dependencies.
All requirements are separated by type here: https://github.com/Erotemic/xdoctest/tree/main/requirements Notice that runtime.txt is empty.
The reason I'm still on setuptools is because I parse these requirement.txt files and will optionally replace a ">=" with a "==" to pin to strict versions on user request. The extra_requires are defined here: https://github.com/Erotemic/xdoctest/blob/main/setup.py#L208 but the relevent code is:
setupkw["extras_require"] = {
"all": parse_requirements("requirements.txt", versions="loose"),
"tests": parse_requirements("requirements/tests.txt", versions="loose"),
"optional": parse_requirements("requirements/optional.txt", versions="loose"),
"all-strict": parse_requirements("requirements.txt", versions="strict"),
"runtime-strict": parse_requirements(
"requirements/runtime.txt", versions="strict"
),
"tests-strict": parse_requirements("requirements/tests.txt", versions="strict"),
"optional-strict": parse_requirements(
"requirements/optional.txt", versions="strict"
),
'tests-binary': parse_requirements('requirements/tests-binary.txt'),
'tests-binary-strict': parse_requirements('requirements/tests-binary.txt', versions='strict'),
'colors': parse_requirements('requirements/colors.txt'),
'jupyter': parse_requirements('requirements/jupyter.txt'),
}
I am using xdoctest 1.1.3 installed with poetry. I just realized by chance that the list of xdoctest's dependencies is surprisingly large:
With transitive dependencies, this sums up to 41 packages that are required by xdoctest. While I really like xdoctest, this actually prevents me from using it anymore. Too much complexity for the provided functionality. Plus the dependency installation slows down the CI unnecessarily.
Is that huge list really required? Or did some dev dependency (e.g. pyflakes) accidentally sneak into the main deps?
EDIT: It seems a lot of dependencies are related to doctests in Jupyter notebooks. Maybe Jupyter support can be made an opt-in feature on installation using extras (
pip install xdoctest[jupyter]
). That would drastically reduce the dependencies for everyone not working with Jupyter notebooks.