Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUGE list of dependencies - accident or intention? #154

Open
hoffch opened this issue Feb 27, 2024 · 1 comment
Open

HUGE list of dependencies - accident or intention? #154

hoffch opened this issue Feb 27, 2024 · 1 comment

Comments

@hoffch
Copy link

hoffch commented Feb 27, 2024

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:

 - attrs >=19.2.0
 - colorama >=0.4.1
 - debugpy >=1.6.0
 - ipykernel >=6.11.0
 - IPython >=7.23.1
 - ipython-genutils >=0.2.0
 - jedi >=0.16
 - jinja2 >=3.0.0
 - jupyter-client >=7.0.0
 - jupyter-core >=4.7.0
 - nbconvert >=6.1.0
 - pyflakes >=2.2.0
 - Pygments >=2.4.1
 - pytest >=6.2.5
 - pytest-cov >=3.0.0
 - tomli >=0.2.0

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.

@Erotemic
Copy link
Owner

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'),
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants