Merge lp://qastaging/~jml/pkgme/api-rationalization into lp://qastaging/pkgme

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: 170
Merged at revision: 139
Proposed branch: lp://qastaging/~jml/pkgme/api-rationalization
Merge into: lp://qastaging/pkgme
Diff against target: 524 lines (+185/-175)
9 files modified
NEWS.txt (+10/-1)
pkgme/__init__.py (+16/-4)
pkgme/api.py (+91/-65)
pkgme/backend.py (+5/-1)
pkgme/backends/python/all_info (+0/-2)
pkgme/bin/main.py (+39/-18)
pkgme/project_info.py (+11/-0)
pkgme/tests/test_api.py (+3/-79)
pkgme/tests/test_script.py (+10/-5)
To merge this branch: bzr merge lp://qastaging/~jml/pkgme/api-rationalization
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+122533@code.qastaging.launchpad.net

Commit message

Clean up the public API

Description of the change

Takes the pkgme.api module and makes the public functions a bit more consistent and useful, and writes the script and other exported functions in terms of those.

Builds on recent work to supplement the backends API with methods that expose more data.

The big new method is ``get_all_info``, which gets absolutely everything that we have on how a thing should be packaged.

It is accompanied by packaging_info_as_data, which turns that into something we can serialize as JSON. I guess this could be done as an encoder.

We deprecate ``write_packaging``, which does too much, in favour of ``write_packaging_info``, which takes part of the output of ``get_all_info`` and writes it out.

The functions all have docstrings, and everything that lacks an underscore prefix is in __all__, and everything that is in __all__ is supposed to be there.

I've tried to maintain backwards compatibility, but I might have broken bits. Sorry.

Thanks,
jml

To post a comment you must log in.
169. By Jonathan Lange

Update NEWS on deprecations.

Revision history for this message
Jonathan Lange (jml) wrote :

Oh, I think we could probably kill pkgme.bin.main.get_all_info. It's unused in pkgme and I really doubt anyone externally relies on it.

Revision history for this message
James Westby (james-w) wrote :

+1 on dropping pkgme.bin.main.get_all_info.

Thanks,

James

review: Approve
170. By Jonathan Lange

Drop get_all_info.

Revision history for this message
Jonathan Lange (jml) wrote :

Thanks.

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