Skip to content

astropy 0.2 tests write to site-packages for Python 3 - #811

Merged
embray merged 3 commits into
astropy:masterfrom
embray:issue-811
May 18, 2013
Merged

embray merged 3 commits into
astropy:masterfrom
embray:issue-811

Conversation

@embray

@embray embray commented May 18, 2013

Copy link
Copy Markdown
Member

I have astropy 0.2 installed on Mac via Macports and sudo in /opt/local/.
When I try to run the tests as a normal user (without sudo) it fails because of permission problems, I think when it tries to write to the site-packages directory (full log):

$ python3.2 -c 'import astropy; astropy.test()'
...
E   IOError: [Errno 13] Permission denied: '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/astropy/config/tests/__pycache__/test_configs.cpython-32-PYTEST.pyc.37153'
___ ERROR collecting ../../opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/astropy/constants/tests/test_constant.py ___
...
E   IOError: [Errno 13] Permission denied: '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/astropy/wcs/tests/__pycache__/test_wcsprm.cpython-32-PYTEST.pyc.37153'
================================================================== 83 error in 6.01 seconds ==================================================================

I guess a user should be able to test a system-installed astropy?

@cdeil

cdeil commented Feb 23, 2013

Copy link
Copy Markdown
Member Author

I see the problem mentioned above only with Python 3.2 and 3.3.

With Python 3.1 all tests pass. (Well, there were unrelated test errors on my Mac OS X 10.7 machine, which I couldn't reproduce by re-running the tests again, see log here. But no-one cares about Python 3.1 anyways ... )

@embray

embray commented Feb 25, 2013

Copy link
Copy Markdown
Member

That's bizarre. I don't think I've ever seen anything like that.

@cdeil

cdeil commented Feb 25, 2013

Copy link
Copy Markdown
Member Author

@iguananaut Can you reproduce the issue? (I don't think it's Mac-specific, but I haven't tried Linux.)

@eteq

eteq commented Feb 26, 2013

Copy link
Copy Markdown
Member

I can reproduce this on OS X 10.8 (also on macports py3.3).

@embray

embray commented Feb 26, 2013

Copy link
Copy Markdown
Member

Well, I tried setting installing Astropy and then setting its install location to read-only and got different permission denied errors specifically in some of the FITS tests. Which is odd because the files the tests are trying to create are under /tmp so I don't know why it would get permission denied.

@embray

embray commented Feb 26, 2013

Copy link
Copy Markdown
Member

I see the problem from the FITS end of things. The tests that are failing are copying original versions of the files from the installed location but preserving their permissions. It should not preserve permissions when doing those copies. That's still a slightly different issue from this one, however.

@eteq

eteq commented Feb 27, 2013

Copy link
Copy Markdown
Member

I can confirm this also happens on Linux (Linux Mint 14, to be precise).

@embray

embray commented May 17, 2013

Copy link
Copy Markdown
Member

Turns out this is an upstream issue in py.test that still hasn't been fixed: https://bitbucket.org/hpk42/pytest/issue/112/permission-denied-with-python32

I think I have a potential workaround for now.

@embray

embray commented May 18, 2013

Copy link
Copy Markdown
Member

Welp. This fixes it for me. And Travis seemed to be alright with it, so I'm going to go with this.

Comment thread astropy/tests/helper.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth having a one-sentence description of the bug.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

embray added 3 commits May 18, 2013 12:05
…ternal function in py.test :( I'll see if we can get this fixed upstream and then when we next upgrade py.test we can take this out.
embray added a commit that referenced this pull request May 18, 2013
astropy 0.2 tests write to site-packages for Python 3
@embray
embray merged commit 0feb25a into astropy:master May 18, 2013
@embray
embray deleted the issue-811 branch May 18, 2013 17:12
embray added a commit that referenced this pull request May 18, 2013
astropy 0.2 tests write to site-packages for Python 3
@astrofrog astrofrog mentioned this pull request Jan 20, 2017
6 tasks done
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.

4 participants