pylhc / omc3

Python 3 codes for beam optics measurements and corrections in circular particle accelerators

Home Page:https://pylhc.github.io/omc3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup extra dependencies for technical network fonctionality

fsoubelet opened this issue · comments

Since January, pyjapc, cmmnbuild-dep-manager, pjlsa, jpype1 and pytimber are not installable from PyPI anymore, and should be installed directly from the acc-py PI. The corresponding packages found on PyPI are placeholders left there to avoid shadow clones and are setup to fail at the installation step (see error below for pytimber for instance).

ERROR: Command errored out with exit status 1:
     command: /opt/hostedtoolcache/Python/3.8.7/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l60xkecp/pytimber_4ea8fc7596ab4645b2ea167b2ff7d93d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l60xkecp/pytimber_4ea8fc7596ab4645b2ea167b2ff7d93d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-z74pg7pe
         cwd: /tmp/pip-install-l60xkecp/pytimber_4ea8fc7596ab4645b2ea167b2ff7d93d/
    Complete output (13 lines):
    
    ***
    
    Please install the `pytimber` package
    
    using the https://acc-py-repo.cern.ch package index.
    
    Additional information can be found in:
    
    https://wikis.cern.ch/pages/viewpage.action?pageId=145493385
    
    ***

The proper command withpip would then be:

pip install --index-url https://acc-py-repo.cern.ch/repository/vr-py-releases/simple --trusted-host acc-py-repo.cern.ch pytimber

However, since the acc-py PI is not accessible from outside the CERN network, that is not a solution for our CI.
As discussed today with Phil Elson, the best solution for now would be to declare these as optional dependencies, which will be fine for installation, and fine when deploying to PyPI as long as the placeholders are found there.

Checklist:

  • Check that CI workflows work fine.
  • Document the caveat.
  • Failsafe the imports of pytimber functionality in omc3 (currently only in omc3.tune_analysis.timber_extract.py, which is only imported in omc3.amplitude_detuning_analysis.py.

Related:

  • Specify source="nxcals" when declaring db = pytimber.LoggingDB(), since the change from CALS to NXCALS.has been made.

Input welcome.