Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .git_archival.txt #255

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/python/.git_archival.txt export-subst
3 changes: 3 additions & 0 deletions src/python/.git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the match? Is it because archives are created in other contexts in our workflow than GitHub releases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about which tags will be considered for the version names. E.g., a tag foo wouldn't be used. This can be restricted further if it's decided that we stick to vYYYY.MM.DD, but I think this will do for the moment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about the tag to create a GitHub release, right? I guess we want all GitHub releases to be properly versioned and then made available on PyPI (TODO) and Zenodo -- if there is a release that isn't tagged with *[0-9]*, then it was probably a mistake on our side?

Copy link
Member Author

@dweindl dweindl Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about any tags that may exist in the repository, whether they are created by a GitHub release or by any other means. This will also be used when archiving any revision that is not a release. The tag that will be used as the basis of the version number will be the one closest up the tree that matches the given pattern.

if there is a release that isn't tagged with [0-9], then it was probably a mistake on our side?

Yes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍 Thanks

2 changes: 1 addition & 1 deletion src/python/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mkdir $BUILD_DIR
# Copy code
cp -r \
$CODE_DIR \
"pyproject.toml" "MANIFEST.in" \
"pyproject.toml" "MANIFEST.in" ".git_archival.txt" \
"../../LICENSE" "../../README.md" \
$BUILD_DIR
# Remove link
Expand Down