mxcube / mxcubeweb

MXCuBE-Web
http://mxcube.github.io/mxcubeweb/
GNU Lesser General Public License v3.0
21 stars 38 forks source link

Export Python dependencies as *pip* `requirements.txt` #1268

Closed fabcor-maxiv closed 1 month ago

fabcor-maxiv commented 3 months ago

It seems like for some facilities (including us at MAXIV to some extent), it is more practical to install MXCuBE-Web with pip (instead of Poetry).

As explained in Deployment (permalink), the issue is that by installing with pip we lose the advantage of Poetry's lockfile (pip can not read Poetry's lockfile so it ignores it). This results in unpinned dependencies being installed during deployment to production, and potential issues...

We can take advantage of Poetry's export command and the pre-commit hooks to automatically generate a requirements.txt file that contains the pinned dependencies and that pip can read. This could help provide repeatable installations in production environments.

marcus-oscarsson commented 3 months ago

Great idea !