Skip to content

Allow user configuration outside of tox.ini #154

Closed

Description

@pytoxbot

I would like to override the "toxworkdir" config option without editing a project's tox.ini. As far as I can tell, there's no mechanism to allow me to do this.

It should probably be possible to specify additional config files somehow.

Activity

  1. pytoxbot commented on Sep 17, 2016

    @pytoxbot
    Author

    Original comment by @hpk42

    right, i meant it this way :)

    However, i am a bit hard pressed with spending much time on tox. Hope you and others continue to help with things :)

  2. pytoxbot commented on Sep 17, 2016

    @pytoxbot
    Author

    Original comment by @msabramo

    The conftest.py mechanism in pytest is super useful. I wonder if tox could have a similar mechanism? conftox.py?

    Hmmm, you called your file that too - maybe you had the same idea? :-)

  3. pytoxbot commented on Sep 17, 2016

    @pytoxbot
    Author

    Original comment by @hpk42

    I agree it'd be useful to "enhance" tox config from a) a user-specific file b) from the command line. If it happens, tox should report it explicitely. As to a) we might also think about introducing a plugin mechanism so that e.g. $HOME/.tox/conftox.py is read and can define hooks that tox calls (similar to pytest is extended through tox).

  4. pytoxbot commented on Sep 17, 2016

    @pytoxbot
    Author

    Original comment by @msabramo

    Yeah, in the past, I've sometimes wished that there were a ~/.tox/tox.config or something.

    My use case is that I love having pdbpp or ipdb or whatever debugging tools present in my tox virtualenvs so that if the tests fail, I have some nice tools already present for debugging. In the past, I have done one of these:

    1. Manually install tool -- e.g.: .tox/py27/bin/pip install pdbpp -- this is tedious and has to be repeated if the virtualenv gets rebuilt.
    2. Add it to tox.ini for project. This is mostly okay but sometimes others have (rightfully) complained that I'm adding unnecessary dependencies that could break the tests or increase the time to run the tests, so I shouldn't be adding my own personal favorites.

    So I have sometimes wished that I could have a user configuration that allows me to tell tox to install these tools in every virtualenv it creates. The one gotcha with this is that if abused, people can have a build that works in one person's environment but not another's because they've put necessary deps in their user config. One thing to help with this is an option that tells tox not to use the user config. Hopefully, people would periodically run without the user config to make sure stuff works without any user config.

    The user config might also be a good place to put alternative index servers. We have an internal indexserver for our company and it's referenced in the tox.ini of tens of different projects. Not so DRY.

  5. jrast commented on Mar 8, 2017

    @jrast

    I stumbled over this issue searching for a solution to provide the basepython for each testenv on different windows machines. I came up with a very simple tox plugin which loads an additional config file from $HOME derectory and extends / overwrites the different testenv configurations using the tox_configure hook.

    If anyone is interested I can publish this plugin.

  6. obestwalter commented on Sep 4, 2017

    @obestwalter
    Collaborator

    I would say that this is nowadays possible by using environment variable substitutions - no extra configuration necessary, or am I am missing something?

  7. added
    type:question ❔
    and removed on Sep 4, 2017
  8. locked and limited conversation to collaborators on Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationtype:question ❔

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions