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

Problem in version 2.0.0 #699

Closed
simontorres opened this issue Sep 3, 2019 · 4 comments · Fixed by #700
Closed

Problem in version 2.0.0 #699

simontorres opened this issue Sep 3, 2019 · 4 comments · Fixed by #700
Assignees

Comments

@simontorres
Copy link
Contributor

Summary

In my opinion a production package do not need to install all development tools. Or from another angle in test code you import from your source file but never in the other direction and this is happening in image_collection.py
References here are from master branch

from .tests.pytest_fixtures import directory_for_testing

And

def sample_directory_with_files():
"""
Returns the path to the small sample directory used
in the tests of ``ImageFileCollection``. Primarily intended
for use in the doctests.
"""
n_test, tmpdir = directory_for_testing()
return tmpdir

The problem here is that this will require pytest. We are working with containerized applications were you want to be as minimalist as possible.

Another option is that pytest should be in the included as a dependency. (installed automatically upon calling pip install ccdproc==2.0.0. However I would like to insist that importing from test is wrong.

Traceback (most recent call last):
  File "SQM.py", line 21, in <module>
    from goodman_focus.goodman_focus import GoodmanFocus
  File "/usr/local/lib/python3.7/site-packages/goodman_focus/goodman_focus.py", line 13, in <module>
    from ccdproc import CCDData
  File "/usr/local/lib/python3.7/site-packages/ccdproc/__init__.py", line 19, in <module>
    from .image_collection import *
  File "/usr/local/lib/python3.7/site-packages/ccdproc/image_collection.py", line 21, in <module>
    from .tests.pytest_fixtures import directory_for_testing
  File "/usr/local/lib/python3.7/site-packages/ccdproc/tests/pytest_fixtures.py", line 10, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'

My install_requires variable contains the following.

astropy>=3.2.1
matplotlib>=3.1.0
numpy>=1.16.4
pandas>=0.24.2
scipy>=1.3.0
ccdproc>=1.3.0.post1
sphinx>=2.1.2
@mwcraig mwcraig self-assigned this Sep 3, 2019
@MSeifert04
Copy link
Contributor

Thank you for the report. I agree that we shouldn't have test-dependencies in the production code.

@mwcraig
Copy link
Member

mwcraig commented Sep 3, 2019

Yeah, it turns out this is why all of our doc builds are breaking too. I can fix it in about 2 hours....

mwcraig added a commit to mwcraig/ccdproc that referenced this issue Sep 5, 2019
mwcraig added a commit that referenced this issue Sep 5, 2019
…owards-correct-code-but-i-have-my-doubts

Actually fix #699 by removing the offending import line
mwcraig added a commit that referenced this issue Sep 6, 2019
…owards-correct-code-but-i-have-my-doubts

Actually fix #699 by removing the offending import line
@mwcraig
Copy link
Member

mwcraig commented Sep 6, 2019

@simontorres -- 2.0.1 is on pypi and fixes this issue. Thanks for pointing it out!

@simontorres
Copy link
Contributor Author

Awesome! Thanks @mwcraig

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 a pull request may close this issue.

3 participants