[INSTRM-1047] Problems installing pfs_utils package Created: 08/Aug/20  Updated: 07/Sep/21  Resolved: 07/Sep/21

Status: Done
Project: Instrument control development
Component/s: pfs_utils
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Martin Reinecke Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

(This is almost a verbatim copy of an email I sent to Craig and Robert some time ago; at that time I couldn't open issues on JIRA. Please excuse me if I'm filing this in the wrong category ... I'm not yet completely familiar with the internal organization...)

The packages ets_fiberalloc and ets_shuffle are going to depend on pfs_utils for coordinate conversions in the future. In preparation for that I tried to install the package locally. This requires scons, which was not a problem to install.
It also depends in lsst.sconsUtils, which I cloned from Github. Here the trouble started. The "scons" command for lsst.sconsUtils insists on calling "pytest" (hardwired), which is called "pytest-3" on my machine. I managed to adjust this, but now I get

 

running global pytest...
ERROR: usage: pytest-3 [options] [file_or_dir] [file_or_dir] [...]
pytest-3: error: unrecognized arguments:
--session2file=tests/.tests/pytest-sconsUtils.xml.out
 inifile: None
 rootdir: /home/martin/codes/sconsUtils

Do you have any advice how to proceed?



 Comments   
Comment by cloomis [ 11/Aug/20 ]

So what do we do about this PITA? As a reminder, pfs_utils is the package dedicated to code shared between the ICS and DRP worlds (fiber id mappings, core coordinate transforms, etc), and was supposed to not require any other ICS or DRP packages.

But for DRP (scons) installation and CI testing, sconsUtils has been added, which drags in a bunch of DRP infrastructure. Instead of being a trivial to install standalone package, it forces everyone to install some part of the Rubin universe. Subaru ICS, MPA, ASRD are the

So pull sconsUtils out? Add it and its friends as a requirement? The LSST requirement on some utterly antique pytest and thus attrs has already given us (ICS) trouble; with my ICS hat on I am very disinclined to buy into any more dependencies.

Comment by Martin Reinecke [ 11/Aug/20 ]

If it helps, this is not really urgent on my side. I currently just copy the Python files to a place where the interpreter finds them.

Perhaps it would already be sufficient to add a very basic setup.py.

Comment by cloomis [ 11/Aug/20 ]

Agreed on adding basic setup.py.

Comment by Martin Reinecke [ 30/Nov/20 ]

I'm encountering the same problem with "datamodel". It would be really great if this issue could be addressed for all concerned packages.

In the meantime I'll have to copy Python files around by hand...

Comment by hassan [ 30/Nov/20 ]

Martin Reinecke: Can you provide the most recent steps you made, and a copy of the error message you saw please?

Comment by Martin Reinecke [ 30/Nov/20 ]

It's not so much a matter of commands failing, but rather of no well-defined installation procedure existing.

As I mentioned in the first post, I'm not aware of any document describing how these packages should be installed. I tried finding out by myself, but it requires manual installation of a not very common build tool (scons), then additionally cloning lsst.sconsUtils (also manually). Last time I tried, the package didn't install even then, but that's not really the essence of this issue.

The proposed solution (add a simple setup.py script) seems to have general agreement, but it's not implemented yet.

 

Comment by cloomis [ 02/Dec/20 ]

I will back off the setup.py suggestion and push for using requiring basic eups instead. Basically, all the PFS packages (both ICS and DRP) use a package directory tree which does not work well with the python setuptool/distutils/pkg_resources policies. Specifically, we expect a top-level directory with bin/, etc/, docs/, python/pfs/utils/, data/, examples/, etc. in it, and use our own mechanism to adjust PYTHONPATH and PATH to match. The builtin tools put the content of our python directory into ...../site-packages/, merging all pfs packages into that, and leave PYTHONPATH alone. Extra files and directories are put in other, non-site-packages directories.

This matters for pfs_utils, which includes some stable but essential data files in data/fiberids/, and which are found by using eups routines.

One could certainly argue that what we do is not what one would start with in 2020, but we started much earlier and this is what we have. We can semi-cheat and get something close to what PFS does, but not without depending on undocumented behavior. Using bare-bones eups ("setup -r .") seems like a not-insane middle ground.

OK, so eups. I think there are some basic intro docs both in the Rubin/HSC and the PFS worlds. Someone might have a decent pointer....

Comment by Martin Reinecke [ 15/Mar/21 ]

I have added a skeleton `setup.py` file on the tickets/INSTRM-1047 branch of the datamodel repo, which does the trick for me. I also see that cloomis has been working on this for pfs_utils, but I don't manage to get his solution to work for me yet.

If wanted, I can provide a simple setup.py script for pfs_utils as well. Please let me know!

Comment by Martin Reinecke [ 16/Mar/21 ]

I took the liberty of pushing a setup.py file to the tickets/INSTRM-1047 branch of the pfs_utils repository. Please feel free to remove it again if a different sort of solution is desired!

Comment by rhl [ 06/Sep/21 ]

What still needs to happen to close this ticket and merge the changes?

Comment by price [ 07/Sep/21 ]

I merged datamodel and pfs_utils.

Comment by Martin Reinecke [ 07/Sep/21 ]

Thank you!

Comment by rhl [ 07/Sep/21 ]

Can we close this ticket?

Comment by Martin Reinecke [ 07/Sep/21 ]

I'd say yes. If anything else turns up, we can open another one.

Comment by Martin Reinecke [ 07/Sep/21 ]

Do I have to do special Jira magic so that it can be closed?

Generated at Fri Apr 18 12:37:55 JST 2025 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.