Use tox to create local development environment

Issue #101 on hold
Łukasz Balcerzak created an issue

We use some custom scripts to prepare local development environment, including:

  • creating virtualenv
  • fetching all the packages from requirements.txt using pip (but only if it was changed)

That's actually something that tox does perfectly. I was thinking about extending tox with another subcommand, i.e. tox --update-devenv.

At config file there should be devenv section with options helping to describe how development environment should look like. It would be very similar to current testenv most probably (i.e. set default python, set commands to run in order to setup environment etc. plus path where environment should be put - as we might not want it inside .tox). There should also be a way to override those local devenv settings - in order to allow developer to use whichever python user want to use.

Am not sure if you would be interested to put this into the core so I'm not sure of all the details right now. Just wanted to know if you'd want something like this in tox itself. If not, let me know too. I would work on it anyway - as an external tool that uses tox's Python api.

BTW: Is tox internals considered as official API (backward compatibility etc.)? Or is it more like with mercurial (where only a tool [script] is considered as official API, not internals)?

Comments (8)

  1. Holger Krekel repo owner

    I welcome developments into the direction of:

    • adding options to manipulate venvs according to tox.ini sections
    • exposing part of the tox API officially

    Regarding the first point, could you write documentation from how a user would use things? Feel free to do this as a PR and we discuss it there further so that the PR evolves into a full blown patch which can be merged.

    Regarding the API i am using it myself from other tools so i am not lightly making changes. We should evolve, however, to document what can be used and how, possibly providing a layer on top of the internal API to allow internal re-organisation. Part of the API is such that "detox" can use it to perform actions in parallel.

    I am also open to go for a hangout sometime, with screen sharing, to discuss things interactively in more detail.

  2. Łukasz Balcerzak reporter

    Great!

    Yep, am going to create PR where I would try to write documentation/tutorial of how such feature could be used. It makes perfect sense to start commenting on something already shaped.

    As for API - I can't tell much here before I actually dig into tox internals. And that's something I wouldn't do before trying to create a prototype for feature I had proposed. Once that's done on the other hand, we can surely have more interactive session.

  3. Log in to comment