-
-
Notifications
You must be signed in to change notification settings - Fork 0
Handle podspec file #2
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
Conversation
rpotter12
commented
Jul 15, 2020
- add code to handle podspec file.
- update scripts to detect all types of dependencies from the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpotter12 Are the various formatting changes done by you or by some formatter tool?
Also, we probably want to Add or Update the README file to explain the reason for the fork and what exactly is different than gemfileparser
@MaJuRG All the formatting changes are done by me only. :)
Okay. I will update the README file soon :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpotter12 Since we fork, I am not sure we want to have stuff like syntax changes. I think in general, formatting changes like this are a good thing. I am more concerned about having a clean diff in case we want to merge this in upstream in the future.
@pombredanne What is your take here?
@rpotter12 Other than that particular minor issue, this looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I only have a few nits for your review... but most and foremost we need to have tests for these before we can merge.
|
||
def __init__(self): | ||
self.name = None | ||
self.name = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use empty strings instead of None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the repo which we have forked is some commits behind. Using empty strings here are the original changes in the upstream repo. And may be this is helpful in extracting data from gemfile
files.
self.group = None | ||
self.platform = None | ||
self.platforms = [] | ||
self.groups = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you removed these attributes because they are either not in the spec or seldom used or parsable?
platform is still a thing though rarely there alright https://guides.rubygems.org/specification-reference/#platform=
Can you confirm?
I never saw a group in a spec so far... did you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are used in gemfile
files. gemfileparser
is for both gemspec and gemfile but I think @balankarc have implement these in another way so he removed this in the original repository :)
def parse_line(self, line): | ||
'''Parses each line and creates dependency objects accordingly''' | ||
""" | ||
Parses each line and creates dependency objects accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the imperative style for docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it soon :)
dep.parent = [] | ||
else: | ||
linefile = io.StringIO(line) # csv requires a file object | ||
for line in csv.reader(linefile, delimiter=','): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind my the benefits of using a CSV module here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @balasankarc used this CSV module here because dependency contains name and different version numbers and they are seperated by comma and they have to split by comma and if we use something else then to remove extra character the code will become more complex. CSV module might have make this easy to remove extra characters. I guess this might be the only good solution to use CSV module here.
'download_url': 'https://gitlab.com/balasankarc/gemfileparser', | ||
'author_email': 'balasankarc@autistici.org', | ||
'description': "A library to parse Rubygem gemspec and Gemfile files and Cocoapods podspec and Podfile files using Python. Friendly fork of https://gitlab.com/balasankarc/gemfileparser", | ||
'author': 'nexB', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the original author name there. Or something like `Rohit Potter for nexB based on original work of Balasankar C' ... but in all cases we want Balasankar to get proper credits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okh :)
I will change this in new commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case we get to collaborate and move development upstream as suggested in #2 (comment), this can definitely change to an AUTHOR file based logic so that every contributor gets credit. 🙂
Never mind the auto close.... that's Github playing tricks on us. |
@pombredanne @rpotter12 Wanted to open an issue about this, but since issue tracker is not enabled here I am "hijacking" this thread. 😀 Sorry about that. If you are interested, I am more than happy to move |
@balasankarc Thank you for your reply :) Thank you so much for you reply :) |
@balasankarc re
That would be great! We can either create a new org or we can host it under nexB org as this is meant for use directly in https://github.com/nexB/scancode-toolkit which is in the same org. (ScanCode is a tool that you should consider for use in Gitlab ... even if this is Python and not Ruby as this is the best tool out there for license detection ;) Note that I would like also to fold in that gemfileparser library the support we have for Gemfile.lock in here https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/gemfile_lock.py So your call in anycase. |
@pombredanne If you have a PyPi profile, please share your email address and I can add you as a Maintainer to the package there too so you can update the package. I will update README and add an AUTHOR file and everything in upstream repo soon. |
@balasankarc you wrote:
Moved upstream to https://github.com/gemfileparser/gemfileparser
Synced GitHub with GitLab. Now both of them should have same code.
Added @pombredanne as an owner to https://github.com/gemfileparser so the needful can be done without depending on me.
@pombredanne If you have a PyPi profile, please share your email address and I can add you as a Maintainer to the package there too so you can update the package.
I will update README and add an AUTHOR file and everything in upstream repo soon.
That's great! Thank you: I am pombredanne @ PyPI too.
@rpotter12 can you move your PR to
https://github.com/gemfileparser/gemfileparser then?
…--
Cordially
Philippe Ombredanne
|
Closing these as we eventually used and pushed all these upstream! |
* Add PEP 517/518 pyproject.toml file * Add setuptools_scm to handle versioning * Add setup.py content to setup.cfg * Update setup.py to act as a shim (so pip install -e works) Addresses: #2 Signed-off-by: Steven Esser <sesser@nexb.com>