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

Ability to skip install, but still install extras #2301

Open
GlenNicholls opened this issue Jan 5, 2022 · 4 comments
Open

Ability to skip install, but still install extras #2301

GlenNicholls opened this issue Jan 5, 2022 · 4 comments
Labels
feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@GlenNicholls
Copy link

I am wondering if it's possible to install extras even though I have skip_install=true? I would like my setup.cfg to contain all of my dependencies so they aren't split between setup.cfg and tox.ini. For some of my tox runs, e.g. combining coverage runs, it'd be nice if I could re-use extras without either defining a dependency in tox.ini and attempting to keep it in sync with setup.cfg, or installing my entire python package as that run doesn't need anything from that environment.

@GlenNicholls GlenNicholls added the feature:new something does not exist yet, but should label Jan 5, 2022
@gaborbernat
Copy link
Member

gaborbernat commented Jan 5, 2022

pip doesn't allow this pypa/pip#4783, so not possible with tox 3. In the new tox 4 we use the pyproject API to load the packages dependencies so, in theory, we could add support for this 🤔 though I'd name this option something else, like install_only_extras=true/false rather than overload skip install. This feature hasn't been yet developed, but I'd not consider it out of the question if there's enough interest for it. The current workaround could be to install the package, but do a pre_command with pip uninstall my-package.

@GlenNicholls
Copy link
Author

Thanks for the insightful reply. Yeah, right now I'm just skipping the install and defining deps. Not as clean as I'd like, but I definitely see value in a feature like this. I'm starting to do more project-related things with tox like building and uploading docs and this just seemed like a nice feature to support that.

@gaborbernat gaborbernat added this to the 4.2 milestone Jan 13, 2022
@Mr-Pepe
Copy link

Mr-Pepe commented Apr 4, 2022

I would really appreciate this feature. My use case is building a package with build and publishing it with twine. I like to have all dependencies in one place, so I define build and twine as "build" extras. Having tox install the package and all its runtime dependencies is unnecessary in this case. I am in favor of install_only_extras=true/false. That would already imply skip_install, right?

@thomasgilgenast
Copy link

As a short-term hacky option to work with for myself, I have made a tox plugin that allows you to write (e.g. for a "lint" testenv that depends only on a "lint" extra but does not need your package to be installed):

[testenv:lint]
skip_sdist = true
skip_install = true
tox_extras = lint
commands = black --check example.py

Just posting it here in case it is of interest to watchers of this issue or if it inspires discussion on how this type of functionality could be used in practice: https://github.com/sclabs/tox-extras

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Jun 16, 2023
@gaborbernat gaborbernat removed this from the P-2 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

4 participants