flatpak-builder-tools icon indicating copy to clipboard operation
flatpak-builder-tools copied to clipboard

pip: topologically sort generated modules based on dependencies

Open razzeee opened this issue 3 months ago • 6 comments

razzeee avatar Nov 19 '25 07:11 razzeee

What is this for?

bbhtt avatar Nov 19 '25 12:11 bbhtt

What is this for?

This correctly orders the packages e.g. with https://github.com/flathub/org.pgadmin.pgadmin4/pull/53 I need to do some manual steps after creating the pip file.

  1. Fix ordering in one instance
  2. Add backports_zstd (python version depended)

This fixes step 1 right now

razzeee avatar Nov 19 '25 13:11 razzeee

The link isn't telling me much. What was sorted incorrectly before?

bbhtt avatar Nov 19 '25 14:11 bbhtt

In that example, python3-passlib gets put behind python3-paramiko

If I move it to the location on the left, it will work

image

Otherwise it fails with:

Requirement already satisfied: markupsafe>=2.1.0 in /usr/lib/python3.12/site-packages (from Flask-Security-Too==5.6.*) (3.0.3)
INFO: pip is looking at multiple versions of flask-security-too to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement passlib>=1.7.4; python_version < "3.13" (from flask-security-too) (from versions: none)
ERROR: No matching distribution found for passlib>=1.7.4; python_version < "3.13"

razzeee avatar Nov 19 '25 23:11 razzeee

Which points to https://github.com/pallets-eco/flask-security/blob/5.6.2/pyproject-too.toml#L46 as the reason. I guess being able to just call the app, with the targeted python version would be better, but that has it's own problems.

razzeee avatar Nov 19 '25 23:11 razzeee

That is not happening due to sorting but the environment constraint.

bbhtt avatar Nov 20 '25 00:11 bbhtt