Python plugins fails to build a snap when some parts depends on unpublished modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
High
|
Sergio Schvezov |
Bug Description
Hello,
I described the full case here: https:/
To sum up, let's suppose that you have two python projects, project1 and project2, lying in the same GIT repository. You are building a snap that consists in two parts, one for each project.
However, project2 depends on project1 in its current state, with new features added in project2 that are not yet release. Typically project2 will declare a dependency project1>=0.1.dev0.
Out of the snaps, this situation is OK for pip, since it will install project1 in the local site package, then will successfully install project2 since a compatible version of project1 is already available. However, snapcraft will fail in the same situation, complaining that it cannot find the required version of project1 in PyPI.
I checked the code of python plugin. In theory nothing prevents snapcraft to do the same thing than pip, since the sitecustomize module is properly set up to find packages from the other parts already compiled.
However, the root cause here is this line of code: https:/
This line ask to invoke `pip download` for the set of requirements declared by a given part. And it will fail because it cannot find the required version for project1.
Funny thing is that in fact, the snap would be built perfectly without this, since the invocation of `pip install` after will successfully find the packages from the already installed snaps.
I made a showcase project (python projects + snapcraf.yml) that focuses on this error, if someone wants a clear target to fix this: https:/
I am available for any question on that matter.
Regards,
Adrien Ferrand
Changed in snapcraft: | |
importance: | Undecided → High |
status: | New → In Progress |
assignee: | nobody → Sergio Schvezov (sergiusens) |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
WIP proposal https:/ /github. com/snapcore/ snapcraft/ pull/2771