-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Installing as a module from PyPI leaves installations vulnerable to bugs in dependencies #13315
Comments
Ideas for solving this:
|
If we do this, I think people will end up pip installing as long as there is a |
I wouldn't object to a situation where
but I don't know how easy that would be to orchestrate. |
Yes, but the first problem here is that we are actually recommending an approach that leaves people in a mess. It's entirely reasonable to address this in two steps (where the second step may or may not happen any time soon):
|
It seems surprising to me that there is no poetry-blessed way of doing this. |
python-poetry/poetry#2778 would help here. |
We'd better come up with a decent answer to #9944 if this is the route we want to take. |
There is an other option. |
A further option is that we could publish one package on pip that has locked deps (to support people that want to use Maybe I'm the only person using pip out of preference, but the above would at least seem to solve the situation. |
It might be instructive to look for other standaloneish applications distributed on PyPI and see what they do to handle this situation. I'm struggling to think of a good example though. (Jupyter, black, isort, mypy all sprang to mind, but they have to coexist with devtools so I imagine they have lax requirements.) |
I think other comparable standaloneish applications simply aren't distributed via PyPI, and people are expected to use docker images or os-specific packages. Which amounts to my first suggestion: "stop recommending pip as a way to install synapse, and support only docker/debs". |
Just to chime in here from a distribution packager's perspective: At least on FreeBSD we basically repackage the PyPI release, so locking dependencies on the released package would probably force us to move to the source release. We can, of course, always switch over and build our packages from there, but a minor heads-up would be appreciated if you go that route as that release doesn't provide a legacy setup.py that we currently rely on for reasons completely unrelated to the issue at hand. |
|
We distribute a locked requirements.txt but it is not easily scalable. Need to be able to generate a -frozen version of the wheel. Should be easily done by repackaging the wheel I guess. |
In general, I don't think it is the responsibility of synapse to save people from not having updated things that synapse depends on. Forcing dependencies for this causes a lot of trouble in packaging, and packaging is how almost all instances of widely-used software is used. I think synapse should consider packaging systems as the main target of releases. (That's avoiding specifics because I don't have them paged in, but this general issue has been a recurring problem.) |
We switched now to packaging our application using zipapp. This only requires a local interpreter. This is good solution to avoid dependency nightmare, and ensuring our user uses the same version of the dependencies we have carefully validated. |
One of our recommended installation methods suggests installing Synapse as a module from PyPI.
This works fine, but if one of our downstream dependencies has a bug (such as a security vulnerability) then it is difficult for administrators to know they need to update their installation. This in turn leads us to have to increase our minimum dependency versions (see #13172 for example), which makes things difficult for downstream packagers.
The text was updated successfully, but these errors were encountered: