takluyver / flit_install_py2

Shim to install packages using flit metadata on Python 2
MIT License
1 stars 3 forks source link

Needs updates post PEP518 #3

Closed wimglenn closed 2 months ago

wimglenn commented 5 years ago

Is this project dead? I started working over on https://github.com/wimglenn/flit_install_py2/commit/b4b6dc5dd2a03958f5129512b06a122d8b71820d but then gave up because of lack of existing tests, and a fear that this code maybe too old (has likely not kept up with other changes in flit).

Is there a better story for installing a cross-compat package in 2.7 environment to run the tests on travis-ci? Testing against the working directory is not an option for me, because the feature I needed (entrypoints) seems not there currently.

takluyver commented 5 years ago

Yeah, I haven't done anything with it for a long time. I made it possible for Flit to install into a version of Python other than the one it's running on (flit install --python path/to/python), which superseded this. But then that doesn't really work for PEP 518, because it's assumed that build dependencies can be installed with the same version of Python that's running the frontend tool (such as pip). It would be massively more complex if frontend tools had to to be able to prepare a build environment with a different Python version.

I haven't got a good answer for the brave new world of PEP 518 - you can't install a package from source on a version of Python older than the build tools support. I'm not interested in porting Flit back to Python 2, so packages supporting Python 2 either have to use another build system, or break installation from source.

wimglenn commented 5 years ago

Hmm. So what can you do in .travis.yml for the test-matrix of a cross-compat lib? Is the only solution now to create a distribution with a Python3 installation, and then install the built package into Python2 separate environment? It became a stumbling block for writing a pytest plugin which uses the pytest11 entry point to register the plugin with pytest https://github.com/wimglenn/pytest-raisin/

takluyver commented 5 years ago

Yeah, I can't think of anything better than that, I'm afraid. Or return to regular setup.py packaging.

wimglenn commented 5 years ago

Don't want to take a step backwards. So instead wrote flit6, which does the workaround described above. It requires something like this in the .travis.yml.

takluyver commented 5 years ago

Ha, that's a neat workaround. :-)