Search code examples
pythontox

what is use_develop in tox and development mode


I was trying to understand the purpose of use_develop and from the docs, I found this:

Install the current package in development mode with develop mode. For pip this uses -e option, so should be avoided if you’ve specified a custom install_command that does not support -e.

I don't understand what "development mode" means. Is this a python concept or it's specific to tox? Either way what does it mean?


Solution

  • development mode or editable installs is a Python concept, or even more specific a Python packaging concept.

    Usually, when you package a Python application or library, the source files are packaged into a "container", either a wheel or a source distribution.

    This is a good thing to distribute a package, but not for developing, as then the source files are no longer accessible.

    editable installs is a concept, that instead of "moving/copying" the files into the package container, the files are just symlinked (at least this is one way).

    So when you edit the source files, also the package is updated immediately.

    For tox this also means that the files in the root of the source tree are importable by Python, not only the one in the package.

    This might be comfortable, but there is one huge caveat. If you misconfigure the packaging setup, maybe the tests ran by tox are green, but it is entirely possible that you forget to include the source files in the package you deliver to your users.