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

Add Lookup and misc updates. #14

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python-version: ${{ matrix.python }}
- run:
pip install -ve .[tests]
pip install mypy
pip install mypy sphinx
- run:
pytest tests
- run:
Expand Down
20 changes: 20 additions & 0 deletions intersphinx_registry/lookup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import sys

from intersphinx_registry import get_intersphinx_mapping
import logging as _logging
from sphinx.ext.intersphinx import inspect_main

if len(sys.argv) != 2:
sys.exit("Usage: python -m intersphinx_registry.lookup <package>")

packages = set([sys.argv[1]])

# there will be only one url
urls = [
u[0] + (u[1] if u[1] else "objects.inv")
for u in get_intersphinx_mapping(packages=packages).values()
]


_logging.basicConfig()
raise SystemExit(inspect_main(urls))