Pybuild plugin for flit
This merge request adds a new pybuild plugin for packages that use flit. While there are not many packages that could make use of this right now (there are two: pep517 and jeepney), moving towards being able to build Debian packages based on pyproject.toml is a good step forward for the future.
Other than additions to the pybuild man page there are no changes other than addition of the new plugin.
Testing: I converted pep517, jeepney, and flit to use the plugin and other than having a dist-info directory rather than a since distutils style file, the packages are the same.
Flit is not a candidate for using the plugin in the archive because of a potential bootstrapping problem (currently flit uses flit from the uploaded package to build itself, so no external bootstrapping is required), testing with it enabled me to test that installing scripts in /usr/bin works correctly.
Jeepney uses the pybuild testing features, so I was able to verify that works with a flit package.
The flit plugin is only targeted for python3, but I did build a package that still built for python2 to make sure there wasn't any regression. I also ran the autopkgtest and it passed.
Please let me know if you need anything else.
Scott K
Merge request reports
Activity
- dhpython/build/plugin_flit.py 0 → 100644
98 install_kwargs = {'user': False, 'symlink': False, 'deps': 'none' } 99 DebianInstaller.from_ini_path(my_dir / 'pyproject.toml', **install_kwargs).install_directly(args['build_dir'], '') 100 # These get byte compiled too, although it's not logged. 101 return 0 # Not needed for flit 102 103 def install(self, context, args): 104 log.debug("pybuild plugin flit install") 105 log.debug("args %s", args) 106 my_dir = Path(args['dir']) 107 install_kwargs = {'user': False, 'symlink': False, 'deps': 'none' } 108 DebianInstaller.from_ini_path(my_dir / 'pyproject.toml', **install_kwargs).install_directly(args['destdir'], args['install_dir']) 109 return 0 #'{interpreter.binary_dv} {setup_py} install --root {destdir} {args}' 110 111 @shell_command 112 @copy_test_files() 113 def test(self, context, args): First, I notice that on line 109 I forgot to clean up the comment.
configure, build, and install all raise not implemented errors in the base class, so something needs to be there.
Somehow the files need to get from the .pybuild directory to the install directory and this seemed as reasonable a way to do it as any. Originally I skipped over the .pybuild directory and just installed straight to the install_dir, but then tests didn't work, so here we are.
Scott K
- dhpython/build/plugin_flit.py 0 → 100644
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 # THE SOFTWARE. 21 22 import logging 23 from glob import glob1 24 from os import remove 25 from os.path import exists, isdir, join 26 from dhpython.build.base import Base, shell_command, copy_test_files 27 28 log = logging.getLogger('dhpython') 29 30 import os could you merge (this one and below) with above imports? (so that PEP8 checkers are happy :)
Edited by Piotr Ożarowski
added 1 commit
- f5c396b1 - Update plugin_flit.detect comment and more pep8
added 1 commit
- a33413b0 - Update documentation now that FLT_ROOT_INSTALL isn't needed