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
use pyproject.toml [build-system] and setuptools_scm #188
Conversation
So much to "I know what I am doing" 😂 |
Ok falling back to |
Codecov Report
@@ Coverage Diff @@
## main #188 +/- ##
=======================================
Coverage ? 79.28%
=======================================
Files ? 31
Lines ? 1400
Branches ? 0
=======================================
Hits ? 1110
Misses ? 290
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
authors = "Authors, see AUTHORS" | ||
author = authors | ||
|
||
# The short X.Y version | ||
version = get_versions()["version"].split("+")[0] | ||
version = mesmer.__version__.split("+")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other packages I had to follow this pattern https://github.com/openscm/openscm-runner/blob/27eb7baddb686862c7996dbccabf34cea934fcb7/docs/source/conf.py#L19
I can't remember why exactly, but it was something to do with being installed or not being installed when building docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - I wasn't aware that it's not (no longer?) installed per default in RTD. In xarray and regionmask we install it manually using pip (but I thought this is because it installs it with eager updates [making it impossible to pin packages]).
In any case RTD currently reports "mesmer 0.0.0 documentation" - I'll try your pattern to fix this in a new PR.
Related - for regionmask it reported a "dirty" version even for releases. This happens because RTD changes some files before installing the package. I used the following to work around this: regionmask/regionmask/pull/348
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,4 @@ | |||
node: $Format:%H$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity , what is this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only just got this recently. If you define <filename> export-subst
in a .gitattributes file, git will expand several placeholders when adding this file to an archive (from https://git-scm.com/docs/gitattributes). These placeholders can be the commit hash etc.
It currently still points to the wrong file (#189). With #189 merged:
mkdir archive
git archive HEAD > archive/HEAD.tar.gz
cd archive
tar -xvf HEAD.tar.gz
cat .git_archival.txt
returns
node: d933fa6f0835203e8310ca68b7307ebc34e63c43
node-date: 2022-08-15T11:05:04+02:00
describe-name: v0.8.3-39-gd933fa6
ref-names: HEAD -> fix_gitattributes_versioneer, origin/fix_gitattributes_versioneer
I think git archive
is used to create the files in https://github.com/MESMER-group/mesmer/releases/tag/v0.8.3. Versioneer does it slightly differntly by writing to mesmer/_version.py export-subst
.
I did not plan to do this now but as setuptool v64 causes problems with versioneer I went for it (instead of pinning setuptools). I do have a bit of experience with this setup by now, so I feel fairly confident this "just works". Maybe requires a re-install in your development environment.
@znicholls FYI.