diff --git a/debian/changelog b/debian/changelog index a8f05a06476f753e47410708eea2ff89897e43dd..e9d53a6a701332f4d817349bc1d4cba62ef05e2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,13 @@ -python-defaults (2.6.5-10) UNRELEASED; urgency=low +python-defaults (2.6.5-10) unstable; urgency=low * dh_python2: - - add --depend command line option (use it if requires.txt - doesn't contain dependency that package needs) + - add --depend, --recommend and --suggest command line options + (use it if requires.txt doesn't contain dependency that package needs) - add {/usr,}/sbin to the list of directories with checked shebangs * pycompile: do not exit before all background byte compilation is finished (closes: 590224) - -- Piotr Ożarowski <piotr@debian.org> Wed, 21 Jul 2010 21:10:19 +0200 + -- Piotr Ożarowski <piotr@debian.org> Sun, 25 Jul 2010 12:34:56 +0200 python-defaults (2.6.5-9) unstable; urgency=low diff --git a/debpython/depends.py b/debpython/depends.py index 4505ff9723e1b0d1bc1dc16b0396bafc069271ee..a7afbf5af4ecb9fa94778998be44bfd5ed5990ea 100644 --- a/debpython/depends.py +++ b/debpython/depends.py @@ -150,11 +150,19 @@ class Dependencies(object): if options.guess_deps: for fn in stats['requires.txt']: + # TODO: should options.recommends and options.suggests be + # removed from requires.txt? for i in parse_pydep(fn): self.depend(i) # add dependencies from --depend for item in options.depends: self.depend(guess_dependency(item)) + # add dependencies from --recommend + for item in options.recommends: + self.recommend(guess_dependency(item)) + # add dependencies from --suggest + for item in options.suggests: + self.suggest(guess_dependency(item)) log.debug(self) diff --git a/dh_python2 b/dh_python2 index e159635b1aa10255f2eb98f574b1b21879e80544..a13821d30f0e1190ae1086cc977bdf973e07205e 100755 --- a/dh_python2 +++ b/dh_python2 @@ -418,9 +418,16 @@ def main(): parser.add_option('-X', '--exclude', action='append', dest='regexpr', help='exclude items that match given REGEXPR. You may use this option' 'multiple times to build up a list of things to exclude.') - parser.add_option('--depend', action='append', - dest='depends', help='generate dependencies for given ' - 'Python distributions') + parser.add_option('--depend', action='append', dest='depends', + help='translate given requirements into Debian dependencies ' + 'and add them to ${python:Depends}. ' + 'Use it for missing items in requires.txt.') + parser.add_option('--recommend', action='append', dest='recommends', + help='translate given requirements into Debian ' + 'dependencies and add them to ${python:Recommends}') + parser.add_option('--suggest', action='append', dest='suggests', + help='translate given requirements into Debian ' + 'dependencies and add them to ${python:Suggests}') # ignore some debhelper options: parser.add_option('-O', help=SUPPRESS_HELP) diff --git a/tests/t1/debian/pydist-overrides b/tests/t1/debian/pydist-overrides index 24b440d075ec9b51cbc389e93e6bb74449ee994a..f5800e4a1c06307c72963c228e79cb244d83a5d5 100644 --- a/tests/t1/debian/pydist-overrides +++ b/tests/t1/debian/pydist-overrides @@ -1,2 +1,4 @@ Mako python-mako (>= 0.2) SQLAlchemy python-sqlalchemy (>= 0.6) +Foo python-foo +Bar python-bar diff --git a/tests/t1/debian/rules b/tests/t1/debian/rules index 3a179028100d32af4516356c79e88a87a0e5821e..c8af0acd48cf8bf0e11207078a063308e2c1dda5 100755 --- a/tests/t1/debian/rules +++ b/tests/t1/debian/rules @@ -5,4 +5,8 @@ override_dh_pysupport: find debian/ -name jquery.js -exec \ ln -fs /usr/share/javascript/jquery/jquery.js '{}' \; - DH_VERBOSE=1 ../../dh_python2 --depend 'SQLAlchemy >= 0.6.1' + DH_VERBOSE=1 ../../dh_python2\ + --depend 'SQLAlchemy >= 0.6.1'\ + --recommend Mako\ + --suggest 'Foo >= 0.1'\ + --suggest 'bar >= 1.0'