setuptools_scm icon indicating copy to clipboard operation
setuptools_scm copied to clipboard

QST: how to get the complete git commit hash

Open fangchenli opened this issue 4 years ago • 10 comments
trafficstars

Is there a way to get the complete git commit hash using setuptools_scm?

fangchenli avatar Jun 04 '21 15:06 fangchenli

More context please, there are some ways available but not everywhere/easy

RonnyPfannschmidt avatar Jun 04 '21 17:06 RonnyPfannschmidt

I'm exploring if pandas could use setuptools_scm to replace versioneer. The only piece missing is the complete git commit hash. pandas displays it as a part of its version information. It would be nice if there is explicit way to do this using setuptools_scm.

fangchenli avatar Jun 09 '21 01:06 fangchenli

I think a custom write_to template can expose it,

Will create a example later

RonnyPfannschmidt avatar Jun 09 '21 04:06 RonnyPfannschmidt

Is there any news on this? It would be great, if beside the version a commit hash could be saved via "write_to".

kmuehlbauer avatar Mar 17 '22 15:03 kmuehlbauer

https://github.com/pandas-dev/pandas/issues/39415#issuecomment-1189354996

Someone posted a workaround. I haven't tested it yet. Just share it here for reference.

fangchenli avatar Jul 20 '22 05:07 fangchenli

The best way would be to add a full node local version scheme as the full node is available on the scm version now

RonnyPfannschmidt avatar Jul 20 '22 05:07 RonnyPfannschmidt

@RonnyPfannschmidt Is it possible to use SCMVersion attributes in the template. For now only version string & version_tuple is available ?

jules-ch avatar Jul 26 '22 07:07 jules-ch

Currently only those 2 are avaliable

RonnyPfannschmidt avatar Jul 26 '22 09:07 RonnyPfannschmidt

The best way would be to add a full node local version scheme as the full node is available on the scm version now

Can I ask more details w.r.t. full node? I'm having troubles to locate them in code.

ZhiyuanChen avatar May 26 '23 10:05 ZhiyuanChen

Currently they are only partially available, detail on extraction and pass over have to change

RonnyPfannschmidt avatar May 26 '23 11:05 RonnyPfannschmidt