-
Notifications
You must be signed in to change notification settings - Fork 11
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
Parse a Pom from a plain pom file path #4
Comments
Thought I responded to this back when you first opened the ticket, but something must of eaten my comment. I'm working to add two classmethods, Pom.fromstring() and Pom.parse(). They're modeled on the lxml.etree functions of the same name. The client will be optional and we'll just forgo all of the dynamic loading of external POMs data. I'm up in the air about whether to still require the maven coordinates. Currently those are used to set the groupId, artifactId and version without needing to parse the POM data first. Not sure how useful that is if you're working without a repository client. |
Adds the classmethods Pom.fromstring and Pom.parse. These are modeled on the lxml.etree functions of the same name. If a MavenClient is passed in, then the resulting Pom object will attempt to dynamically load data from external POM files available via the client. Sem-Ver: feature Fixes: sassoftware#4
* this allow subclasses working without clients to override the _get_pom_factory method and return plain artifacts from coordinates rather than full Pom objects when there is no client to retrieve an artifact remotely. Link: sassoftware#3 Link: sassoftware#4 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
The constructor of Pom is restricted because it assumes that I must know "coordinates" ahead of time
pymaven/pymaven/pom.py
Line 49 in 3a844cd
And that I have effectively some repo that handles the retrieval. In my usecase for ScanCode as a possible replacement of this https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/maven.py I need to be able to parse a POM from some file path and nothing else. I do not have a "repo" nor do I know the "coordinates" yet: the whole purpose of parsing for me is to discover these....
So I am left with this alternative:
I hate 2. but I cannot see a way around this? @wfscheper what do you think?
The text was updated successfully, but these errors were encountered: