Skip to content
Snippets Groups Projects

Pybuild plugin for flit

Closed Scott Kitterman requested to merge pep517 into master
3 unresolved threads

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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):
  • is this override needed? (just a quick look, didn't test it yet, sorry)

  • 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

  • Please register or sign in to reply
  • Piotr Ożarowski
    Piotr Ożarowski @piotr started a thread on commit 43795bb4
  • 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
  • added 1 commit

    Compare with previous version

  • Pep8 is totally happy now.

  • added 1 commit

    • 5385143e - Add support for flit plugin autodetection

    Compare with previous version

  • Auto detection works now. If flit and python3-toml are installed, detect will check pyproject.toml to see if the package was built with flit. For other, non-flit packages with pyproject.toml, the distutils plugin will still score higher.

  • added 1 commit

    • f5c396b1 - Update plugin_flit.detect comment and more pep8

    Compare with previous version

  • I don't have any other changes planned. Ideally I'd like to figure out how to avoid having to set FLIT_ROOT_INSTALL, but that would take an upstream flit change as far as I can tell. Ready for merging.

  • Actually I changed my mind. The FLIT_ROOT_INSTALL thing is too ugly to exist. I'm about to upload a patched flit so we can avoid it. I'll update the docs for this shortly.

  • added 1 commit

    • a33413b0 - Update documentation now that FLT_ROOT_INSTALL isn't needed

    Compare with previous version

  • There. To test this you'll need at least flit 2.3.0-2.

  • I merged it (with some tiny changes). Thanks!

  • Thanks. I've checked and those are definitely improvements.

  • Please register or sign in to reply
    Loading