diff options
author | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2022-06-28 22:23:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 22:23:21 +0200 |
commit | 1b18371fc2fa672f39c758a103c4d12956b5964f (patch) | |
tree | ca970f6cc77cfea136213faa7c8a5686327c255d | |
parent | 775b9a044bd0ad8beb46a1d479097cb271c42af9 (diff) | |
parent | fadcda9fb4072251a00d77ace39193b0b36b63ed (diff) | |
download | setuptools-scm-1b18371fc2fa672f39c758a103c4d12956b5964f.tar.gz |
Merge pull request #734 from Changaco/patch-1v7.0.3
Update the README: document support for Git archives
-rw-r--r-- | README.rst | 35 |
1 files changed, 22 insertions, 13 deletions
@@ -255,16 +255,6 @@ To avoid BuildKit and mounting of the .git folder altogether, one can also pass version as a build argument. Note that ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${UPPERCASED_DIST_NAME}`` is preferred over ``SETUPTOOLS_SCM_PRETEND_VERSION``. -Notable Plugins ---------------- - -`setuptools_scm_git_archive <https://pypi.python.org/pypi/setuptools_scm_git_archive>`_ - Provides partial support for obtaining versions from git archives that - belong to tagged versions. The only reason for not including it in - ``setuptools_scm`` itself is Git/GitHub not supporting sufficient metadata - for untagged/followup commits, which is preventing a consistent UX. - - Default versioning scheme ------------------------- @@ -313,11 +303,30 @@ Builtin mechanisms for obtaining version numbers 1. the SCM itself (git/hg) 2. ``.hg_archival`` files (mercurial archives) -3. ``PKG-INFO`` +3. ``.git_archival.txt`` files (git archives, see subsection below) +4. ``PKG-INFO`` -.. note:: +Git archives +~~~~~~~~~~~~ + +Git archives are supported, but a few changes to your repository are required. + +Create a ``.git_archival.txt`` file in the root directory of your repository, +and copy-paste this into it:: + + node: $Format:%H$ + node-date: $Format:%cI$ + describe-name: $Format:%(describe:tags=true)$ + ref-names: $Format:%D$ + +Create the ``.gitattributes`` file in the root directory of your repository +if it doesn't already exist, and copy-paste this into it:: + + .git_archival.txt export-subst + +Finally, don't forget to commit those two files:: - Git archives are not supported due to Git shortcomings + git add .git_archival.txt .gitattributes && git commit File finders hook makes most of MANIFEST.in unnecessary |