Merge ppa-dev-tools:add_source_package_module into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: 95148554e9c5addd7385a4eb7fd16b1fd7d55b95
Proposed branch: ppa-dev-tools:add_source_package_module
Merge into: ppa-dev-tools:main
Diff against target: 2401 lines (+2291/-13)
5 files modified
ppa/binary_package.py (+11/-13)
ppa/source_package.py (+230/-0)
tests/data/source/Release (+6/-0)
tests/data/source/Sources (+1960/-0)
tests/test_source_package.py (+84/-0)
Reviewer Review Type Date Requested Status
Athos Ribeiro (community) Approve
Canonical Server Pending
Canonical Server Reporter Pending
Review via email: mp+439886@code.staging.launchpad.net

Description of the change

This is the follow-up to the BinaryPackage class. It's dealing with similar data, so the implementation is also quite similar.

As before, tests can be run via:

    $ pytest-3 tests/test_source_package.py
    $ check-scripts ppa/source_package.py tests/test_source_package.py
    $ python3 -m ppa.source_package

Below is the output from these:

stirling: ~/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing$ pytest-3 tests/test_source_package.py
================================================ test session starts ================================================
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.10.0, pluggy-0.13.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing, configfile: setup.cfg
plugins: cov-3.0.0
collected 12 items

tests/test_source_package.py::test_object[pkg_dict0-SourcePackage(ppa_dict={'package': 'a', 'version': 'b', 'binary': 'c'})-a (b)] PASSED [ 8%]
tests/test_source_package.py::test_object_error[pkg_dict0-ValueError] PASSED [ 16%]
tests/test_source_package.py::test_object_error[pkg_dict1-ValueError] PASSED [ 25%]
tests/test_source_package.py::test_object_error[pkg_dict2-ValueError] PASSED [ 33%]
tests/test_source_package.py::test_object_error[pkg_dict3-ValueError] PASSED [ 41%]
tests/test_source_package.py::test_object_error[pkg_dict4-ValueError] PASSED [ 50%]
tests/test_source_package.py::test_object_error[pkg_dict5-ValueError] PASSED [ 58%]
tests/test_source_package.py::test_object_error[pkg_dict6-ValueError] PASSED [ 66%]
tests/test_source_package.py::test_object_error[pkg_dict7-ValueError] PASSED [ 75%]
tests/test_source_package.py::test_provides_binaries[pkg_dict0-expected_binaries0] PASSED [ 83%]
tests/test_source_package.py::test_provides_binaries[pkg_dict1-expected_binaries1] PASSED [ 91%]
tests/test_source_package.py::test_build_dependencies[pkg_dict0-expected_build_dependencies0] PASSED [100%]

================================================ 12 passed in 0.04s =================================================
stirling: ~/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing$ check-scripts ppa/source_package.py tests/test_source_package.py
### python3 -m py_compile '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/ppa/source_package.py' ###

### pyflakes3 '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/ppa/source_package.py' ###

### flake8 '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/ppa/source_package.py' ###

### pylint '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/ppa/source_package.py' ###

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

### python3 -m py_compile '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/tests/test_source_package.py' ###

### pyflakes3 '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/tests/test_source_package.py' ###

### flake8 '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/tests/test_source_package.py' ###

### pylint '/home/bryce/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing/tests/test_source_package.py' ###

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

stirling: ~/src/PpaDevTools/ppa-dev-tools-feature-rdepends-testing$ python3 -m ppa.source_package
####################################
## SourcePackage class smoke test ##
####################################

Source Packages
---------------
aalib (1.4p5-50build1)
autopkgtest (5.25ubuntu4)
autotools-dev (20220109.1)
b43-fwcutter (1:019-8)
x-kit (0.5.0ubuntu6)
x11-apps (7.7+9)
x11-session-utils (7.7+5)
x11-utils (7.7+5build2)
x11-xkb-utils (7.7+7)
x11-xserver-utils (7.7+9build1)
...
xserver-xorg-video-dummy (1:0.4.0-1)
xserver-xorg-video-fbdev (1:0.5.0-2build1)
xserver-xorg-video-intel (2:2.99.917+git20210115-1)
xserver-xorg-video-nouveau (1:1.0.17-2build1)
xserver-xorg-video-qxl (0.1.5+git20200331-3)
xserver-xorg-video-vesa (1:2.5.0-1build4)
xserver-xorg-video-vmware (1:13.3.0-3.1)
xtrans (1.4.0-1)
xwayland (2:22.1.8-1)
zvmcloudconnector (2.0.0~b1~git2019062011.4fc9142.really.1.4.1-0ubuntu3)

Details for "dovecot"
---------------------
* Object:
{ 'architecture': 'any',
    'binary': 'dovecot-core, dovecot-dev, dovecot-imapd, dovecot-pop3d, '
              'dovecot-lmtpd, dovecot-managesieved, dovecot-pgsql, '
              'dovecot-mysql, dovecot-sqlite, dovecot-ldap, dovecot-gssapi, '
              'dovecot-sieve, dovecot-solr, dovecot-lucene, '
              'dovecot-submissiond, dovecot-auth-lua',
    'build_depends': 'debhelper-compat (= 13), default-libmysqlclient-dev, '
                     'krb5-multidev, libapparmor-dev [linux-any], libbz2-dev, '
                     'libcap-dev [linux-any], libclucene-dev, libdb-dev, '
                     'libexpat-dev, libexttextcat-dev, libicu-dev, '
                     'libldap2-dev, liblua5.3-dev, liblz4-dev, liblzma-dev, '
                     'libpam0g-dev, libpq-dev, libsasl2-dev, libsodium-dev, '
                     'libsqlite3-dev, libssl-dev, libstemmer-dev, '
                     'libsystemd-dev [linux-any], libunwind-dev [amd64 arm64 '
                     'armel armhf hppa i386 ia64 mips mips64 mips64el mipsel '
                     'powerpc powerpcspe ppc64 ppc64el sh4], libwrap0-dev, '
                     'libzstd-dev, lsb-release, pkg-config, zlib1g-dev',
    'checksums_sha1': '\n'
                      ' 481053992c60990f765e0f671e6fc08e910a50b7 3977 '
                      'dovecot_2.3.19.1+dfsg1-2ubuntu4.dsc\n'
                      ' cdf68b407f1237e92987c6353c9596f3458e2126 '
                      '1636590 dovecot_2.3.19.1+dfsg1.orig-pigeonhole.tar.gz\n'
                      ' a35f87db78847ba469d9b0e3b72f15f8c5d1d9b0 '
                      '7790851 dovecot_2.3.19.1+dfsg1.orig.tar.gz\n'
                      ' b50aac6b2aac52744e7ef459030bfefd15cedc71 67620 '
                      'dovecot_2.3.19.1+dfsg1-2ubuntu4.debian.tar.xz\n'
                      ' ',
    'checksums_sha256': '\n'
                        ' '
                        '560f603209443dc92f5941dc1a5b737e3a743defc45d56a1a48df3846deed0f8 '
                        '3977 dovecot_2.3.19.1+dfsg1-2ubuntu4.dsc\n'
                        ' '
                        '9bc08c0eeefd75452033e022936968ff0ddad037672effdffc4a7c8dd360b8e0 '
                        '1636590 '
                        'dovecot_2.3.19.1+dfsg1.orig-pigeonhole.tar.gz\n'
                        ' '
                        'db5abcd87d7309659ea6b45b2cb6ee9c5f97486b2b719a5dd05a759e1f6a5c51 '
                        '7790851 dovecot_2.3.19.1+dfsg1.orig.tar.gz\n'
                        ' '
                        '7477feb66c8b8b4bab6fa4aadaab8675d308d575e5af662769e179a4fd6e289f '
                        '67620 dovecot_2.3.19.1+dfsg1-2ubuntu4.debian.tar.xz\n'
                        ' ',
    'checksums_sha512': '\n'
                        ' '
                        '26ab2a3b3a29ee0734ffccbad826b68b8b290715b0dbebdc07e87bac66c5be07cb0bc303c8795fb9dab8c90c9802887ac7c2ddff4b4d789bbc61080a47379e1b '
                        '3977 dovecot_2.3.19.1+dfsg1-2ubuntu4.dsc\n'
                        ' '
                        'a3d1ebab2896954d159af11df3de3993493ae304343fa41d7f408427f8bd19b3061a09017cfe2b62145b4aacaed87b1d9718418b3c73ae9ea700865844e5af39 '
                        '1636590 '
                        'dovecot_2.3.19.1+dfsg1.orig-pigeonhole.tar.gz\n'
                        ' '
                        'ceb87a5f76b6352d28fd030aae5ad2165a133e9a8a6309891e793911203fc0ada9fb254dc05d183eaaa7e2b9851d3f1755b33f08fa6ff5b4b415ac4272bfe150 '
                        '7790851 dovecot_2.3.19.1+dfsg1.orig.tar.gz\n'
                        ' '
                        '2e5f62cb3d9685b57f76dbdf81edd2de6df7063ce96d39e75241ee63ab522acd7c7be932ed5d6ed898e5d6e179dd7e226e011226fd3b4271af562af8fe56ec89 '
                        '67620 dovecot_2.3.19.1+dfsg1-2ubuntu4.debian.tar.xz\n'
                        ' ',
    'directory': 'pool/main/d/dovecot',
    'files': '\n'
             ' 146ac1a3b2a90d96b7fe8c458a561ae2 3977 '
             'dovecot_2.3.19.1+dfsg1-2ubuntu4.dsc\n'
             ' f8c84c45b05352d55c3dbd509389cc25 1636590 '
             'dovecot_2.3.19.1+dfsg1.orig-pigeonhole.tar.gz\n'
             ' c334e8ef30546af8a668437f046f3f15 7790851 '
             'dovecot_2.3.19.1+dfsg1.orig.tar.gz\n'
             ' c3e7d443a8f4854897d338a56f85c936 67620 '
             'dovecot_2.3.19.1+dfsg1-2ubuntu4.debian.tar.xz\n'
             ' ',
    'format': '3.0 (quilt)',
    'homepage': 'https://dovecot.org/',
    'maintainer': 'Ubuntu Developers <email address hidden>',
    'original_maintainer': 'Dovecot Maintainers <email address hidden>',
    'package': 'dovecot',
    'package_list': '\n'
                    ' dovecot-auth-lua deb mail optional arch=any\n'
                    ' dovecot-core deb mail optional arch=any\n'
                    ' dovecot-dev deb mail optional arch=any\n'
                    ' dovecot-gssapi deb mail optional arch=any\n'
                    ' dovecot-imapd deb mail optional arch=any\n'
                    ' dovecot-ldap deb mail optional arch=any\n'
                    ' dovecot-lmtpd deb mail optional arch=any\n'
                    ' dovecot-lucene deb mail optional arch=any\n'
                    ' dovecot-managesieved deb mail optional arch=any\n'
                    ' dovecot-mysql deb mail optional arch=any\n'
                    ' dovecot-pgsql deb mail optional arch=any\n'
                    ' dovecot-pop3d deb mail optional arch=any\n'
                    ' dovecot-sieve deb mail optional arch=any\n'
                    ' dovecot-solr deb mail optional arch=any\n'
                    ' dovecot-sqlite deb mail optional arch=any\n'
                    ' dovecot-submissiond deb mail optional arch=any\n'
                    ' ',
    'priority': 'optional',
    'section': 'mail',
    'standards_version': '4.6.1',
    'testsuite': 'autopkgtest',
    'testsuite_triggers': 'lsb-release, python3, systemd-sysv',
    'uploaders': 'Jaldhar H. Vyas <email address hidden>, Jelmer Vernooij '
                 '<email address hidden>, Apollon Oikonomopoulos '
                 '<email address hidden>, Noah Meyerhans <email address hidden>',
    'vcs_browser': 'https://salsa.debian.org/debian/dovecot',
    'vcs_git': 'https://salsa.debian.org/debian/dovecot.git',
    'version': '1:2.3.19.1+dfsg1-2ubuntu4'}

* Provides Binaries:
  - dovecot-auth-lua
  - dovecot-core
  - dovecot-dev
  - dovecot-gssapi
  - dovecot-imapd
  - dovecot-ldap
  - dovecot-lmtpd
  - dovecot-lucene
  - dovecot-managesieved
  - dovecot-mysql
  - dovecot-pgsql
  - dovecot-pop3d
  - dovecot-sieve
  - dovecot-solr
  - dovecot-sqlite
  - dovecot-submissiond

* Build Dependencies:
  - debhelper-compat: (= 13)
  - default-libmysqlclient-dev:
  - krb5-multidev:
  - libapparmor-dev: [linux-any]
  - libbz2-dev:
  - libcap-dev: [linux-any]
  - libclucene-dev:
  - libdb-dev:
  - libexpat-dev:
  - libexttextcat-dev:
  - libicu-dev:
  - libldap2-dev:
  - liblua5.3-dev:
  - liblz4-dev:
  - liblzma-dev:
  - libpam0g-dev:
  - libpq-dev:
  - libsasl2-dev:
  - libsodium-dev:
  - libsqlite3-dev:
  - libssl-dev:
  - libstemmer-dev:
  - libsystemd-dev: [linux-any]
  - libunwind-dev: [amd64 arm64 armel armhf hppa i386 ia64 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el sh4]
  - libwrap0-dev:
  - libzstd-dev:
  - lsb-release:
  - pkg-config:
  - zlib1g-dev:

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks Bryce!

I have a few comments inline, mostly regarding the usage of the internal class instance data structures.

Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks for the review, I've addressed all the points inline, and force-push updated the branch for re-review.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Bryce!

LGTM.

I left one nitpick inline regarding a leftover __dict__ call. Feel free to address or ignore before merging this!

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Good catch. There was also another __dict__ down in the smoketest I've switched to using vars().

I'll also apply the same notes to the BinaryPackage class.

Thanks again!

Revision history for this message
Bryce Harrington (bryce) wrote :

Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To git+ssh://git.launchpad.net/ppa-dev-tools
   5af05a5..22e2642 main -> main

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: