-
Notifications
You must be signed in to change notification settings - Fork 1
Homepage project urls #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,65 @@ things, with as minimal dependencies as possible: | |
| 1. Support just enough metadata to be able to look up deps. | ||
| 2. Do "the thing that pip does" when deciding what dist-info dir to look at. | ||
|
|
||
| # Usage | ||
|
|
||
| Example snippet to show how to get the metadata from a wheel. | ||
|
|
||
| ```python | ||
| from zipfile import ZipFile | ||
| from metadata_please import basic_metadata_from_wheel | ||
|
|
||
| zf = ZipFile('somepkg.whl') | ||
| print(basic_metadata_from_wheel(zf, "somepkg")) | ||
| ``` | ||
|
|
||
| ### Output | ||
|
|
||
| ``` | ||
| BasicMetadata( | ||
| reqs=[ | ||
| 'cli-helpers[styles] >=2.2.1', | ||
| 'click >=4.1', | ||
| 'configobj >=5.0.5', | ||
| 'prompt-toolkit <4.0.0,>=3.0.3', | ||
| 'pygments >=1.6', | ||
| 'sqlparse >=0.4.4', | ||
| "behave >=1.2.6 ; extra == 'dev'", | ||
| "coverage >=7.2.7 ; extra == 'dev'", | ||
| "pexpect >=4.9.0 ; extra == 'dev'", | ||
| "pytest >=7.4.4 ; extra == 'dev'", | ||
| "pytest-cov >=4.1.0 ; extra == 'dev'", | ||
| "tox >=4.8.0 ; extra == 'dev'", | ||
| "pdbpp >=0.10.3 ; extra == 'dev'" | ||
| ], | ||
| provides_extra=frozenset({'dev'}), | ||
| name='litecli', | ||
| version='1.12.4', | ||
| requires_python='>=3.7', | ||
| url=None, | ||
| project_urls={'homepage, https://github.com/dbcli/litecli': ''}, | ||
| author=None, | ||
| author_email='dbcli <[email protected]>', | ||
| summary='CLI for SQLite Databases with auto-completion and syntax highlighting.', | ||
| description='# litecli\n\n[](https://github.com/dbcli/litecli/actions/workflows/ci.yml "GitHub | ||
| Actions")\n\n[Docs](https://litecli.com)\n\nA command-line client for SQLite databases that has auto-completion and syntax | ||
| highlighting.\n\n\n\n\n## Installation\n\nIf you already know how to install python | ||
| packages, then you can install it via pip:\n\nYou might need sudo on linux.\n\n```\n$ pip install -U litecli\n```\n\nThe package is also available on Arch Linux through | ||
| AUR in two versions: [litecli](https://aur.archlinux.org/packages/litecli/) is based the latest release (git tag) and | ||
| [litecli-git](https://aur.archlinux.org/packages/litecli-git/) is based on the master branch of the git repo. You can install them manually or with an AUR helper such as | ||
| `yay`:\n\n```\n$ yay -S litecli\n```\n\nor\n\n```\n$ yay -S litecli-git\n```\n\nFor MacOS users, you can also use Homebrew to install it:\n\n```\n$ brew install | ||
| litecli\n```\n\n## Usage\n\n```\n$ litecli --help\n\nUsage: litecli [OPTIONS] [DATABASE]\n\nExamples:\n - litecli sqlite_db_name\n```\n\nA config file is automatically | ||
| created at `~/.config/litecli/config` at first launch. For Windows machines a config file is created at `~\\AppData\\Local\\dbcli\\litecli\\config` at first launch. See | ||
| the file itself for a description of all available options.\n\n## Docs\n\nVisit: [litecli.com/features](https://litecli.com/features)\n', | ||
| keywords=None, | ||
| long_description_content_type='text/markdown' | ||
| ) | ||
|
|
||
| ``` | ||
|
|
||
| The metadata can be extracted from a `wheel`, `sdist` (zip or tarball) or a source checkout (best effort). Check [`__init__.py`](metadata_please/__init__.py) file for all available functions. | ||
|
|
||
| # Version Compat | ||
|
|
||
| Usage of this library should work back to 3.7, but development (and mypy | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Sequence | ||
| from typing import Mapping, Sequence | ||
|
|
||
|
|
||
| class MemoryZipFile: | ||
| def __init__(self, names: Sequence[str], read_value: bytes = b"foo") -> None: | ||
| self.names = names | ||
| self.read_value = read_value | ||
| def __init__(self, mock_files: Mapping[str, bytes] = {}) -> None: | ||
| self.mock_files = mock_files | ||
| self.files_read: list[str] = [] | ||
|
|
||
| def namelist(self) -> Sequence[str]: | ||
| return self.names[:] | ||
| return list(self.mock_files.keys()) | ||
|
|
||
| def read(self, filename: str) -> bytes: | ||
| self.files_read.append(filename) | ||
| return self.read_value | ||
| return self.mock_files[filename] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 long-term these shouldn't raise; the snippets above do that because finding deps was the original use of this. It doesn't matter for your artifact-validation use case though.