[Reproducible-builds] [dh-python] 120/183: dh_py*: add --requires options

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Sep 19 15:30:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dh-python.

commit af732be9bee2b694a59fdd30fe2ba7e2fc1df3a1
Author: Piotr Ożarowski <piotr at debian.org>
Date:   Fri Sep 6 20:41:10 2013 +0200

    dh_py*: add --requires options
---
 debian/changelog    | 6 ++++++
 dh_pypy             | 3 +++
 dh_pypy.rst         | 3 +++
 dh_python2          | 3 +++
 dh_python2.rst      | 3 +++
 dh_python3          | 3 +++
 dh_python3.rst      | 3 +++
 dhpython/depends.py | 8 ++++++++
 8 files changed, 32 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 46e6994..88e5b8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dh-python (1.20130913-1) UNRELEASED; urgency=low
+
+  * dh_py*: add --requires option
+
+ -- Piotr Ożarowski <piotr at debian.org>  Fri, 06 Sep 2013 20:27:05 +0200
+
 dh-python (1.20130903-1) unstable; urgency=low
 
   * dh_python2, dh_python3, dh_pypy:
diff --git a/dh_pypy b/dh_pypy
index 7509e9e..07c760b 100755
--- a/dh_pypy
+++ b/dh_pypy
@@ -102,6 +102,9 @@ def main():
     parser.add_option('--suggests', action='append',
                       help='translate given requirements into Debian '
                            'dependencies and add them to ${pypy:Suggests}')
+    parser.add_option('--requires', action='append',
+                      help='tranaslate requirements from given file into Debian '
+                           'dependencies and add them to ${python3:Depends}')
     parser.add_option('--shebang',
                       help='use given command as shebang in scripts')
     parser.add_option('--ignore-shebangs', action='store_true', default=False,
diff --git a/dh_pypy.rst b/dh_pypy.rst
index 0e5250d..92b3ef9 100644
--- a/dh_pypy.rst
+++ b/dh_pypy.rst
@@ -110,6 +110,9 @@ OPTIONS
 --suggests=SUGGESTS	translate given requirements into Debian dependencies
   and add them to ${pypy:Suggests}
 
+--requires=FILENAME	tranaslate requirements from given file(s) into Debian
+  dependencies and add them to ${python3:Depends}
+
 --shebang=COMMAND	use given command as shebang in scripts
 
 --ignore-shebangs	do not translate shebangs into Debian dependencies
diff --git a/dh_python2 b/dh_python2
index f63f14a..0eba221 100755
--- a/dh_python2
+++ b/dh_python2
@@ -306,6 +306,9 @@ def main():
     parser.add_option('--suggests', action='append',
                       help='translate given requirements into Debian '
                            'dependencies and add them to ${python:Suggests}')
+    parser.add_option('--requires', action='append',
+                      help='tranaslate requirements from given file into Debian '
+                           'dependencies and add them to ${python3:Depends}')
     parser.add_option('--namespace', action='append', dest='namespaces',
                       help='recreate __init__.py files for given namespaces at install time')
     parser.add_option('--clean-pycentral', action='store_true', default=False,
diff --git a/dh_python2.rst b/dh_python2.rst
index 2c0ebe2..14bcae9 100644
--- a/dh_python2.rst
+++ b/dh_python2.rst
@@ -173,6 +173,9 @@ OPTIONS
 --suggests=SUGGESTS	translate given requirements into Debian dependencies
   and add them to ${python:Suggests}
 
+--requires=FILENAME	tranaslate requirements from given file(s) into Debian
+  dependencies and add them to ${python3:Depends}
+
 --namespace	use this option (multiple time if necessary) if
   namespace_packages.txt is not complete
 
diff --git a/dh_python3 b/dh_python3
index 1383438..2333c2d 100755
--- a/dh_python3
+++ b/dh_python3
@@ -103,6 +103,9 @@ def main():
     parser.add_option('--suggests', action='append',
                       help='translate given requirements into Debian '
                            'dependencies and add them to ${python3:Suggests}')
+    parser.add_option('--requires', action='append',
+                      help='tranaslate requirements from given file into Debian '
+                           'dependencies and add them to ${python3:Depends}')
     parser.add_option('--shebang',
                       help='use given command as shebang in scripts')
     parser.add_option('--ignore-shebangs', action='store_true', default=False,
diff --git a/dh_python3.rst b/dh_python3.rst
index aae509b..c09a524 100644
--- a/dh_python3.rst
+++ b/dh_python3.rst
@@ -124,6 +124,9 @@ OPTIONS
 --suggests=SUGGESTS	translate given requirements into Debian dependencies
   and add them to ${python3:Suggests}
 
+--requires=FILENAME	tranaslate requirements from given file(s) into Debian
+  dependencies and add them to ${python3:Depends}
+
 --shebang=COMMAND	use given command as shebang in scripts
 
 --ignore-shebangs	do not translate shebangs into Debian dependencies
diff --git a/dhpython/depends.py b/dhpython/depends.py
index ed2ea66..1d93305 100644
--- a/dhpython/depends.py
+++ b/dhpython/depends.py
@@ -19,6 +19,7 @@
 # THE SOFTWARE.
 
 import logging
+from os.path import exists
 from dhpython import PKG_PREFIX_MAP, MINPYCDEP
 from dhpython.pydist import parse_pydep, guess_dependency
 from dhpython.version import default, supported, VersionRange
@@ -209,5 +210,12 @@ class Dependencies:
         # add dependencies from --suggests
         for item in options.suggests or []:
             self.suggest(guess_dependency(self.impl, item))
+        # add dependencies from --requires
+        for fn in options.requires or []:
+            if not exists(fn):
+                log.warn('cannot find requirements file: %s', fn)
+                continue
+            for i in parse_pydep(self.impl, fn):
+                self.depend(i)
 
         log.debug(self)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dh-python.git



More information about the Reproducible-builds mailing list