Skip to content

Commit 0f11fdf

Browse files
authored
add instructions for Git archives in README
Completes pypa#580 by dropping the “Notable Plugins” section and creating a new “Git archives” subsection under “Builtin mechanisms for obtaining version numbers”.
1 parent 1ebac97 commit 0f11fdf

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

README.rst

+19-13
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,6 @@ To avoid BuildKit and mounting of the .git folder altogether, one can also pass
255255
version as a build argument. Note that ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${UPPERCASED_DIST_NAME}``
256256
is 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-
268258
Default versioning scheme
269259
-------------------------
270260

@@ -313,11 +303,27 @@ Builtin mechanisms for obtaining version numbers
313303

314304
1. the SCM itself (git/hg)
315305
2. ``.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+
ref-names: $Format:%(describe)$
318+
319+
Create the ``.gitattributes`` file in the root directory of your repository
320+
if it doesn't already exist, and copy-paste this into it::
321+
322+
.git_archival.txt export-subst
323+
324+
Finally, don't forget to commit those two files::
319325

320-
Git archives are not supported due to Git shortcomings
326+
git add .git_archival.txt .gitattributes && git commit
321327

322328

323329
File finders hook makes most of MANIFEST.in unnecessary

0 commit comments

Comments
 (0)