Add tags of packages to requirements file
@ahmedk @kamile @kluyvert @tmichela @santosh
This MR stays to improve reproducibility.
A tag for each package is added. Tags here are based on current environment.
I additional I add pyDetLib in the requirements. PyDetLib have its own requirements file. In order to trigger that file I included requirements in the setup file of the pyDetLib (see branch https://git.xfel.eu/gitlab/karaboDevices/pyDetLib/tree/feat/update_setup).
This MR should be considered together (and goes after) with https://git.xfel.eu/gitlab/karaboDevices/pyDetLib/merge_requests/76.
Merge request reports
Activity
- Resolved by Mikhail Karnevskiy
Setup file of the pyDetLib requires numpy and Cython
So long as we are using a moderately recent version of pip, we can define Cython and numpy as build dependencies in
pyproject.toml
:[build-system] build-backend = "setuptools.build_meta:__legacy__" requires = ["setuptools", "wheel", "cython", "numpy"]
Then, when you
pip install
pyDetLib from source, pip will install those dependencies in a temporary environment to build it with.We'll need to ensure that it doesn't build against a newer numpy than the version it will be installed with, probably by explicitly selecting an older version of numpy in the list above - like
"numpy<1.17"
or"numpy==1.16.6"
.
2 git+https://haufs:s--zGku2dzxtv6so2xsu@git.xfel.eu/gitlab/detectors/cal_db_interactive.git 3 fabio 4 pypandoc 5 nbconvert 6 astcheck 7 astsearch 8 influxdb 9 tabulate 10 h5py 11 unittest-xml-reporting 12 zmq 13 lxml 14 gitpython 15 karabo_data 2 git+https://haufs:s--zGku2dzxtv6so2xsu@git.xfel.eu/gitlab/detectors/cal_db_interactive.git@1.5.0 3 git+https://haufs:s--zGku2dzxtv6so2xsu@git.xfel.eu/gitlab/karaboDevices/pyDetLib@test_001#subdirectory=lib changed this line in version 2 of the diff
- Resolved by Mikhail Karnevskiy
@kluyvert I have another question. Is it fine have have requirements file with strict definition of tags (I mean == instead of >=). This may version conflicts if somebody is using pycalibration and have other packages installed.
What is the general recommendations on this point?
The general recommendation is that libraries should have loosely specified dependencies (e.g.
>=2.5
or>=2.5, <3
) insetup.py
, and applications should have pinned dependencies (like==2.6.3
), either insetup.py
orrequirements.txt
depending on how it's deployed. An application is the set of packages which get deployed and used together.For us, pyDetLib would clearly be a library. Then we could either say:
- pycalibration is another library, and we have a
requirements.txt
file somewhere for the offline calibration pipeline which specifies versions of everything (including pycalibration) - OR pycalibration is the application for offline calibration, and that specifies dependencies with specific versions
More info: https://caremad.io/posts/2013/07/setup-vs-requirement/
(Finally, if we really want to get into this,
requirements.txt
files are a fairly basic option. Newer tools like Poetry take a set of loosely defined requirements and create a 'lock file' with specific versions of all packages involved. Robert Rosca will tell you more about this with his trademark enthusiasm if you're interested ;-). But it's a bit of a jump to get used to.)- pycalibration is another library, and we have a
The packages are mostly in alphabetical order with a few exceptions. Let's fix the exceptions, because it's much easier to spot things when they're in order.
As we're fixing versions of the internal packages anyway, why don't we make some packages of them, put them somewhere on Maxwell and install from there? Then we can avoid needing any kind of password or access token. We have a folder
/gpfs/exfel/sw/software
which the DA team can put things in.
@kluyvert I updated requirements file and test it. Installation went fine.
The requirement file have in general an alphabetic order. First 3 lines correspond to tools installed from software folder. Last lines correspond to local package cal_tools. Any comments to this?
mentioned in commit d0bd25ec