82 Commits

Author SHA1 Message Date
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
562e6b13cd lpapicache: force lp access on login to workaround possibly invalid cached creds 2022-08-09 12:08:50 -04:00
Dan Streetman
9c1561ff26 lpapicache: remove try-except around login that only logs the error and then re-raises 2022-08-09 12:07:31 -04:00
Graham Inggs
0dde3262d1
ubuntutools/lp: Python 3.10 compatibility 2022-01-20 15:38:03 +01:00
Mattia Rizzolo
ceb020d0fa
lpapicache: fix sorting in Archive.getUploadersForPackage().
LP: #1862372
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-17 15:55:14 +02:00
Mattia Rizzolo
fbbcee9cc1
reflow code for the next commit
Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2021-08-17 15:51:23 +02:00
Dan Streetman
6e18d60de4 lpapicache: add Archive.getMySubscriptionURL()
Private PPA require using username/password to access their files,
so make this information available. This gets the currently logged in
user's "subscription URL", which includes the authentication data.
2021-07-13 07:55:02 -04:00
Dan Streetman
ae3837be1d lp: add Project and ProjectSeries classes
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
cb865e3b86 ubuntutools/lp: change default login to anonymous
If not specified, default to logging in anonymously.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
359cb18d8d lpapicache: replace httplib2 use with call to download_text()
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
c29b660dbf lpapicache: make sure source/binary file metadata includes all keys
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
8f42fb976f lpapicache: add PackageUpload class 2020-03-13 10:02:05 -04:00
Dan Streetman
907061c15e lpapicache: support 'include_meta' param in binaryFileUrls()
support the param for both native BPPH as well as Debian Snapshot
emulated BPPH

add sourceFileUrls() function

add helper functions to get file urls, checksums, and size
2020-03-06 13:01:37 +01:00
Dan Streetman
ee98423715 lpapicache: use urlparse instead of manual parsing 2020-03-06 13:01:37 +01:00
Dan Streetman
ebe460aad1 lpapicache: allow getBinaries(arch=None) to get all archs
this was the previous behavior and some scripts still call with no args.

LP: #1862286
2020-02-13 17:43:22 -05:00
Dan Streetman
5553d98e47 lpapicache: remove fallback_arch from getBinaries
Even for 'all' arch binaries, there are separate BPPHs per arch,
so we should index them properly by actual arch.
2020-02-13 17:41:35 -05:00
Dan Streetman
5838fa39ff lpapicache: remove SPPH _have_all_binaries flag
The 'all' arch makes it possible to not actually have all the
BPPH records for all archs, depending on how we've been called
previously (i.e. with which archs and/or no archs).

It's safer to just maintain our cache and recheck it each time if needed.
2020-02-13 17:39:53 -05:00
Dan Streetman
82c8c438f7 ubuntutools: use file extension when possible to determine deb/ddeb/udeb 2019-11-25 16:40:18 -05:00
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Dan Streetman
7c097b19ba ubuntutools: add --status param to pull-pkg
Allow specifying what package statuses should be searched for.

By default search only for Pending and Published, unless a specific
version number is being searched for.
2019-11-25 10:10:06 -05:00
Dan Streetman
0f61836b10 ubuntutools: update archive/lpapicache to optionally search all series
For PPA and UCA repos, the latest build is not necessarily in the
'development' release; so for those SourcePackage classes, search
all the 'active' series (starting with latest devel) for any
matches to the provided package name.  This allows not having to
specify the series name when looking in PPA/UCA repos for the 'latest'
version of a specific package.
2019-11-25 10:10:06 -05:00
Dan Streetman
7084bfc8bc pull-pkg: add pull-ppa-* functionality
Add functionality, and frontend pull-ppa-* scripts, to be able to pull
from PPA archives.
2019-11-25 10:10:06 -05:00
Dan Streetman
fb750e38bb lpapicache: find binaries from lp
Also update getBinaries() to allow retreival by binary name

This significantly speeds up binary file lookup for non-published
package versions, since we can get the list of binary urls, but
then have to look up the BPPH for each of those urls, which is slow.
If the user only wants a specific binary package and/or arch, this
speeds up getting that, especially for packages with a lot of binary
files (like the kernel).
2019-11-25 10:10:06 -05:00
Dan Streetman
f4f16f95f7 pull-uca: update UbuntuCloudArchiveSourcePackage
look in its PPA for its SPPHs
look up the development (latest) UCA release if not specified
use the 'series' param as the UCA release, instead of 'uca_release' param
2019-11-25 09:57:54 -05:00
Dan Streetman
d3b8d7a1b7 ubuntutools/lp/lpapicache: expand coverage for LP api 2019-11-25 09:57:54 -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
06642ef9f7 Remove some more u'' strings 2019-09-05 16:10:26 -03:00
Stefano Rivera
301569e809 Pull out Python 2 support hacks 2019-09-04 19:24:44 -03:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Ursula Junque (Ursinha)
6fea8fb542 Fix behavior of getBinaryPackage in lpapicache
It was using the same parameters to get Source and Binary packages build
history, but source packages need a distro series, and binary packages
need distro arch series, as the results are arch dependent.

Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2017-04-30 20:02:06 +02:00
Dimitri John Ledkov
1bbedd4ddd lpapicache 2014-12-18 20:28:48 +00:00
Benjamin Drung
9baf39a262 seeded-in-ubuntu: State in error message that it takes a source package.
LP: #1029155
2012-07-26 21:40:49 +02:00
Stefano Rivera
a55229619e Pass the launchpadlib person object to copyPackages 2011-12-07 15:46:09 +02:00
Stefano Rivera
dc9d6b5bf3 Add sponsorship support 2011-12-07 00:23:22 +02:00
Stefano Rivera
3ea5038905 PEP8 and docstring improments 2011-12-03 22:44:13 +02:00
Stefano Rivera
e556fdae00 New Tool: who-can-upload (LP: #876554) 2011-12-02 18:59:46 +02:00
Stefano Rivera
75067b3cf3 Add getPublishedBinaries to lpapicache.Archive 2011-12-02 15:01:19 +02:00
Stefano Rivera
9ba1790863 pull-lp-source, requestbackport: Take the latest version from any
non-backports pocket. Implemented by making lpapicache's getSourcePackage
smarter.
2011-11-23 01:45:49 +02:00
Stefano Rivera
70a035f13d Use httplib2 everywhere that we do https. The python stdlib doesn't do
certificate verification.
2011-11-22 15:57:02 +02:00
Stefano Rivera
82951a2716 Copyright notice 2011-11-15 01:50:55 +02:00
Stefano Rivera
2e217ac51e Add BinaryPackagePublishingHistory to lpapicache 2011-11-15 01:50:04 +02:00
Stefano Rivera
09e468211a Add changelog retrieval to lpapicache, and use this in syncpackage and
requestsync. The changelogs should be available in Launchpad sooner than
Debian PTS.
2011-11-13 22:50:34 +02:00
Stefano Rivera
6ee66a6efc Debian source publication records are all Published now, not pending
(LP: #845487)
2011-09-09 19:11:48 +02:00
Benjamin Drung
ce2f96bc0d Make pylint happier and code more PEP-8 compliant. 2011-08-20 11:31:02 +02:00
Colin Watson
f8d4866cbc move copyPackage into lpapicache for better encapsulation 2011-08-16 18:07:58 +01:00
Colin Watson
e8b02a39b2 monkeypatching doesn't work right; extend Launchpad.login instead 2011-08-16 16:20:29 +01:00
Colin Watson
122e711d28 syncpackage: Convert to new LP API, with --no-lp available for the old
style of operation.
2011-08-16 15:32:48 +01:00
Stefano Rivera
997fb23b2d Use Launchpadlib.login_with() directly in scripts. 2011-03-01 00:30:54 +02:00
Stefano Rivera
adc2b7869d Allow reusing existing Launchpads with lpapicache 2010-12-29 22:50:00 +02:00