summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2022-06-28 22:23:21 +0200
committerGitHub <noreply@github.com>2022-06-28 22:23:21 +0200
commit1b18371fc2fa672f39c758a103c4d12956b5964f (patch)
treeca970f6cc77cfea136213faa7c8a5686327c255d
parent775b9a044bd0ad8beb46a1d479097cb271c42af9 (diff)
parentfadcda9fb4072251a00d77ace39193b0b36b63ed (diff)
downloadsetuptools-scm-7.0.3.tar.gz
Merge pull request #734 from Changaco/patch-1v7.0.3
Update the README: document support for Git archives
-rw-r--r--README.rst35
1 files changed, 22 insertions, 13 deletions
diff --git a/README.rst b/README.rst
index 83b77f3..a02caf7 100644
--- a/README.rst
+++ b/README.rst
@@ -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