PYYAML hates me and my Flatpak project

So, I’m attempting to make a Flatpak of the Amulet Minecraft Map Editor. I feed my requirements.txt to flatpak-pip-generator, save the output (in YAML) to amulet.yml, and run this:

flatpak-builder --sandbox --user --install-deps-from=flathub --mirror-screenshots-url=https://dl.flathub.org/media/ --add-tag=0.10.35 --bundle-sources --repo=amulet_flatpak_repo amulet_build_dir amulet.yml --force-clean

And it after a while, it fails on pyyaml:

========================================================================
Building module python3-pre-commit in /home/evilsupahfly/Downloads/Amulet/.flatpak-builder/build/python3-pre-commit-1
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pre-commit>=1.11.1" --report=pip_report.json --no-build-isolation
Using pip 24.1.2 from /usr/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: file:///run/build/python3-pre-commit
Processing ./pre_commit-3.8.0-py2.py3-none-any.whl
Processing ./cfgv-3.4.0-py2.py3-none-any.whl (from pre-commit>=1.11.1)
Processing ./identify-2.6.0-py2.py3-none-any.whl (from pre-commit>=1.11.1)
Processing ./nodeenv-1.9.1-py2.py3-none-any.whl (from pre-commit>=1.11.1)
INFO: pip is looking at multiple versions of pre-commit to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement pyyaml>=5.1 (from pre-commit) (from versions: none)
ERROR: No matching distribution found for pyyaml>=5.1
Error: module python3-pre-commit: Child process exited with code 1

Can anybody tell me why PyYAML hates me?

Edit: I wasn’t spamming. I was asking for help.

Seems like an issue with the order. It’s probably trying to install pre-commit before installing pyyaml, but the former depends on the latter.

1 Like

I’ll switch up the order then and see what happens.

Using my new requirements.txt, I have a new amulet.yml. and I’m still up against the wall:

========================================================================
Building module python3-pyyaml in /home/evilsupahfly/Downloads/Amulet/.flatpak-builder/build/python3-pyyaml-6
========================================================================
Running: pip3 install --verbose --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pyyaml==6.0.2" --report=pip_report.json --no-build-isolation
FB: Running: flatpak build --die-with-parent --env=FLATPAK_BUILDER_BUILDDIR=/run/build/python3-pyyaml --nofilesystem=host:reset --filesystem=/home/evilsupahfly/Downloads/Amulet/.flatpak-builder/build/python3-pyyaml-6 --bind-mount=/run/build/python3-pyyaml=/home/evilsupahfly/Downloads/Amulet/.flatpak-builder/build/python3-pyyaml-6 --build-dir=/run/build/python3-pyyaml --bind-mount=/run/ccache=/home/evilsupahfly/Downloads/Amulet/.flatpak-builder/ccache --env=SOURCE_DATE_EPOCH=1723521830 '--env=CFLAGS=-O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=CXXFLAGS=-O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=LDFLAGS=-L/app/lib -Wl,-z,relro,-z,now -Wl,--as-needed ' --env=CCACHE_DIR=/run/ccache/disabled --env=PATH=/app/bin:/usr/bin --env=LD_LIBRARY_PATH=/app/lib --env=PKG_CONFIG_PATH=/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig --env=FLATPAK_BUILDER_N_JOBS=8 /home/evilsupahfly/Downloads/Amulet/.flatpak-builder/rofiles/rofiles-CdIlSx /bin/sh -c 'pip3 install --verbose --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pyyaml==6.0.2" --report=pip_report.json --no-build-isolation'
Using pip 24.1.2 from /usr/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: file:///run/build/python3-pyyaml
ERROR: Could not find a version that satisfies the requirement pyyaml==6.0.2 (from versions: none)
ERROR: No matching distribution found for pyyaml==6.0.2
Error: module python3-pyyaml: Child process exited with code 1
FB: Unmounting read-only fs: fusermount -uz /home/evilsupahfly/Downloads/Amulet/.flatpak-builder/rofiles/rofiles-CdIlSx

This time I manually edited amulet.yml to fill out the pyyaml section and ran with the --verbose flag to see if I could get anything more useful.

Before:

  - name: python3-pyyaml
    buildsystem: simple
    build-commands:
      - pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}"
        --prefix=${FLATPAK_DEST} "pyyaml~=6.0" --report=pip_report.json --no-build-isolation
    sources: []

After:

  - name: python3-pyyaml
    buildsystem: simple
    build-commands: 
      - pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}"
        --prefix=${FLATPAK_DEST} "pyyaml==6.0.2" --report=pip_report.json --no-build-isolation
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/6b/4e/1523cb902fd98355e2e9ea5e5eb237cbc5f3ad5f3075fa65087aa0ecb669/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
        sha256: ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed

Edit: There’s a ton of info on pypi.org and I don’t know if it’s being somehow missed or just ignored but even my manual override failed.

Edit 2: I don’t know why this was flagged as spam. I didn’t do anything spammy.

url: https://files.pythonhosted.org/packages/6b/4e/1523cb902fd98355e2e9ea5e5eb237cbc5f3ad5f3075fa65087aa0ecb669/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Freedesktop SDK has python 3.11, you are using a wheel for python 3.10

If you want to use wheels choose the correct one https://files.pythonhosted.org/packages/67/a4/1f5fbd3f58d4069000522196b0b776a014f3feec1796da03e495cf23532d/lxml-5.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Or use the sdist https://files.pythonhosted.org/packages/e7/6b/20c3a4b24751377aaa6307eb230b66701024012c29dd374999cc92983269/lxml-5.3.0.tar.gz

1 Like

lxml isn’t pyyaml but I see from your example how they’ve included the Python version as part of the filename, which I didn’t realize. Or just didn’t see.

We’ll try again with

    build-commands:
      - pip3 install --verbose --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST}
        "pyyaml==6.0.2" --report=pip_report.json --no-build-isolation
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/75/e4/2c27590dfc9992f73aabbeb9241ae20220bd9452df27483b6e56d3975cc5/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
        sha256: 3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85

Ah yea I was thinking about something else and misread it for pyyaml.

1 Like

Thanks to you pointing out the fact that I was calling version, after correcting it, we’re back in business and no more crashing!

I still don’t know why it wasn’t able to do it itself, but that’s something I can look at later, now that it’s working.

Why was this thread flagged as spam?!

This new user tried to create multiple posts with links to the same domain. All posts from this user that include links should be reviewed

Standard spam protection

I would think pastebin would be exempt from that rule, given how instrumental it is in keeping posts looking clean and tidy, but I’ll be mindful of this going forward.