@@ -255,16 +255,6 @@ To avoid BuildKit and mounting of the .git folder altogether, one can also pass
255255version as a build argument. Note that ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${UPPERCASED_DIST_NAME} ``
256256is preferred over ``SETUPTOOLS_SCM_PRETEND_VERSION ``.
257257
258- Notable Plugins
259- ---------------
260-
261- `setuptools_scm_git_archive <https://pypi.python.org/pypi/setuptools_scm_git_archive >`_
262- Provides partial support for obtaining versions from git archives that
263- belong to tagged versions. The only reason for not including it in
264- ``setuptools_scm `` itself is Git/GitHub not supporting sufficient metadata
265- for untagged/followup commits, which is preventing a consistent UX.
266-
267-
268258Default versioning scheme
269259-------------------------
270260
@@ -313,11 +303,30 @@ Builtin mechanisms for obtaining version numbers
313303
3143041. the SCM itself (git/hg)
3153052. ``.hg_archival `` files (mercurial archives)
316- 3. ``PKG-INFO ``
306+ 3. ``.git_archival.txt `` files (git archives, see subsection below)
307+ 4. ``PKG-INFO ``
317308
318- .. note ::
309+ Git archives
310+ ~~~~~~~~~~~~
311+
312+ Git archives are supported, but a few changes to your repository are required.
313+
314+ Create a ``.git_archival.txt `` file in the root directory of your repository,
315+ and copy-paste this into it::
316+
317+ node: $Format:%H$
318+ node-date: $Format:%cI$
319+ describe-name: $Format:%(describe:tags=true)$
320+ ref-names: $Format:%D$
321+
322+ Create the ``.gitattributes `` file in the root directory of your repository
323+ if it doesn't already exist, and copy-paste this into it::
324+
325+ .git_archival.txt export-subst
326+
327+ Finally, don't forget to commit those two files::
319328
320- Git archives are not supported due to Git shortcomings
329+ git add .git_archival.txt .gitattributes && git commit
321330
322331
323332File finders hook makes most of MANIFEST.in unnecessary
0 commit comments