Skip to content

TST: add a CI job for Python's optimized mode - #17472

Draft
neutrinoceros wants to merge 2 commits into
astropy:mainfrom
neutrinoceros:tst/weekly_cron_with_optimized_mode
Draft

neutrinoceros wants to merge 2 commits into
astropy:mainfrom
neutrinoceros:tst/weekly_cron_with_optimized_mode

Conversation

@neutrinoceros

@neutrinoceros neutrinoceros commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor

Description

The end goal is to close #17471, but actual fixes will be done in small, subpackage-focused PRs that I'll link below

upstream:

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@neutrinoceros neutrinoceros added the Extra CI Run cron CI as part of PR label Nov 29, 2024
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@neutrinoceros

neutrinoceros commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor Author

hum the error doesn't look at all like what I'm seeing locally and it makes me wonder whether tox itself supports optimized mode (locally I run pytest directly).

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

I confirm that running PYTHONOPTIMIZE=1 tox -e py312-test locally, I get the same obscure crash in tox than in CI:

...
RuntimeError: config set has been marked final and cannot be extended

I don't know wether that's a bug in tox or elsewhere in the stack but rather than deciphering it I'm going to go with a dead simple, known-good approach for now: just run pytest directly.

@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch from 3cbbfa2 to 3cafc54 Compare December 2, 2024 08:53
@neutrinoceros neutrinoceros changed the title TST: run weekly jobs under Python's optimized mode TST: run allowed_failures CI job under Python's optimized mode Dec 2, 2024
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

sight... there's actually an open upstream issue for tox: tox-dev/tox#3006
The problem with running pytest directly is that it's so different than the rest of our CI that it wouldn't meet our ideal of portability, so I guess I will spend some time trying to fix tox (though not too long).

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Alright I think the tox rabbit hole goes way to deep for this to be a reasonable use of my time. Back to a simple (albeit less portable) solution.

@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch from 3cafc54 to b7c9e31 Compare December 2, 2024 09:27
@neutrinoceros neutrinoceros removed the Extra CI Run cron CI as part of PR label Dec 2, 2024
@neutrinoceros neutrinoceros changed the title TST: run allowed_failures CI job under Python's optimized mode TST: add a CI job for Python's optimized mode Dec 2, 2024
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

there we go ! at least now the errors we see are actually ours !

@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch from 2e7b938 to 3184e9d Compare December 11, 2024 17:46
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

rebased now that all (known) errors were solved 🤞🏻

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Looks like the 29 remaining failures are all about functions that rely on the presence of docstrings, and those can't possibly work in these conditions, so I'll probably need to (conditionally) skip the failing tests. Will give it a go tomorrow.

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

with my latest batch (#17571, #17572 and #17573), we should be almost there. The only test that's still failing locally lives in a .rst file so I'm not sure it can be skipped only conditionally.

@astrofrog astrofrog modified the milestones: v7.1.0, v7.2.0 Apr 28, 2025
@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label May 11, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

@neutrinoceros neutrinoceros added keep-open and removed Close? Tell stale bot that this issue/PR is stale labels May 12, 2025
@astrofrog astrofrog modified the milestones: v7.2.0, v8.0.0 Nov 3, 2025
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

tox-dev/tox#3006 was closed, let's try to revive this

@neutrinoceros neutrinoceros reopened this Feb 25, 2026
@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch from 3184e9d to 11f3ddf Compare February 25, 2026 14:28
@neutrinoceros neutrinoceros modified the milestones: v8.0.0, v8.1.0 Apr 29, 2026
@pllim pllim removed the keep-open label Oct 14, 2026
@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 8 months. I plan to close this in a month if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch 2 times, most recently from 83d3fbe to d0b5072 Compare October 15, 2026 15:04
@neutrinoceros
neutrinoceros force-pushed the tst/weekly_cron_with_optimized_mode branch from d0b5072 to d61ca1c Compare October 15, 2026 15:06
@pllim pllim removed the Close? Tell stale bot that this issue/PR is stale label Oct 15, 2026

This branch has not been deployed

No deployments
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.

BUG: missing support for Python optimized mode

3 participants