Lately I have been involved (at work) in an Electron project, and was made aware of windows-build-tools. I am not particularly knowledgable about Node packaging, but from what I’ve learned, it is a dummy package that, upon installing (globally), prepare the target Windows machine to compile native Node modules.
This gets me start wondering whether an equivalent for Python (probably under the PyPA umbrella?) would be useful. It should be quite doable since Visual Studio installers since 2017 (used by Python 3.5+) are freely available, and both highly customisable and scriptable. Python 2.7 support is also possible thanks to Microsoft’s dedicated toolchain, but I don’t think it is worhwhile to persue in year 2019.
(Speaking of Python 2.7, Node’s build toolchain seems to depend on it as well. I wonder whether they have a migration plan moving forward.)
How this should be done, however, is another problem. The simplest approach would be similar to windows-build-tools, i.e. publishing a dummy package to PyPI, and perform whatever tasks required in a custom setup.py. I am not very fond of this idea, however, since IMO it is a very bad idea to download and run arbitrary code, in general. Some other ideas from the top of my head:
- A dedicated pip subcommand?
- A build backend hook in setuptools, or a standalone project? This adds an additional probability a the package author can add appropriate configuration in pyproject.toml to fully automate the process.
I am quite interested in looking into this topic myself, since Windows setup is really a pain when teaching newcomers. Windows is so often (unfairly, IMO) viewed as inferior when a user needs to manually install additional hundreds MBs of things to the machine, while other platforms seem to “just work” (not because they don’t need to, but have a more straightforward way to install them before the user notices).