On Wed, Oct 05, 2016 at 05:56:53PM +0200, Julien Puydt wrote:
> Hi,
> 
> if you want to add some documentation within the setuptools-scm package, I'm
> open to it.
> 
> Especially now : there's a 1.12.0 out, so I'm going to RFS a new version of
> the package soon.

I don't have write acess to the pyton-modules team on alioth, so I can't
push myself, but here's a patch:

http://src.anarc.at/setuptools-scm.git/commitdiff/dc8fb7217df18697f011437778dfa0d3a5ebb085

Also attached.

Also note that upstream is rerolling the release because 1.12 introduced
a regression, see the full conversation here:

https://github.com/pypa/setuptools_scm/issues/103

Cheers,

A.
From dc8fb7217df18697f011437778dfa0d3a5ebb085 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <[email protected]>
Date: Wed, 5 Oct 2016 13:35:38 -0400
Subject: [PATCH] document how to use this in other debian packages (Closes:
 #839687)

---
 debian/README.Debian | 40 ++++++++++++++++++++++++++++++++++++++++
 debian/changelog     |  5 +++++
 2 files changed, 45 insertions(+)
 create mode 100644 debian/README.Debian

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..1a7dc44
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,40 @@
+setuptool-scm for Debian
+------------------------
+
+You may have problems packaging upstream software that use this
+package for their versioning, since setuptools-scm will not have
+access to the git repository when building. You may get errors like:
+
+    LookupError: setuptools-scm was unable to detect version for '/tmp/build-area/gentoo-1.0'.
+
+Debian's Python build toolchain supports setuptools-scm with dh_python
+(>= 2.20160609~). Make sure you enable `pybuild` in your
+`debian/rules` file, for example:
+
+    %:
+        dh $@  --with=python2,sphinxdoc --buildsystem=pybuild
+
+On older versions of dh_python, you can manually override the version
+number using the `SETUPTOOLS_SCM_PRETEND_VERSION` variable. For
+example, this will pull the version from the upstream PKG-INFO file:
+
+    export SETUPTOOLS_SCM_PRETEND_VERSION=$(shell cat PKG-INFO | sed -n 's/^Version: //p')
+
+This will pull the version from the `debian/changelog` file:
+
+    export SETUPTOOLS_SCM_PRETEND_VERSION=$(shell dpkg-parsechangelog -S version)
+
+setuptools-scm can also be used to generate a file that will contain
+version numbers with the `write_to` parameter, as such:
+
+    use_scm_version={
+        'write_to': '_version.py',
+    },
+
+If SETUPTOOLS_SCM_PRETEND_VERSION is set (which is the case with
+dh_python and `pybuild`), the file will not be created correctly with
+setuptool-scm versions lower than 1.12.0. Later releases will generate
+the file correctly. See this bug report for more information:
+https://github.com/pypa/setuptools_scm/issues/101
+
+ -- Antoine Beaupré <[email protected]>, Wed,  5 Oct 2016 13:34:36 -0400
diff --git a/debian/changelog b/debian/changelog
index d9c9150..061ba2f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,13 @@
 setuptools-scm (1.12.0-1) UNRELEASED; urgency=medium
 
+  [ Julien Puydt ]
   * New upstream version.
   * Pushed dh compat up to 10.
 
+  [ Antoine Beaupré ]
+  * Document how to use this software in other Debian packages (Closes:
+    #839687)
+
  -- Julien Puydt <[email protected]>  Wed, 05 Oct 2016 17:58:37 +0200
 
 setuptools-scm (1.11.1-1) unstable; urgency=medium
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to