Building a core20 python snap using pyproject.toml

Hi, I’m trying to build a snap of a python project that only provides a pyproject.toml file, is this understood by snapcraft? The naive thing I did to specify plugin: python runs but it doesn’t seem to do anything with the source at all.

This is a shortened version of the snapcraft.yaml:

...
parts:
  streamdeck-ui:
    plugin: python
    source: https://github.com/timothycrosley/streamdeck-ui.git
    build-packages:
      - libudev-dev
      - libusb-1.0-0-dev
    stage-packages:
      - libhidapi-hidraw0

it builds without errors, but doesn’t seem to produce any of the streamdeck related files.

2 Likes

FWIW, @cjp256 provided me with a workaround to convert the pyproject.toml to a setuppy like so:

  streamdeck-ui:
    after: [desktop-qt5]
    plugin: python
    source: https://github.com/timothycrosley/streamdeck-ui.git
    build-packages:
      - libudev-dev
      - libusb-1.0-0-dev
      - python3-pip
    stage-packages:
      - libhidapi-hidraw0
    override-build: |
      pip3 install --user dephell[full]
      PATH=$HOME/.local/bin:$PATH dephell deps convert --from-path pyproject.toml --from-format poetry --to-path setup.py --to-format setuppy
      snapcraftctl build
1 Like

I would like to confirm that your workaround works as well for the OCRmyPDF project. Thanks for the info.

I’ve made a patch that may solve this problem: