Skip to content

TST/DEP: replace pytest-astropy with corresponding, direct dependencies #18783

Description

@neutrinoceros

Part of #18782
Started at #18780

The problem is two-fold:

  • requiring the pytest-astropy metapackage instead of the corresponding, direct requirements, means we don't have direct control over the lower bounds of our direct dependencies.
  • pytest-astropy currently requires a superset of our actual test requirements. Notably, this means we still pull pytest-openfiles from PyPI on every single test run, even though we don't use it, and it's explicitly marked as unsupported.

Activity

  1. pllim commented on Oct 28, 2025

    @pllim
    Member
  2. neutrinoceros commented on Oct 28, 2025

    @neutrinoceros
    ContributorAuthor

    indeed. But that plugin is less than 50 lines of code, so I'm willing to experiment with (re)including it in astropy's own test suite.

  3. pllim commented on Oct 28, 2025

    @pllim
    Member

    (re)including it

    That.... might be controversial. We cannot remove it from pytest-astropy and we cannot archive pytest-astropy. So your proposal would amount to duplicating code that we have to keep maintaining on both sides.

  4. neutrinoceros commented on Oct 28, 2025

    @neutrinoceros
    ContributorAuthor

    Yes. I expect controversy, but I also don't see any better solution to the problems I'm trying to solve (other than lock files, which, as we've seen, are not any less controversial)

  5. eerovaher commented on Nov 5, 2025

    @eerovaher
    Member

    As a metapackage pytest-astropy became obsolete when we started declaring our dependencies using self-referential dependency sets in 98710e2. The markers pytest-astropy plugin defines are useful, but they are not specific to astropy, so pytest-astropy is not the package that should be implementing them.

  6. astrofrog commented on Apr 27, 2026

    @astrofrog
    Member

    @neutrinoceros - what if we were to split out the plugin from pytest-astropy into its own mini-package to avoid duplication since other packages might want to do the same as what we are doing here? Making a small package is easy enough these days and pytest-astropy would then become a pure metapackage we can just drop.

  7. neutrinoceros commented on Apr 28, 2026

    @neutrinoceros
    ContributorAuthor

    Yeah, that'd be my preferred solution

  8. neutrinoceros commented on May 26, 2026

    @neutrinoceros
    ContributorAuthor

    In researching this, I found@pytest.mark.slow can already be replaced by pytest-skip-slow. The only difference is the corresponding CLI flag, --slow instead of --run-slow, but we could easily propose an alias for backward compat. I note the repo hasn't been active in 3 years but the project is also extremely simple so it's not necessarily a show stopper, and we could probably offer to host and maintain it if that helps reaching a decision.
    @pytest.mark.hugemem doesn't have a clear replacement yet, though it could probably fit in pytest-skip-slow's scope too. I'll to reach out to Brian to see what he says regardless.

  9. neutrinoceros commented on May 26, 2026

    @neutrinoceros
    ContributorAuthor

    Had a quick chat with @okken, and he's on board with the idea. I'll open a couple PRs tomorrow, so as to facilitate migration.

  10. neutrinoceros commented on May 27, 2026

    @neutrinoceros
    ContributorAuthor

    pytest-skip-slow 1.1.0 is out (thank you @okken !) and confirmed to be the minimal, drop-in replacement I was aiming for. I'll ask the rest of the team about this proposal on the mailing list.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions