Fix incorrectly reporting unknown distribution for Ubuntu after commit
7fc6788b35d32aeb96c7cf81303853d4f31028d1 ("backportpackage: fix
automatic selection of the target release").
LP: #2013237
Signed-off-by: Nathan Rennie-Waldock <nathan.renniewaldock@gmail.com>
lintain says: "Your sources request a specific set of Python versions
via the control field X-Python3-Version but all declared autopkgtests
exercise all supported Python versions by using the command py3versions
--supported."
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
```
ubuntutools/test/test_archive.py::LocalSourcePackageTestCase::test_pull
/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method LocalSourcePackageTestCase.test_pull of <ubuntutools.test.test_archive.LocalSourcePackageTestCase testMethod=test_pull>>)
return self.run(*args, **kwds)
```
`test_pull` does not need to be run directly. Make it private.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
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>
Commit 90e8fe81e1b2610e352c82c0301076ffc7da5ac0 renamed `print_field` to
`log_field`, but changed the `print_field` call with `Logger.info`.
Therefore the line with `=` was lost.
Restore the previous formatting.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Commit 0f3d2fed2a4ed67b90b5d49aab25ca2bda5d9d37 removed the difference
between the two loop iterations in `locate_package`. So drop the useless
second iteration.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
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>
Commit ae74f71a1e9d4be043162b19d23f2d44c964c771 removed the pylint unit
test saying that unit tests are not needed to just run flake8 or pylint.
Since pylint is useful, add it back, but this time call it directly and
not embed it into a unit test.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Move getting the Debian package version into a separate function and
fail in case it cannot find it or fails parsing it.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Commit ae74f71a1e9d4be043162b19d23f2d44c964c771 removed the flake8
unittest and commit 3428a65b1cd644445f55ad8ae65ece5f73d7acb5 added
running flake8 again, but only for files named `*.py`.
Check also all Python scripts with a Python shebang.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Versions like `0.176ubuntu20.04.1` in Ubuntu are clearly not compliant
with https://peps.python.org/pep-0440/. With setuptools 66, the versions
of all packages visible in the Python environment *must* obey PEP440.
Bug: https://launchpad.net/bugs/1991606
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
If I run "apt-get update" in the bullseye chroot, I get the following error:
Err:4 http://security.debian.org bullseye-updates Release
404 Not Found [IP: 2a04:4e42:600::644 80]
It looks like the directory path was changed since bullseye.
buster:
deb https://security.debian.org/debian-security buster/updates main
bullseye:
deb https://security.debian.org/debian-security bullseye-security main
Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
Add debian_dist_ge(), which will be used by the next commit.
To avoid code duplication, move the common part to dist_ge().
Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
As of lunar, Ubuntu sets NotAutomatic: yes for its -proposed pockets. For
sbuild chroots, we want to continue to explicitly install from -proposed by
default; so override with apt preferences to get the correct behavior.
Nowadays git is used nearly everywhere. Therefore demoting bzr/brz to
Suggest is the right thing to do.
Bug-Debian: https://bugs.debian.org/940531
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
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>
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>