Skip to content

Require pytest 7.0 or later#49

Closed
eerovaher wants to merge 1 commit intoastropy:mainfrom
eerovaher:pytest-7
Closed

Require pytest 7.0 or later#49
eerovaher wants to merge 1 commit intoastropy:mainfrom
eerovaher:pytest-7

Conversation

@eerovaher
Copy link
Copy Markdown
Member

Using older versions of pytest is not possible since astropy/astropy@7b98fa6 in astropy/astropy#12823.

Using older versions of `pytest` is not possible since
astropy/astropy#12823.
@eerovaher eerovaher added this to the v0.10.0 milestone Mar 3, 2022
@Cadair
Copy link
Copy Markdown
Member

Cadair commented Mar 3, 2022

I am not in favour of this, if astropy core needs to put a restrictive pin on pytest it should do it there. Lots of packages inside and outside the astropy ecosystem use this and they might have different pytest version requirements.

Specifically sunpy tries to let its tests run on about a years worth of pytest releases to make it easier for distro packagers, I don't really want to have our version of pytest dragged along by this metapackage.

@eerovaher
Copy link
Copy Markdown
Member Author

astropy needs pytest>=7.0, and it also now needs pytest-doctestplus>=0.12, but I'll refrain from updating this pull request until it is clear whether the requirements should be updated here or directly in astropy.

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 3, 2022

I thought I already pinned pytest minversion in astropy. Is this really necessary here?

@eerovaher
Copy link
Copy Markdown
Member Author

The setup.cfg file in astropy does set the minimum required version of pytest to be 7.0, but it does so in the [tool:pytest] section. If an older version of pytest is installed then testing fails quickly with an error before any tests are even collected. However, that line in setup.cfg is apparently ignored by pip, so it does not prevent installing astropy with an older version of pytest and simply running pip install -e . or pip install astropy does not help because pytest will not be upgraded.

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 3, 2022

In that case, I could maybe "hardpin" it in astropy's setup.cfg. That would make Stuart happy, hopefully.

@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented Mar 3, 2022

I recall we already had this discussion a few weeks ago and decided along the lines of Stuart 's comment above, that just because astopy needs the restriction the metapackage shouldn't force it on others.

@eerovaher
Copy link
Copy Markdown
Member Author

eerovaher commented Mar 3, 2022

As far as I can tell right current astropy main branch requires

  1. pytest>=7.0
  2. pytest-doctestplus>=0.12
  3. pytest-astropy-header>=0.2

I doesn't matter much to me whether they are defined here or directly in astropy, so I can open a pull request there if that is considered preferable.

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 3, 2022

@eerovaher , let's try a PR directly to astropy then since there are objections here. Thank you so much for your help and patience!

@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented Mar 3, 2022

OTOH, bumping the pytest plugin versions in this PR is all ok, at least that's what we used to do here.

@eerovaher
Copy link
Copy Markdown
Member Author

So should we update the plugin version requirements here, make a release of pytest-astropy and then update the pytest and pytest-astropy requirements in astropy?

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 3, 2022

Do we have to overcomplicate things like this? 👀

@pllim
Copy link
Copy Markdown
Member

pllim commented Mar 4, 2022

Superseded by astropy/astropy#12914 . Thanks, @eerovaher !

p.s. Maybe a metapackage is more pain than its worth. Packages can pin whatever they want themselves. We don't have to babysit them with a metapackage but that is a discussion for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants