105 Commits

Author SHA1 Message Date
Benjamin Drung
d7362d9ed8 Use Python f-strings
```
flynt -ll 99 -tc -tj -a pbuilder-dist pm-helper running-autopkgtests ubuntu-build ubuntutools
```
2024-11-02 17:49:20 +01:00
Benjamin Drung
aa556af89d Use f-strings
pylint complains about C0209: Formatting a regular string which could be
a f-string (consider-using-f-string)

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 19:32:58 +01:00
Benjamin Drung
069a6926c0 Implement conventions found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 17:28:33 +01:00
Benjamin Drung
444b319c12 Implement refactorings found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 16:58:24 +01:00
Benjamin Drung
4449cf2437 Fix warnings found by pylint
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 15:51:29 +01:00
Benjamin Drung
f6fde2e217 fix: Use lazy % formatting in logging functions
pylint complains about W1201: Use lazy % formatting in logging functions
(logging-not-lazy) and W1203: Use lazy % formatting in logging functions
(logging-fstring-interpolation).

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-31 11:13:07 +01:00
Benjamin Drung
4e27045f49 style: Sort Python imports with isort
```
isort -l 99 --profile=black .
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 21:28:47 +01:00
Benjamin Drung
3354b526b5 style: Format Python code with black
```
PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .)
black -C -l 99 . $PYTHON_SCRIPTS
```

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2023-01-30 19:45:36 +01:00
Benjamin Drung
096d5612e7 sponsor-patch: Use --skip-patches when extract source package
Use `--skip-patches` when extract source packages with `dpkg-source`.
`--no-preparation` is a source package build option and `--skip-patches`
is the correct extract option.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2022-11-16 18:37:56 +01:00
Benjamin Drung
b510dbd91e sponsor-patch: Ignore exit code 1 of debdiff call
sponsor-patch calls `debdiff` which exits with 1 if there are
differences. So accept exit codes 0 and 1 as expected.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2022-11-15 16:43:27 +01:00
Logan Rosen
bc24ef23de sponsor-patch: fix bugs from py3 migration 2021-02-22 22:24:52 -05:00
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Mattia Rizzolo
434ca8952e
Merge branch 'python3' of git+ssh://git.launchpad.net/ubuntu-dev-tools
MR: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/+git/ubuntu-dev-tools/+merge/372305
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-09-10 14:19:07 +02:00
Dan Streetman
a7d166b52f pull-pkg: use ubuntutools/version/Version
instead of debian.debian_support.Version, use ubuntutools version,
which extends it and adds the strip_epoch() function which is
needed to convert full version string to version used in filenames
2019-09-09 12:25:21 -04:00
Stefano Rivera
7b2f1a713b Remove more Python 2 fallback imports 2019-09-05 09:49:41 -03:00
Stefano Rivera
301569e809 Pull out Python 2 support hacks 2019-09-04 19:24:44 -03:00
Stefano Rivera
23c7d67425 Replace simple Popen() calls with check_output() 2019-09-04 19:24:44 -03:00
Stefano Rivera
2d3765522e Use the Popen() encoding flag to decode to unicode
This should make behavior identical on Python 2 & 3.
2019-09-04 19:24:44 -03:00
Benjamin Drung
190ad30a7b Fix invalid escape sequence '\(' or '\)' (found by flake8)
flake8 found issues:
ubuntutools/sponsor_patch/bugtask.py:46:11: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:50: W605 invalid escape sequence '\('
ubuntutools/sponsor_patch/bugtask.py:62:58: W605 invalid escape sequence '\)'
setup.py:14:8: W605 invalid escape sequence '\('
setup.py:14:14: W605 invalid escape sequence '\)'

Fix these issues by marking these strings as raw strings.
2018-10-06 18:04:25 +02:00
Mattia Rizzolo
edb49c652c
Fix test failures with newer flake8 and pylint.
Closes: #891721
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2018-03-08 12:56:36 +01:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Benjamin Drung
3a6cd3ac66 Fix pylint3 error (for Python 2 support code) 2017-04-30 23:49:18 +02:00
Iain Lane
a6043a6ba8 Remove the `harvest' command, and all other integration with the Harvest service, since it has been shut down. 2017-04-03 13:58:02 +02:00
Dimitri John Ledkov
ed0cd2c1b5 file is gone in python3 2014-12-18 22:05:55 +00:00
Dimitri John Ledkov
509b612b0f fix sp/sp 2014-12-18 21:03:05 +00:00
Dimitri John Ledkov
8c6371a416 sp/sp 2014-12-18 20:56:13 +00:00
Dimitri John Ledkov
c8ec463f7a sp/source_package 2014-12-18 20:54:00 +00:00
Dimitri John Ledkov
57ea2cc410 question 2014-12-18 20:52:51 +00:00
Dimitri John Ledkov
194d23e878 patch 2014-12-18 20:52:17 +00:00
Dimitri John Ledkov
e20d125709 bugtask 2014-12-18 20:51:24 +00:00
Brian Murray
0ee01ef534 ubuntutools/sponsor_patch/sponsor_patch.py: correct grammar regarding
which task for the patch, cache bug.id instead of retrieving it up more
than once .
2013-08-22 08:22:55 -07:00
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01:00
Iain Lane
5d02fe7a3e sponsor-patch: Allow all supported bare releases now that LP rewrites
these to contain '-proposed' for us.
2013-01-16 15:15:50 +00:00
Benjamin Drung
34ca8072ff sponsor-patch: Use ubuntu profile when running lintian. 2012-11-08 20:43:55 +01:00
Stefano Rivera
a9c0df9627 sponsor-patch: Handle staging environment branch URLs 2012-11-06 23:51:59 +02:00
Stefano Rivera
d826cd20e0 Comment typo 2012-10-29 09:05:28 +01:00
Stefano Rivera
e30a6e51a7 sponsor-patch: Don't fall over bugs targetted at the development release
(LP: #936014)
2012-08-17 22:44:21 +02:00
Benjamin Drung
f29e729852 sponsor-patch: Fix crash if Debian patch contains a slash. 2012-08-01 15:16:34 +02:00
Stefano Rivera
c946f9457f sponsor-patch: Pass --builder=dpkg-buildpackage to bzr bd, in case the user has configured a custom builder that doesn't do source builds (LP: #1019817) 2012-07-02 19:27:00 +02:00
Stefano Rivera
93fbe4c71c Update sponsor-patch to use the new API resulting from this change
(LP: #1002999)
2012-05-25 12:15:33 +01:00
Stefano Rivera
f363b745ff pbuilder and cowbuilder live in sbin 2012-02-15 16:21:00 +02:00
Stefano Rivera
30da459114 Check for dependencies that the package doesn't Depend on. Recommend
dput, lintian, patch, quilt. (LP: #846385)
2012-02-15 16:10:43 +02:00
Stefano Rivera
948032d8a3 Support syncs from a non-default series (LP: #931644) 2012-02-15 15:16:30 +02:00
Stefano Rivera
aafcbd082e sponsor-patch: Support syncs of new packages. 2012-02-15 15:05:46 +02:00
Stefano Rivera
a0a25fc6ea sponsor-patch: Determine the task from the UDD branch. 2012-01-09 22:03:28 +02:00
Stefano Rivera
e44205bb33 bzr bd argument order matters 2012-01-09 21:44:06 +02:00
Stefano Rivera
f124357734 syncpackage, backportpackage, sponsor-patch: Use -nc when building source
packages. Avoids needing build-deps on the build machine.
2011-12-23 22:34:54 +02:00
Benjamin Drung
bbfbfd8956 Allow user to override sanity checks (LP: #896733). 2011-12-21 22:09:53 +01:00
Benjamin Drung
3f6eb545e2 sponsor-patch: Check if the sponsored bug is marked as duplicate (LP: #896733). 2011-12-21 21:44:22 +01:00
Benjamin Drung
58e6dfbbdb sponsor-patch: Use syncpackage instead of subscribing ubuntu-archive for sync requests, because syncpackage supports sponsorship now. 2011-12-10 12:51:53 +01:00