spacetelescope / jwst

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

RTD: Clear the dirty git index flag #8644

Closed jhunkeler closed 2 months ago

jhunkeler commented 2 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 2 months ago

Codecov Report

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

Project coverage is 59.60%. Comparing base (ccf871a) to head (eb692d3). Report is 10 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8644 +/- ## ========================================== + Coverage 59.56% 59.60% +0.03% ========================================== Files 391 391 Lines 39285 39280 -5 ========================================== + Hits 23402 23412 +10 + Misses 15883 15868 -15 ```

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

braingram commented 2 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 2 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