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

Add automatic version #21

Merged
merged 4 commits into from
Dec 17, 2019
Merged

Add automatic version #21

merged 4 commits into from
Dec 17, 2019

Conversation

rlopezcoto
Copy link
Contributor

Add automatic version loading as in ctapipe and cta-lstchain with the version.py file

@rlopezcoto rlopezcoto merged commit 2b8fec9 into master Dec 17, 2019
@rlopezcoto rlopezcoto deleted the version branch December 17, 2019 08:12
@maxnoe
Copy link
Member

maxnoe commented Dec 17, 2019

This is not good!

Importing a module in setup.py that directly imports dependencies makes it impossible for setuptools to install those dependencies. Running pip install will directly fail with an import error.

@rlopezcoto
Copy link
Contributor Author

Do you refer to the import of ctapipe_io_lst?
it's been working like this for lstchain up to now, but we can modify it, can you work out a suggestion that we can add here and in lstchain?
Thanks!

@maxnoe
Copy link
Member

maxnoe commented Dec 17, 2019

Probably because you installed all dependencies before by hand. But running pip install . now raises import errors for e.g. numpy if in a fresh environment.

The import makes it impossible for setuptools to install the dependencies listed in install_requires before importing the package:

$ pip install .
Processing /home/maxnoe/Uni/CTA/ctapipe_io_lst
    ERROR: Command errored out with exit status 1:
     command: /home/maxnoe/.local/anaconda3/envs/test/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-k1ljh_jn/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-k1ljh_jn/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-req-build-k1ljh_jn/pip-egg-info
         cwd: /tmp/pip-req-build-k1ljh_jn/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-k1ljh_jn/setup.py", line 3, in <module>
        import ctapipe_io_lst
      File "/tmp/pip-req-build-k1ljh_jn/ctapipe_io_lst/__init__.py", line 7, in <module>
        import numpy as np
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This should not happen!

@rlopezcoto
Copy link
Contributor Author

ok, I see, thanks again for reporting. It would be great if you could work out a solution, but if you cannot make it, I'll give it a try because we need a new release of the repo to read all new data. Are you working on something @maxnoe ?

@maxnoe
Copy link
Member

maxnoe commented Dec 17, 2019

Yes, I'll get back to you.

@maxnoe
Copy link
Member

maxnoe commented Dec 17, 2019

See #22

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

Successfully merging this pull request may close these issues.

3 participants