Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need to setup.py install the pysparc package? #54

Open
davidfokkema opened this issue Aug 1, 2018 · 7 comments
Open

Do we need to setup.py install the pysparc package? #54

davidfokkema opened this issue Aug 1, 2018 · 7 comments
Labels

Comments

@davidfokkema
Copy link
Member

Currently we do this on the raspberry pi's.

@153957
Copy link
Member

153957 commented Aug 1, 2018

Not a must, can just use pip install -e . instead of the python setup.py develop

@153957
Copy link
Member

153957 commented Aug 1, 2018

I would not get rid of the setup.py, it still helps define what the package is used for and what the requirements are. You could use a requirements.txt instead, but that would make it less explicit.

@davidfokkema
Copy link
Member Author

I'm not sure why we install the package at all. It runs (or I thought it did) from the checked out repository. But maybe it imports from the installed package. I'm not sure anymore.

@153957
Copy link
Member

153957 commented Aug 2, 2018

Supervisor just runs the DAQ from the checkedout bin directory:
https://github.com/HiSPARC/pysparc/blob/master/provisioning/supervisord-pysparc.conf#L2
But it imports pysparc:
https://github.com/HiSPARC/pysparc/blob/master/bin/pysparc_daq#L13-L17
So either the PYTHONPATH must be set correctly, or the package needs to be installed in the current env, which it currently does.

@davidfokkema
Copy link
Member Author

Hmmm. But currently I can change code in the repository and then run the script manually and the changes take effect. So, from where does it import modules in that case? I'd like to be able to do that (at least on development Pi's while the software is still young). So maybe not install the package at all? But do the import paths need to be different in a 'run from repo' situation as opposed to a 'run from installed version and place script in /usr/local/bin'? I need to read up on this.

@153957
Copy link
Member

153957 commented Aug 4, 2018

If you install with pip with -e it installs the project in an 'editable' fashion, so you can edit things without needing to reinstall, I guess somewhat the same as setup.py develop. I would still vote for installing the package. Additionally, I would advice on moving the 'bin' scripts into the project, and adding entry_points to the setup.py, similar to the current SAPPHiRE (HiSPARC/sapphire@5ae8bf9).

@davidfokkema
Copy link
Member Author

Time to wake up. This is what we did, yes:

command: /usr/bin/python setup.py develop chdir=/opt/pysparc
. Anyway, I'll look into entry_points, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants