Static build (Windows)


I have made some changes for our internal use (logging, not popping static resources such as images or js, etc.) that I want to build into a standalone exe for others to use. They have mitmproxy installed, but not Python or the build tools.

I can run my changes in a virtualenv locally and verify that they work. I’m trying to build exes using the following command from .travis.yml:

tox -e rtool -- bdist

It builds executables in the release/build/binaries/windows folder, but their version number is not updated. I’m using 2.0.2 as my base, and updated to 2.0.3 just so I could see if it actually updated. The zip file under release/dist has 2.0.3 in the name, but the exes report 2.0.2 (release version) as their version, and my changes are not present.

What step am I missing? I’ve also tried running both inside and outside a venv, random other tox commands, etc.


I think this is resolved, more or less. The build process is rather flaky on Windows. (As are most things…)

Steps to build:

  • pip uninstall mitmproxy (this was what was screwing me up - it kept building the exe based on what was installed by pip, instead of my source)
  • In tox.ini, comment out the line that says {env:SKIP_MITMPROXY:mitmproxy --version} - even when I set the environment variable to what I thought would work, it didn’t like it and would halt here.
  • From .appveyor.yml, we’re going to run the following commands in order:
    • tox -- --verbose --cov-report=term
    • set VERSION=version string (I could probably have set this with some kind of script, but didn’t bother messing with it.)
    • tox -e wheel
  • At this point, for whatever reason even though we just saw tox call pip install on our wheel, it’s not actually installed. So now, pip install release\dist\wheel-from-tox.whl
  • NOW tox is finally ready to build the bdist. tox -e rtool -- bdist