Add constraints to python2 plugin #657

Merged
merged 1 commit into from Aug 10, 2016

Conversation

Projects
None yet
4 participants
Contributor

SamYaple commented Jul 14, 2016

LP:#1603110

There is currently no support for constraints[1] files with the python2 plugin. Some projects make heavy use of constraints. OpenStack is one such project

[1] https://pip.pypa.io/en/stable/user_guide/#constraints-files

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Contributor

SamYaple commented Jul 15, 2016

this PR is waiting for other PRs which improve the test coverage of the python2 module, at that point this will be rebased

Collaborator

sergiusens commented Aug 2, 2016

unit tests failed here

Collaborator

sergiusens commented Aug 2, 2016

but good work so far :-)

Collaborator

sergiusens commented Aug 3, 2016

snapcraft/plugins/python2.py:126:1: C901 'Python2Plugin._pip' is too complex (10)

./runtests.sh static to reproduce locally

It would be nice if the python3 plugin could support constraints as well - it has general applicability across pip installations.

We might want to rework the python plugins a bit to have a common base - I can see alot of common code.

Contributor

SamYaple commented Aug 4, 2016

@javacruft thats next, want to get this working and approved before implementing py3 patch

refactoring isn't the worst idea. ill look into it. just trying to get these plugins usable for my needs

Contributor

SamYaple commented Aug 4, 2016

@sergiusens running locally doesnt produce that error for complexity, even after rebase onto master. I probably havent pushed something up so ill check on it.

Add constraints to python2 plugin
To reduce the complexity of _pip(), some code has been moved into its
own function. Without this change we are triggering C901 and failing
tests.

LP:#1603110
Collaborator

sergiusens commented Aug 9, 2016

ok to test

Collaborator

sergiusens commented Aug 10, 2016

Thanks for this

@sergiusens sergiusens merged commit b269167 into snapcore:master Aug 10, 2016

4 checks passed

autopkgtest integration Success
Details
autopkgtest snaps Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.003%) to 97.166%
Details

@SamYaple SamYaple deleted the SamYaple:python2_constraints branch Sep 14, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

python2 plugin: Add support for constraints (#657)
To reduce the complexity of _pip(), some code has been moved into its
own function. Without this change we are triggering C901 and failing
tests.

LP:#1603110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment