GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Support Custom Artifactory Repositories for Package Metadata by voidpetal · Pull Request #258 · aboutcode-org/python-inspector Conversation
|
| if repos: | ||
| # Convert to list if needed and use first repo's index_url | ||
| repos_list = list(repos) if not isinstance(repos, list) else repos | ||
| base_path = repos_list[0].index_url.replace("/simple", "/pypi") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What is this doing? this is weird: what if you have 10 repos?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point, I initially opted out for a half-solution to get the first repository. However now I updated it to try all available repositories until it hits a success. Let me know if this aligns with your expectations.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| for url_entry in response.get("urls") or []: | ||
| url = url_entry.get("url") | ||
| if url: | ||
| # Resolve relative URLs (from Artifactory) to absolute URLs |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do you have Artifactory examples? and what about nexus or others?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am not aware of any public Artifactory URL to share freely.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| def get_file_match_key(url: str, sha256: Optional[str] = None) -> tuple: | ||
| """ | ||
| Extract a match key (filename, sha256) for comparing distribution files. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Use our comment style: `Return ....
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This function was unused, sorry I overlooked it..
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| continue | ||
|
|
||
| url_data = urls.get(dist_url) | ||
| url_data = urls_by_filename[filename] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this will not fail?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You're right, replaced with urls_by_filename.get(filename)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3cafbe0 to
672f569
Compare
There was an error while loading. Please reload this page.
|
Hi @pombredanne, Thanks a lot for your review! I have amended the PR and commit descriptions as you proposed and the amended code is ready for your further review. Please let me know if you would like me to do anything else! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
672f569 to
e5ddeeb
Compare
40dbfa4 to
9fdb092
Compare
|
@voidpetal we have now #261 that was merged, which has a similar goal. There are a few issues in both cases, as there are cases where #261 and this code here may not work all the times. In particular, Artifactory is peculiar in that it does not support the simple API, but Nexus does, and of course PyPI does too. We will need to refine all that with proper tests as we cannot assume that we have to always a (slow) pypi/ endpoint over a a (faster) simple/ endpoint, especially when not using Artifactory |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @pombredanne, thanks for letting me know! I checked and it seems that with the new release our issues were resolved. So I am fine also closing this PR. Let me know if there is something you'd like to keep from this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9fdb092 to
0d45a34
Compare
Artifactory URLs have different path structures than PyPI URLs, but filenames are identical. When exact URL match fails, fall back to matching by filename to ensure packages array is populated. Signed-off-by: Kai Hodžić <[email protected]>
Artifactory might return `project_urls: null` even for public packages. Now iterates through all index_urls and falls back to PyPI.org to get VCS metadata when Artifactory has incomplete data. Signed-off-by: Kai Hodžić <[email protected]>
This helps ORT resolve VCS provenance when artifact download fails. Populated from code_view_url Signed-off-by: Kai Hodžić <[email protected]>
Extract sdist URL, hash, and filename from PyPI response and include in extra_data.source_artifact for downstream consumers that need source distribution information. Signed-off-by: Kai Hodžić <[email protected]>
Signed-off-by: Kai Hodžić <[email protected]>
Signed-off-by: Kai Hodžić <[email protected]>
Signed-off-by: Kai Hodžić <[email protected]>
8824f77 to
9b10285
Compare
|
Hi @pombredanne, actually the issue wasn't fully resolved, but I updated the PR with a fix which resolves the missing metadata issue for us. In total the PR contains the following fixes:
Please let me know what you think! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.