mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

Feature to pass mutmut_config from custom path

Open henryh9n opened this issue 3 years ago • 6 comments

Most often we run the mutmut on a custom path in the project. As far as I can see, at the moment the mutmut_config.py must be places inside the root of the path beeing analysed. On the other hand we want to use the same config file for all the paths we analyse. Currently, we have to copy the config file to all of the destinations.

It would be nice to have a flag to get the config file from a custom location.

henryh9n avatar Oct 08 '20 12:10 henryh9n

If mutmut_config.py is available on the python path it will find it no matter where it is. Maybe this could be practical for you?

boxed avatar Oct 08 '20 12:10 boxed

If mutmut_config.py is available on the python path it will find it no matter where it is. Maybe this could be practical for you?

Yup, that might work in my case. Is it anywhere in the docs? If not lets at least add it there

henryh9n avatar Oct 09 '20 09:10 henryh9n

Strictly speaking I guess the docs should just be changed to say mutmut will try to load a module mutmut_config, instead of talking about a file. But maybe that's not explicit enough?

boxed avatar Oct 09 '20 10:10 boxed

That's a nice way to put it. The extended instructions (I mean about .py file) can follow along.

henryh9n avatar Oct 09 '20 10:10 henryh9n

It would still be nice to make the location of the mutmut_config module configurable.

On a recent PR, my partner asked that mutmut_config.py be moved out of our already crowded project root. while making it a folder is better mutmut_config/__init__.py I would prefer to be able to set the location in pyproject.toml, like mutmut_config: "scripts/dev/mutmut_config.py

lundybernard avatar Oct 05 '22 22:10 lundybernard

@lundybernard as I said above: it doesn't need to be there, it just needs to be importable. So you can add any path to your pythonpath where that file is.

boxed avatar Oct 06 '22 07:10 boxed