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

feat(python): updates python support #308

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

invincibleJai
Copy link
Collaborator

  • updates python support

src/Utils.ts Outdated Show resolved Hide resolved
test/utils.test.ts Outdated Show resolved Hide resolved
@invincibleJai
Copy link
Collaborator Author

[test]

1 similar comment
@invincibleJai
Copy link
Collaborator Author

[test]

@invincibleJai invincibleJai changed the title [WIP]feat(python): updates python support [Don't Merge]feat(python): updates python support May 20, 2019
@sivaavkd
Copy link
Contributor

LGTM

@invincibleJai invincibleJai changed the title [Don't Merge]feat(python): updates python support feat(python): updates python support Jul 30, 2019
Copy link
Member

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

lgtm

@arajkumar
Copy link
Member

arajkumar commented Jul 31, 2019

export const PYPI_INTERPRETOR_CMD = `-c 'exec("""\nimport pkg_resources as pr;import json,sys;gd=pr.get_distribution;res=list();\nfor i in open(sys.argv[1]):\n try:\n rs={};I=gd(i);rs["package"]=I.key;rs["version"]=I.version;rs["deps"]=set();\n for j in pr.require(i):\n for k in j.requires():\n K=gd(k);rs["deps"].add((K.key, K.version))\n rs["deps"]=[{"package":p,"version":v}for p,v in rs["deps"]];res.append(rs)\n except: pass\na=sys.argv[2:3]\nop=open(a[0],"w")if a else sys.stdout\njson.dump(res,op)\n""")'`;

For a better readability and maintainability, We should consider to clean up & keep the above snippet as a separate python file.

@arajkumar arajkumar merged commit 51314d6 into fabric8-analytics:master Aug 8, 2019
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.

3 participants