Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python plugin: output json in pip list #1393

Merged
merged 2 commits into from Jul 11, 2017
Merged

Conversation

come-maiz
Copy link
Contributor

@come-maiz come-maiz commented Jul 6, 2017

LP: #1683395

return {
package['name']: package['version']
for package in json.loads(output)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks lovely, much cleaner.

Please add a test case based on the bug, with a config file init that tries to set the format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a python integration test, which is very slow.
I'm happy here just checking that the existing tests are still passing, confirming that this change is transparent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really agree with your points to be honest, it's just no tested at the end of the day.

Perhaps we should run python integration tests daily if it's that bad?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are testing that --json returns a list of packages just in the format we require, which is the only thing I'm after here, because it enables me to rely on that for the next branch about asset tracking.

We are not testing anything related to the local config file. And I'm ok with that because the config affects many more things than the output of pip list. As I mentioned on the bug, that's a separate and bigger problem that should probably be solved with your suggestion about the environment variable.

The solution for the slow integration tests is to run them in parallel. Running lxc in travis will allow us to start working on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. The way you put this PR in the context of the bug report made it seem to me as if it's addressing the bug, which isn't the case. It's just improving the parsing. A follow-up is going to be needed.

@sergiusens sergiusens added this to the 2.33 milestone Jul 11, 2017
@sergiusens sergiusens merged commit ea4e9aa into canonical:master Jul 11, 2017
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Aug 3, 2017
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants