Skip to content

Fix pip show parsing#140

Open
giggsoff wants to merge 4 commits intoarenadata:masterfrom
giggsoff:fix-pip-show-parsing
Open

Fix pip show parsing#140
giggsoff wants to merge 4 commits intoarenadata:masterfrom
giggsoff:fix-pip-show-parsing

Conversation

@giggsoff
Copy link
Contributor

pip show returns not valid yaml, i.e. for pip show ipython we can see Summary: IPython: Productive Interactive Computing. So we should extract only required fields (Location, Files and children of Files)

@giggsoff giggsoff force-pushed the fix-pip-show-parsing branch 2 times, most recently from ab4f6e5 to 6631616 Compare February 20, 2023 13:47
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@giggsoff giggsoff force-pushed the fix-pip-show-parsing branch from 6631616 to 50505f6 Compare January 11, 2024 13:47
@giggsoff giggsoff requested a review from a team as a code owner January 11, 2024 13:47
elif in_files_section and line.startswith(" "):
resulting_lines.append(line)
else:
in_files_section = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be a separate function like "sanitize input" with doctests/tests for the function itself

Now it's very complicated to read and understand what's the expected output

With separate function we'll see if it can be reworked somehow based on input and output presented in tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thank you! Let me split it and prepare unit test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified.
Few comments:

  1. I am not sure that unit tests running in CI
  2. I can see strange error mkdir: can't create directory '/tmp/build_with_requirements_83tq3m3l/community/pmod': No such file or directory\ncp:...': No such file or directory\nchown: /tmp/build_with_requirements_83tq3m3l/community/pmod: No such file or directory\n". Looks like it come during creation of pmod directory, which looks not related with PR changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was able to avoid the problem with mkdir: can't create directory using workspace derived from the current tests directory instead of /tmp, this is still weird but seems environment related and not PR related.

pip show returns not valid yaml, i.e. for pip show ipython
we can see "Summary: IPython: Productive Interactive Computing"
so we should extract only required fields
(Location, Files and children of Files)

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
@giggsoff giggsoff force-pushed the fix-pip-show-parsing branch 2 times, most recently from 1482d43 to ebbe73a Compare January 26, 2024 11:51
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
Signed-off-by: Petr <giggsoff@gmail.com>
@giggsoff giggsoff force-pushed the fix-pip-show-parsing branch 2 times, most recently from 0d157e4 to 59e9f79 Compare January 29, 2024 13:39
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
@giggsoff giggsoff force-pushed the fix-pip-show-parsing branch from 59e9f79 to 15e0a97 Compare January 29, 2024 14:10
@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@giggsoff giggsoff requested a review from Sealwing January 29, 2024 14:28
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.

2 participants