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

Comments

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Sep 18, 2018

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.

@RonnyPfannschmidt
Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt commented Sep 18, 2018

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

@gaborbernat gaborbernat commented Sep 18, 2018

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

@RonnyPfannschmidt
Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt commented Sep 18, 2018

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

@ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Nov 12, 2018

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.

@gaborbernat gaborbernat removed this from the 3.6 milestone Dec 16, 2018
@gaborbernat gaborbernat added this to the 3.7 milestone Dec 16, 2018
@obestwalter
Copy link
Member

@obestwalter obestwalter commented Jan 7, 2019

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

@nicoddemus nicoddemus commented Jan 7, 2019

Agreed, sounds like a good idea

@gaborbernat
Copy link
Member Author

@gaborbernat 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 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

@gaborbernat gaborbernat commented Jan 14, 2019

Yeah, will try as much as possible.

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``.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants