jwst icon indicating copy to clipboard operation
jwst copied to clipboard

JP-3552: use tmp_path instead of tmpdir, enable no:legacypath as a tox factor

Open emolter opened this issue 11 months ago • 1 comments

Resolves JP-3552

Closes #8311

This PR replaces all instances tmpdir and tmpdir_factory pytest fixtures with tmp_path and tmp_path_factory fixtures, as recommended by pytest (see here), so that these are returning standard pathlib.Path instances instead of legacy py.path.local instances.

Jenkins run here

Checklist for maintainers

  • [ ] added entry in CHANGES.rst within the relevant release section
  • [ ] updated or added relevant tests
  • [ ] updated relevant documentation
  • [ ] added relevant milestone
  • [ ] added relevant label(s)
  • [ ] ran regression tests, post a link to the Jenkins job below. How to run regression tests on a PR
  • [ ] Make sure the JIRA ticket is resolved properly

emolter avatar Mar 01 '24 22:03 emolter

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 53.21%. Comparing base (4cc0ac1) to head (06b0731). Report is 27 commits behind head on master.

Files Patch % Lines
jwst/scripts/okify_regtests.py 0.00% 3 Missing :warning:
jwst/regtest/conftest.py 75.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #8327       +/-   ##
===========================================
- Coverage   75.15%   53.21%   -21.95%     
===========================================
  Files         470      389       -81     
  Lines       38604    38463      -141     
===========================================
- Hits        29014    20468     -8546     
- Misses       9590    17995     +8405     
Flag Coverage Δ
nightly ?

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 04 '24 14:03 codecov[bot]

@emolter What's the status of all the suggestions from @jdavies-st ? Do you think they're reasonable?

hbushouse avatar Mar 11 '24 19:03 hbushouse

For some reason, I did not get (or missed) the notification that @jdavies-st reviewed this! Thanks for doing that @jdavies-st, and thanks for the bump @hbushouse. I think the comments are all reasonable and I'll start going through them one by one now.

emolter avatar Mar 11 '24 20:03 emolter

stpipe.Step parameter validation prevents some file paths being validated when passed pathlib.Path objects. Fine to work around that in this PR. Issue opened here

https://github.com/spacetelescope/stpipe/issues/147

jdavies-st avatar Mar 12 '24 09:03 jdavies-st

new regtest run started here

emolter avatar Mar 12 '24 15:03 emolter

Hopefully a final, successful regression test run after fixing two failures: here

edit: all tests ran successfully - jump test failure is unrelated

emolter avatar Mar 12 '24 20:03 emolter

New regtest run started here.

edit: Regression tests are failing for the two test_nirspec_ifu_spec2 tests where there seemed to be an implicit scope mismatch before. Of course it Works On My MachineTM so I started this run that only runs tests in that file.

emolter avatar Mar 13 '24 17:03 emolter

Finally, regression tests for just nirspec_ifu_spec2 passed here. Between this and the previous regtest run, hopefully everything is working now, but I started this new full run just in case.

emolter avatar Mar 14 '24 20:03 emolter

Latest full regtest run has failures that are all unrelated to this PR (they're due to a separate update to datamodels). So this looks good. I'm approving and merging. Nice work everyone - that's a wrap.

hbushouse avatar Mar 15 '24 12:03 hbushouse