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

auto provision requires environment #998

Closed
gaborbernat opened this issue Sep 18, 2018 · 9 comments
Closed

auto provision requires environment #998

gaborbernat opened this issue Sep 18, 2018 · 9 comments
Assignees
Labels
area:configuration area:testenv-creation level:hard rought estimate that this might be quite hard to implement level:medium rought estimate that this might be neither easy nor hard to implement pr-merged
Milestone

Comments

@gaborbernat
Copy link
Member

Although the requires has been implemented using it in practice is not the nicest. Especially when having projects that have different requires subset. It's up to the users to create environments to satisfy those requirements which is PITA. I propose instead we go meta, and create it for them automatically to keep the expectation that you only need to install tox to run tests for a tox powered project:

  • no requires section -> just use the system main tox 👍
  • requires specified -> create a virtual environment under {toxworkdir}/.meta-tox and install the specified requirements; then delegate invocations to tox within that virtual environment.

@asottile @obestwalter please feed in your thoughts about this.

@RonnyPfannschmidt @nicoddemus what do you think? I believe this would make #828 a usable path to go down: these env providing plugins could be automatically provisioned, and they would be exactly specified -> e.g. tox-pytest-static == 1.1.0.

@gaborbernat gaborbernat added this to the 3.5 milestone Sep 18, 2018
@gaborbernat gaborbernat added level:medium rought estimate that this might be neither easy nor hard to implement level:hard rought estimate that this might be quite hard to implement labels Sep 18, 2018
@RonnyPfannschmidt
Copy link

sounds like a good idea

a tox integration of pre-commit and basic pytest-plugin might be nice starting points

@gaborbernat
Copy link
Member Author

the pytest has quite a few moving parts with it so not sure it would be the best fit 🤔

@RonnyPfannschmidt
Copy link

@gaborbernat "basic" would mean something that can invoke pytest plainly with posargs, nothing else

@ssbarnea
Copy link
Member

This would be brilliant to have! Just name it .meta as we don't want to repeast ourselves (.tox is the folder name) and I bet nobody is already using a hidden directory like ".meta".

This also solves another problem: we no longer need to upgrade tox on the operatiing system to support newer features, tox could install a newer tox inside .meta and use it.

@obestwalter
Copy link
Member

Sounds like a good direction to explore. I also like the idea of being able to have a different version of tox in that .tox/.meta which would solve the problem of having an up to-date system tox (in the very long run, as that version would still need to make it first to the distros/packages lagging years behind).

@nicoddemus
Copy link
Member

Agreed, sounds like a good idea

@gaborbernat
Copy link
Member Author

gaborbernat commented Jan 14, 2019

I've started work on this (will also restructure the long session.py into a module, as part of this, as the provision also needs some part - e.g. the reporter) - https://github.com/gaborbernat/tox/tree/provision/src/tox/session.

@obestwalter
Copy link
Member

obestwalter commented Jan 14, 2019

I know that we have no official programmatical API (yet?), but I think we should add a thin compatibility layer here and add a deprecation warning for tox 4.

I know for example, that PyCharm uses the session and the config, to implement their tox integration: https://github.com/JetBrains/intellij-community/blob/master/python/helpers/pycharm/_jb_tox_runner.py

@gaborbernat
Copy link
Member Author

Yeah, will try as much as possible.

This was referenced Jan 15, 2019
gaborbernat added a commit that referenced this issue Feb 5, 2019
While looking into doing #998 I realized the concept of env logs and actions have been heavily overlooked, furthermore the reporting should not be tied to the session (as we should report before the session object is constructed). This PR tries to fix all this and split up the longer and longer getting ``session.py``.
@helpr helpr bot added the pr-available label Mar 11, 2019
gaborbernat added a commit that referenced this issue Mar 12, 2019
@helpr helpr bot added pr-merged and removed pr-available labels Mar 12, 2019
@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:configuration area:testenv-creation level:hard rought estimate that this might be quite hard to implement level:medium rought estimate that this might be neither easy nor hard to implement pr-merged
Projects
None yet
Development

No branches or pull requests

5 participants