Skip to content

Conversation

@Tieqiong
Copy link
Contributor

@Tieqiong Tieqiong commented Jan 10, 2025

address #118
@sbillinge please check this and decide if it's the good way, thanks!

I think this might be the easiest way to provide the release date. Whenever the installed package use __date__ for the first time (i.e. creating a PdfFit object), it will check the pypi release online, get the release date of that version, and save the date at the end of version.py as a line of comment. After this, it will only get __date__ by parsing this comment line. When the package gets an update, version.py will be removed and reinstalled, leaving room for the new date. Any error will fall the date back to the creation date of the package (install date).

This is an unusual approach, as it modify the package file during the user's first successful use. This means if the user does some hash check after using it (which is very unlikely) it will not pass the check. (A bit like a wax seal...)

The more conventional way as suggested in the issue, pulling date of the latest git tag during release CI, could work. But the changes would be less easy to make and test. It will also affect all other packages using the CI, which is not necessary.

@codecov
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.96%. Comparing base (24fb526) to head (a1531a0).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #119   +/-   ##
=======================================
  Coverage   98.96%   98.96%           
=======================================
  Files           6        6           
  Lines        1261     1261           
=======================================
  Hits         1248     1248           
  Misses         13       13           

@sbillinge
Copy link
Contributor

I think this looks reasonable. It is a a lot of code to maintain, but ok.

this just needs a news and I can merge it.

@Tieqiong
Copy link
Contributor Author

@sbillinge please check, thanks

@sbillinge sbillinge merged commit fdc2e16 into diffpy:main Jan 11, 2025
5 checks passed
@Tieqiong Tieqiong deleted the date branch January 12, 2025 02:30
@sbillinge sbillinge mentioned this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants