45 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
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
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Dan Streetman
b5ae0bdca3 simplify subprocess usage 2019-11-25 09:57:54 -05: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
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01:00
Stefano Rivera
5f88f85278 Rename variables in get_builder 2011-07-26 10:54:16 +02:00
Stefano Rivera
5c960d720b Drop unecessary os.path import 2011-07-26 10:54:04 +02:00
Stefano Rivera
6e05bb7e74 Detect missing builder early 2011-07-25 19:32:15 +02:00
Stefano Rivera
b4a6cf5310 Use Builder.name instead of _command for the pbuilder builders 2011-07-25 15:20:27 +02:00
Stefano Rivera
9357415020 cowbuilderdist -> cowbuilder-dist 2011-07-25 15:19:59 +02:00
Evan Broder
d82e65e0e2 * ubuntutools.subprocess:
- New drop-in replacement wrapper module around subprocess that
    backports the restore_signals kwarg and defaults close_fds=True
  - Switch everything previously using subprocess to use
    ubuntutools.subprocess instead (LP: #785854)
2011-05-24 20:22:37 +02:00
Benjamin Drung
e8b3a18c45 Move suspicious-source and wrap-and-sort from ubuntu-dev-tools into devscripts. 2011-05-23 23:41:00 +02:00
Benjamin Drung
b67cf6e986 Improve get_builder. Thanks to Julian Taylor. 2011-03-08 12:51:53 +01:00
Julian Taylor
faf30c45ec builder.py: sort builder check 2011-03-05 23:14:09 +01:00
Julian Taylor
abe0b35261 builder.py: mark self._command private 2011-03-05 22:38:31 +01:00
Julian Taylor
e0bc0afc78 builder.py: sort unsupported builder error message 2011-03-05 22:38:03 +01:00
Julian Taylor
7c723753e6 simpler implementation of cowbuilder support 2011-03-04 00:12:01 +01:00
Julian Taylor
73518f83b5 add cowbuilder and cowbuilder-dist support 2011-03-03 22:57:37 +01:00
Benjamin Drung
0c8520ee8c Make pylint a little bit happier. 2010-12-27 15:20:49 +01:00
Benjamin Drung
c8e71cacee builder.py: Pass ARCH to pbuilder too. 2010-12-25 20:05:38 +01:00
Benjamin Drung
df1ae06d30 builder.py: Mark some functions as private. 2010-12-25 15:32:55 +01:00
Benjamin Drung
2a2cd83b74 sponsor-patch: Make pylint a little bit happier. 2010-12-22 23:31:35 +01:00
Stefano Rivera
59464226c0 In fact, have no default, caller is responsible 2010-12-21 00:35:52 +02:00
Stefano Rivera
64e51e0617 Get default builder from UDTConfig 2010-12-21 00:31:23 +02:00
Stefano Rivera
254be7bb5d Configuration system uses a class, add test suite 2010-12-20 22:08:12 +02:00
Stefano Rivera
1bb418e02f Support configuration in backportpackage 2010-12-19 22:32:53 +02:00
Benjamin Drung
4afe3c8478 Use common error message for sponsor-patch and backportpackage. 2010-12-18 23:08:13 +01:00
Benjamin Drung
d7ee62e951 backportpackage: Put build result into /buildresult to avoid signature problems with the source tarball. 2010-12-18 20:35:20 +01:00
Benjamin Drung
cec070446f ubuntutools/builder.py: Add update function to pbuilder-dist. 2010-12-17 14:40:19 +01:00
Benjamin Drung
4be074c8fa sponsor-patch: Add --update option to make sure build environment is
up to date (LP: #689605)
2010-12-17 14:35:27 +01:00
Benjamin Drung
7e038457bc ubuntutools/builder.py: Pass distribution and architecture to pbuilder update function. 2010-12-17 14:32:03 +01:00
Benjamin Drung
6aafc793dd Fix indentation and formatting of previous commit. 2010-12-17 13:56:36 +01:00
Bilal Akhtar
1747986a88 pbuilder-dist: Override the default build result location if
--buildresult is specified.
2010-12-17 13:47:48 +03:00
Evan Broder
6961cbfb3c ubuntutools.builder: Use sbuild-update and friends instead of calling schroot directly 2010-12-13 10:47:26 -08:00
Evan Broder
b01194ef8d ubuntutools.builder: Add an "update" method for updating chroots 2010-12-13 03:47:37 -08:00
Evan Broder
ee157d1cd9 ubuntutools.builder: Small fixup spotted by pylint 2010-12-12 20:20:40 -08:00
Evan Broder
b56b02683b sponsor-patch: Separate multi-builder support into a Python module.
Rename SPONSOR_PATCH_BUILDER environment variable to
UBUNTUTOOLS_BUILDER (but still support SPONSOR_PATCH_BUILDER)
2010-12-12 19:45:52 -08:00