Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

MNT: Stop writing package.cfg on import #509

Merged
merged 4 commits into from
Apr 13, 2021

Conversation

pllim
Copy link
Member

@pllim pllim commented Apr 8, 2021

@@ -17,36 +17,9 @@

if not _ASTROPY_SETUP_: # noqa
Copy link
Contributor

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 ?

Copy link
Member

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

Copy link
Member Author

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!

Copy link
Member

@astrofrog astrofrog left a 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
Copy link
Member

@astrofrog astrofrog Apr 12, 2021

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 😉

Copy link
Member

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.

Copy link
Member Author

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']
Copy link
Member

@astrofrog astrofrog Apr 13, 2021

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)

Copy link
Member Author

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? 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

p.s. Done.

@larrybradley larrybradley merged commit c2e3496 into astropy:cookiecutter Apr 13, 2021
@pllim pllim deleted the rm-config-stuff branch April 13, 2021 19:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MNT: Stop using update_default_config and ConfigurationMissingWarning
4 participants