Merge lp://qastaging/~mvo/click/multiple-frameworks into lp://qastaging/click

Proposed by Michael Vogt
Status: Merged
Approved by: Colin Watson
Approved revision: 420
Merged at revision: 421
Proposed branch: lp://qastaging/~mvo/click/multiple-frameworks
Merge into: lp://qastaging/click
Diff against target: 370 lines (+221/-59)
6 files modified
click/build.py (+10/-22)
click/framework.py (+135/-0)
click/install.py (+8/-28)
click/tests/helpers.py (+27/-0)
click/tests/test_build.py (+39/-5)
click/tests/test_install.py (+2/-4)
To merge this branch: bzr merge lp://qastaging/~mvo/click/multiple-frameworks
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+218280@code.qastaging.launchpad.net

Description of the change

This branch adds support for multiple frameworks in a click manifest.

To support multiple frameworks there is now a "click/framework.py" file that contains a new "validate_framework()" method that is used by build.py and install.py to validate the given framework string.

validate_framework() will ensure that:
- the base version is the same for all frameworks used
- no additional relations like >= or similar is used in the framework declaration string
- no or dependencies (foo|bar) is used in the framework declaration string

It is possible to override if missing_frameworks is a error or a warning. Logging is used when this is overriden. I'm happy to use a different mechanism if logging is inappropriate.

The test helper gets a new click.test.helpers.TestCase._create_mock_framework_{dir,file} that is used in both test_build.py and test_install.py

I currently use the pure-python version of click_framework_get_base_version() - we could use the native version when available but I wonder if that is really needed given that both build and install are already in python so the overhead of using the python version seems to be not a issue here.

If there is anything else you would like me to change or do differently, please just let me know, happy to do it.

Thanks!
 Michael

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

We ought to avoid exposing the CLICK_FRAMEWORKS_DIR environment variable interface when it's only for tests; tests should be able to install mock functions as appropriate to override the frameworks directory. And as you say the default framework directory should be generated by configure - I suspect that undoing the change to click/paths.py.in from r372.1.1 would be enough for this.

However, this doesn't need to block merging, and you can clean it up at your leisure. Other than that I see nothing to complain about here. Thanks!

review: Approve

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: