spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
570 stars 167 forks source link

RTD: Clear the dirty git index flag #8644

Closed jhunkeler closed 4 months ago

jhunkeler commented 4 months ago

Resolves JP-nnnn

Closes #

The last build (#8642) produced:

Version: 1.15.2.dev10+g2d15511ca.d20240712

RTD modifies indexed files in the repository prior to building the documentation. This change should prevent setuptools_scm from returning a dirty version (.dXXXXXXXX suffix).

See: https://docs.readthedocs.io/en/stable/build-customization.html#avoid-having-a-dirty-git-index

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 59.60%. Comparing base (136f1d9) to head (eb692d3).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8644 +/- ## ========================================== - Coverage 59.61% 59.60% -0.01% ========================================== Files 391 391 Lines 39287 39280 -7 ========================================== - Hits 23419 23412 -7 Misses 15868 15868 ```

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

braingram commented 4 months ago

I'm seeing a dev version on this docs for this PR:

Screenshot 2024-07-15 at 10 11 19 AM

I think this is expected (since it's not a tagged commit). Is this expected?

jhunkeler commented 4 months ago

Yes, this is expected. This is my local test case:

  1. Make a tag
git tag -a 1.10.100 -m "test tag"
pip install -e '.[test,docs]'
(cd docs && make html)

version_ok

  1. Make it dirty
echo '#' >> docs/Makefile
git describe --long --dirty
1.10.100-0-g590ef5d27-dirty

pip install -e .
Successfully installed jwst-1.10.101.dev0+g590ef5d27.d20240715

(cd docs && make html)

version_dirty

  1. Clear the dirty flag
git update-index --assume-unchanged docs/Makefile
pip install -e .
Successfully uninstalled jwst-1.10.101.dev0+g590ef5d27.d20240715
Successfully installed jwst-1.10.100

(cd docs && make html)

version_ok_again

Note: We marked the local Makefile as "unchanged" even though it is. You can tell git to care about this file again by using --no-assume-unchanged.

git describe --long --dirty
1.10.100-0-g590ef5d27

git update-index --no-assume-unchanged docs/Makefile

git describe --long --dirty
1.10.100-0-g590ef5d27-dirty