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

Use pytest-astropy-header for test header #436

Closed
wants to merge 5 commits into from

Conversation

pllim
Copy link
Member

@pllim pllim commented Oct 29, 2019

Address #435 for new package being created off the template. Does not fix the problem of existing packages that used the older template.

TODO:

  • Add PR number to change log

@pllim pllim added this to the v3.0 milestone Oct 29, 2019
@pllim pllim requested review from astrofrog, Cadair and bsipocz October 29, 2019 19:01
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

superficial review, we might need to go the other way around, require pytest-astropy-header, but not pytest-astropy

@@ -15,7 +15,7 @@ env:
- FOLDERNAME='packagename'
- PYTHON_VERSION=3.7
- CONDA_DEPENDENCIES='cython astropy sphinx'
- PIP_DEPENDENCIES='cookiecutter gitpython pytest-astropy sphinx-astropy'
- PIP_DEPENDENCIES='cookiecutter gitpython pytest-astropy pytest-astropy-header sphinx-astropy'
Copy link
Member

Choose a reason for hiding this comment

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

pytest-astropy should contain pytest-astropy-header

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it back in. For some reason, removing it caused Travis to fail for all but the last job. 🤷‍♀️

@@ -11,6 +11,7 @@ url = {{ cookiecutter.project_url }}
edit_on_github = {{ cookiecutter.edit_on_github_extension }}
github_project = {{ cookiecutter.github_project }}
python_requires = ">={{ cookiecutter.minimum_python_version }}"
tests_require = pytest; pytest-astropy; pytest-astropy-header
Copy link
Member

Choose a reason for hiding this comment

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

should pytest-astropy be a strict dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be with this patch because I removed the if ... else ... check, which I think is more complicated than it's worth.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but I think using pytest-astropy-header should just work for everything, isn't it (at least that was the reason I was pushing for having it as a separate plugin rather than shuffled into pytest-astropy)

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct. Theoretically it would work even if you have older astropy version, but that also makes it a compulsory dependency for tests. Or did I misunderstand your question?

Copy link
Member

Choose a reason for hiding this comment

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

no I think we're on the same page. But then we don't need to list pytest-astropy here, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah...

@pllim
Copy link
Member Author

pllim commented Oct 29, 2019

When I next have chance, I have to see why the tests failed with No module named 'pytest_astropy_header' 😱

@pllim
Copy link
Member Author

pllim commented Oct 30, 2019

The failure starts appearing after I removed pytest-astropy-header from .travis.yml. Maybe clearing the cache on Travis CI for this PR and then rebuilding it would solve the problem? But I don't see the button; maybe insufficient admin privilege. The other option is to add pytest-astropy-header back to .travis.yml if the failure is persistent. 🤷‍♀️

@pllim
Copy link
Member Author

pllim commented Jan 31, 2020

Superseded by #438

@pllim pllim closed this Jan 31, 2020
@pllim pllim deleted the use-pytest-astropy-header branch January 31, 2020 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants