-
-
Notifications
You must be signed in to change notification settings - Fork 62
MNT: Stop writing package.cfg on import #509
Conversation
@@ -17,36 +17,9 @@ | |||
|
|||
if not _ASTROPY_SETUP_: # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the _ASTROPY_SETUP_
stuff can also be removed, no more useful since astropy-helpers removal, @astrofrog ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct - the stuff inside the if statement should not be removed but doesn't need to be in an if statement anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I removed _ASTROPY_SETUP_
. Please double check. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
# Create the test function for self test | ||
from astropy.tests.runner import TestRunner | ||
test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) | ||
test.__test__ = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why this line is needed and if we can avoid it, but beyond scope of this PR 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test.__test__
is already set to False in the make_test_runner_in
method (https://github.com/astropy/astropy/blob/main/astropy/tests/runner.py#L275), so I think it can be removed.
The __test__
attribute is used prevent pytest
from discovering this as a class to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
# Create the test function for self test | ||
from astropy.tests.runner import TestRunner | ||
test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) | ||
__all__ += ['test'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can now just add this to all at the top (it was here before because of the 'if' statement)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I just delete this whole file while I am at it? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.s. Done.
Fix #508
See astropy/astropy#11497