Skip to content

Commit

Permalink
Merge pull request #34 from drammock/updates
Browse files Browse the repository at this point in the history
remove trailing slash from base URLs on readthedocs.io
  • Loading branch information
Carreau authored Oct 14, 2024
2 parents ce4b8e7 + f21cd42 commit 9430626
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 86 deletions.
148 changes: 74 additions & 74 deletions intersphinx_registry/registry.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,124 @@
{
"anndata": ["https://anndata.readthedocs.io/en/stable/", null],
"asdf-astropy": ["https://asdf-astropy.readthedocs.io/en/latest/", null],
"anndata": ["https://anndata.readthedocs.io/en/stable", null],
"asdf-astropy": ["https://asdf-astropy.readthedocs.io/en/latest", null],
"astropy-dev": ["https://docs.astropy.org/en/latest/", null],
"asv": ["https://asv.readthedocs.io/en/stable/", null],
"asyncssh": ["https://asyncssh.readthedocs.io/en/latest/", null],
"asv": ["https://asv.readthedocs.io/en/stable", null],
"asyncssh": ["https://asyncssh.readthedocs.io/en/latest", null],
"attrs": ["https://www.attrs.org/en/stable/", null],
"bhub": ["https://binderhub.readthedocs.io/en/latest/", null],
"bhub": ["https://binderhub.readthedocs.io/en/latest", null],
"bokeh": ["https://docs.bokeh.org/en/latest/", null],
"boltons": ["https://boltons.readthedocs.io/en/latest/", null],
"boltons": ["https://boltons.readthedocs.io/en/latest", null],
"bottle": ["https://bottlepy.org/docs/dev/", null],
"build": ["https://build.pypa.io/en/latest/", null],
"cartopy": ["https://scitools.org.uk/cartopy/docs/latest/", null],
"cffi": ["https://cffi.readthedocs.io/en/latest/", null],
"cffi": ["https://cffi.readthedocs.io/en/latest", null],
"click": ["https://click.palletsprojects.com/", null],
"conda": ["https://conda.io/en/latest/", null],
"cycler": ["https://matplotlib.org/cycler/", null],
"cython": ["https://docs.cython.org/en/latest/", null],
"dask": ["https://docs.dask.org/en/latest/", null],
"dateutil": ["https://dateutil.readthedocs.io/en/latest/", null],
"dateutil": ["https://dateutil.readthedocs.io/en/latest", null],
"devguide": ["https://devguide.python.org/", null],
"devpi": ["https://devpi.net/docs/devpi/devpi/latest/+doc/", null],
"dh-virtualenv": ["https://dh-virtualenv.readthedocs.io/en/latest/", null],
"dh-virtualenv": ["https://dh-virtualenv.readthedocs.io/en/latest", null],
"dipy": ["https://docs.dipy.org/stable/", null],
"distlib": ["https://distlib.readthedocs.io/en/latest/", null],
"distlib": ["https://distlib.readthedocs.io/en/latest", null],
"distributed": ["https://distributed.dask.org/en/stable/", null],
"django": [
"https://docs.djangoproject.com/en/stable/",
"https://docs.djangoproject.com/en/stable/_objects/"
],
"dlpack": ["https://dmlc.github.io/dlpack/latest/", null],
"flax": ["https://flax.readthedocs.io/en/latest/", null],
"flexx": ["https://flexx.readthedocs.io/en/latest/", null],
"fsspec": ["https://filesystem-spec.readthedocs.io/en/latest/", null],
"flax": ["https://flax.readthedocs.io/en/latest", null],
"flexx": ["https://flexx.readthedocs.io/en/latest", null],
"fsspec": ["https://filesystem-spec.readthedocs.io/en/latest", null],
"geopandas": ["https://geopandas.org/en/stable/", null],
"hub": ["https://jupyterhub.readthedocs.io/en/latest/", null],
"imageio": ["https://imageio.readthedocs.io/en/stable/", null],
"hub": ["https://jupyterhub.readthedocs.io/en/latest", null],
"imageio": ["https://imageio.readthedocs.io/en/stable", null],
"importlib-resources": [
"https://importlib-resources.readthedocs.io/en/latest/",
"https://importlib-resources.readthedocs.io/en/latest",
null
],
"ipykernel": ["https://ipykernel.readthedocs.io/en/latest/", null],
"ipyleaflet": ["https://ipyleaflet.readthedocs.io/en/latest/", null],
"ipyparallel": ["https://ipyparallel.readthedocs.io/en/latest/", null],
"ipython": ["https://ipython.readthedocs.io/en/latest/", null],
"ipywidgets": ["https://ipywidgets.readthedocs.io/en/latest/", null],
"jax": ["https://jax.readthedocs.io/en/latest/", null],
"jedi": ["https://jedi.readthedocs.io/en/latest/", null],
"ipykernel": ["https://ipykernel.readthedocs.io/en/latest", null],
"ipyleaflet": ["https://ipyleaflet.readthedocs.io/en/latest", null],
"ipyparallel": ["https://ipyparallel.readthedocs.io/en/latest", null],
"ipython": ["https://ipython.readthedocs.io/en/latest", null],
"ipywidgets": ["https://ipywidgets.readthedocs.io/en/latest", null],
"jax": ["https://jax.readthedocs.io/en/latest", null],
"jedi": ["https://jedi.readthedocs.io/en/latest", null],
"jinja": ["https://jinja.palletsprojects.com/", null],
"joblib": ["https://joblib.readthedocs.io/en/latest/", null],
"joblib": ["https://joblib.readthedocs.io/en/latest", null],
"jupyter": ["https://docs.jupyter.org/en/latest/", null],
"jupyter-server": ["https://jupyter-server.readthedocs.io/en/stable/", null],
"jupyter_core": ["https://jupyter-core.readthedocs.io/en/stable/", null],
"jupyter-server": ["https://jupyter-server.readthedocs.io/en/stable", null],
"jupyter_core": ["https://jupyter-core.readthedocs.io/en/stable", null],
"jupyterbook": ["https://jupyterbook.org/en/stable/", null],
"jupyterclient": ["https://jupyter-client.readthedocs.io/en/latest/", null],
"jupytercore": ["https://jupyter-core.readthedocs.io/en/latest/", null],
"jupytext": ["https://jupytext.readthedocs.io/en/stable/", null],
"kwarray": ["https://kwarray.readthedocs.io/en/latest/", null],
"kwimage": ["https://kwimage.readthedocs.io/en/latest/", null],
"lab": ["https://jupyterlab.readthedocs.io/en/latest/", null],
"llvmlite": ["https://llvmlite.readthedocs.io/en/latest/", null],
"jupyterclient": ["https://jupyter-client.readthedocs.io/en/latest", null],
"jupytercore": ["https://jupyter-core.readthedocs.io/en/latest", null],
"jupytext": ["https://jupytext.readthedocs.io/en/stable", null],
"kwarray": ["https://kwarray.readthedocs.io/en/latest", null],
"kwimage": ["https://kwimage.readthedocs.io/en/latest", null],
"lab": ["https://jupyterlab.readthedocs.io/en/latest", null],
"llvmlite": ["https://llvmlite.readthedocs.io/en/latest", null],
"lxml": ["https://lxml.de/apidoc/", null],
"magicgui": ["https://pyapp-kit.github.io/magicgui/", null],
"markdown_it": ["https://markdown-it-py.readthedocs.io/en/latest/", null],
"markdown_it": ["https://markdown-it-py.readthedocs.io/en/latest", null],
"matplotlib": ["https://matplotlib.org/stable/", null],
"meson-python": ["https://meson-python.readthedocs.io/en/stable/", null],
"meson-python": ["https://meson-python.readthedocs.io/en/stable", null],
"mne": ["https://mne.tools/stable/", null],
"mne_bids": ["https://mne.tools/mne-bids/stable/", null],
"mne_icalabel": ["https://mne.tools/mne-icalabel/stable/", null],
"mne_lsl": ["https://mne.tools/mne-lsl/stable/", null],
"monkeytype": ["https://monkeytype.readthedocs.io/en/latest/", null],
"monkeytype": ["https://monkeytype.readthedocs.io/en/latest", null],
"mpmath": ["https://mpmath.org/doc/current/", null],
"myst-nb": ["https://myst-nb.readthedocs.io/en/v0.12.3/", null],
"myst-parser": ["https://myst-parser.readthedocs.io/en/v0.15.1/", null],
"myst-nb": ["https://myst-nb.readthedocs.io/en/v0.12.3", null],
"myst-parser": ["https://myst-parser.readthedocs.io/en/v0.15.1", null],
"napari_plugin_engine": [
"https://napari-plugin-engine.readthedocs.io/en/latest/",
"https://napari-plugin-engine.readthedocs.io/en/latest",
null
],
"nbconvert": ["https://nbconvert.readthedocs.io/en/latest/", null],
"nbformat": ["https://nbformat.readthedocs.io/en/latest/", null],
"nbgitpuller": ["https://nbgitpuller.readthedocs.io/en/latest/", null],
"nbconvert": ["https://nbconvert.readthedocs.io/en/latest", null],
"nbformat": ["https://nbformat.readthedocs.io/en/latest", null],
"nbgitpuller": ["https://nbgitpuller.readthedocs.io/en/latest", null],
"nbsphinx": ["https://nbsphinx.readthedocs.io/", null],
"ndsampler": ["https://ndsampler.readthedocs.io/en/latest/", null],
"ndsampler": ["https://ndsampler.readthedocs.io/en/latest", null],
"neps": ["https://numpy.org/neps/", null],
"networkx": ["https://networkx.org/documentation/stable/", null],
"nibabel": ["https://nipy.org/nibabel/", null],
"nilearn": ["https://nilearn.github.io/stable/", null],
"notebook": ["https://jupyter-notebook.readthedocs.io/en/stable/", null],
"notebook": ["https://jupyter-notebook.readthedocs.io/en/stable", null],
"nox": ["https://nox.thea.codes/en/latest/", null],
"numba": ["https://numba.readthedocs.io/en/latest/", null],
"numba": ["https://numba.readthedocs.io/en/latest", null],
"numpy": ["https://numpy.org/doc/stable/", null],
"numpy-tutorials": ["https://numpy.org/numpy-tutorials/", null],
"numpydoc": ["https://numpydoc.readthedocs.io/en/latest/", null],
"numpydoc": ["https://numpydoc.readthedocs.io/en/latest", null],
"nx-guides": ["https://networkx.org/nx-guides/", null],
"openstack": ["https://docs.openstack.org/glance/latest/", null],
"pandas": ["https://pandas.pydata.org/docs/", null],
"pandas-gbq": ["https://pandas-gbq.readthedocs.io/en/latest/", null],
"parso": ["https://parso.readthedocs.io/en/latest/", null],
"patsy": ["https://patsy.readthedocs.io/en/latest/", null],
"pillow": ["https://pillow.readthedocs.io/en/stable/", null],
"pandas-gbq": ["https://pandas-gbq.readthedocs.io/en/latest", null],
"parso": ["https://parso.readthedocs.io/en/latest", null],
"patsy": ["https://patsy.readthedocs.io/en/latest", null],
"pillow": ["https://pillow.readthedocs.io/en/stable", null],
"pip": ["https://pip.pypa.io/en/latest/", null],
"pipenv": ["https://pipenv.pypa.io/en/latest/", null],
"piwheels": ["https://piwheels.readthedocs.io/en/latest/", null],
"pluggy": ["https://pluggy.readthedocs.io/en/stable/", null],
"piwheels": ["https://piwheels.readthedocs.io/en/latest", null],
"pluggy": ["https://pluggy.readthedocs.io/en/stable", null],
"poliastro": ["https://docs.poliastro.space/en/stable/", null],
"prompt_toolkit": [
"https://python-prompt-toolkit.readthedocs.io/en/stable/",
"https://python-prompt-toolkit.readthedocs.io/en/stable",
null
],
"py": ["https://pylib.readthedocs.io/en/latest/", null],
"py": ["https://pylib.readthedocs.io/en/latest", null],
"pyarrow": ["https://arrow.apache.org/docs/", null],
"pybind11": ["https://pybind11.readthedocs.io/en/stable/", null],
"pyerfa": ["https://pyerfa.readthedocs.io/en/stable/", null],
"pybind11": ["https://pybind11.readthedocs.io/en/stable", null],
"pyerfa": ["https://pyerfa.readthedocs.io/en/stable", null],
"pygraphviz": ["https://pygraphviz.github.io/documentation/stable/", null],
"pymde": ["https://pymde.org/", null],
"pymongo": ["https://pymongo.readthedocs.io/en/stable/", null],
"pynsist": ["https://pynsist.readthedocs.io/en/latest/", null],
"pymongo": ["https://pymongo.readthedocs.io/en/stable", null],
"pynsist": ["https://pynsist.readthedocs.io/en/latest", null],
"pypa": ["https://www.pypa.io/en/latest/", null],
"pypug": ["https://packaging.python.org/en/latest/", null],
"pypy": ["https://doc.pypy.org/en/latest/", null],
"pyqtgraph": ["https://pyqtgraph.readthedocs.io/en/latest/", null],
"pyqtgraph": ["https://pyqtgraph.readthedocs.io/en/latest", null],
"pyro": ["https://docs.pyro.ai/en/stable/", null],
"pytest": ["https://pytest.org/en/stable/", null],
"python": ["https://docs.python.org/3/", null],
Expand All @@ -127,29 +127,29 @@
"pyvista": ["https://docs.pyvista.org/", null],
"qiskit": ["https://docs.quantum.ibm.com/api/qiskit/", null],
"qtconsole": ["https://jupyter.org/qtconsole/dev/", null],
"readthedocs": ["https://docs.readthedocs.io/en/stable/", null],
"readthedocs": ["https://docs.readthedocs.io/en/stable", null],
"requests": ["https://docs.python-requests.org/en/latest/", null],
"rpy2": ["https://rpy2.github.io/doc/latest/html/", null],
"rst-to-myst": ["https://rst-to-myst.readthedocs.io/en/stable/", null],
"rtd": ["https://docs.readthedocs.io/en/stable/", null],
"rtd-dev": ["https://dev.readthedocs.io/en/latest/", null],
"scanpy": ["https://scanpy.readthedocs.io/en/stable/", null],
"rst-to-myst": ["https://rst-to-myst.readthedocs.io/en/stable", null],
"rtd": ["https://docs.readthedocs.io/en/stable", null],
"rtd-dev": ["https://dev.readthedocs.io/en/latest", null],
"scanpy": ["https://scanpy.readthedocs.io/en/stable", null],
"scipy": ["https://docs.scipy.org/doc/scipy/", null],
"scipy-lecture-notes": ["https://scipy-lectures.org/", null],
"scriptconfig": ["https://scriptconfig.readthedocs.io/en/latest/", null],
"scriptconfig": ["https://scriptconfig.readthedocs.io/en/latest", null],
"seaborn": ["https://seaborn.pydata.org/", null],
"server": ["https://jupyter-server.readthedocs.io/en/stable/", null],
"server": ["https://jupyter-server.readthedocs.io/en/stable", null],
"setuptools": ["https://setuptools.pypa.io/en/stable/", null],
"six": ["https://six.readthedocs.io/", null],
"skimage": ["https://scikit-image.org/docs/stable/", null],
"sklearn": ["https://scikit-learn.org/stable/", null],
"sounddevice": ["https://python-sounddevice.readthedocs.io/", null],
"spack": ["https://spack.readthedocs.io/en/latest/", null],
"spack": ["https://spack.readthedocs.io/en/latest", null],
"sparse": ["https://sparse.pydata.org/en/latest/", null],
"sphinx": ["https://www.sphinx-doc.org/en/master/", null],
"sphinx-gallery": ["https://sphinx-gallery.github.io/stable/", null],
"sphinx_automodapi": [
"https://sphinx-automodapi.readthedocs.io/en/stable/",
"https://sphinx-automodapi.readthedocs.io/en/stable",
null
],
"sqlalchemy": ["https://docs.sqlalchemy.org/en/latest/", null],
Expand All @@ -159,15 +159,15 @@
"torch": ["https://pytorch.org/docs/main/", null],
"tornado": ["https://www.tornadoweb.org/en/stable/", null],
"tox": ["https://tox.wiki/en/stable/", null],
"traitlets": ["https://traitlets.readthedocs.io/en/latest/", null],
"twine": ["https://twine.readthedocs.io/en/stable/", null],
"typing": ["https://typing.readthedocs.io/en/latest/", null],
"ubelt": ["https://ubelt.readthedocs.io/en/latest/", null],
"traitlets": ["https://traitlets.readthedocs.io/en/latest", null],
"twine": ["https://twine.readthedocs.io/en/stable", null],
"typing": ["https://typing.readthedocs.io/en/latest", null],
"ubelt": ["https://ubelt.readthedocs.io/en/latest", null],
"urwid": ["https://urwid.org/", null],
"virtualenv": ["https://virtualenv.pypa.io/en/stable/", null],
"writethedocs": ["https://www.writethedocs.org/", null],
"xarray": ["https://docs.xarray.dev/en/stable/", null],
"xdoctest": ["https://xdoctest.readthedocs.io/en/latest/", null],
"xdoctest": ["https://xdoctest.readthedocs.io/en/latest", null],
"z2jh": ["https://z2jh.jupyter.org/en/latest/", null],
"zarr": ["https://zarr.readthedocs.io/en/latest/", null]
"zarr": ["https://zarr.readthedocs.io/en/latest", null]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ minversion = "7.0"
# -n auto:
# run @parametrize tests in parallel as some use requests.
# requires ptest x-dist
addopts = ["-n","auto", "--strict-config", "--strict-markers", "-ra",'--durations=10']
addopts = ["-n", "auto", "--strict-config", "--strict-markers", "-ra", "--durations=10"]
filterwarnings = ["error"]
log_cli_level = "INFO"
testpaths = ["tests"]
Expand Down
19 changes: 8 additions & 11 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
from intersphinx_registry import _get_all_mappings, get_intersphinx_mapping
from posixpath import join
import pytest
import requests

MAPPING = _get_all_mappings()
keys = set(MAPPING.keys())
keys = set(MAPPING)

TIMEOUT = 5 # sec

# click does return a 301 instead of a 30
CLICK_WRONG_301 = 301

@pytest.mark.parametrize("key", list(sorted(keys - {"jinja"})))

@pytest.mark.parametrize("key", sorted(keys - {"jinja"}))
def test_format(key: str):
assert isinstance(key, str)
url, obj = MAPPING[key]
assert url.startswith("https://"), url
assert url.endswith("/"), url
assert "readthedocs.org" not in url, "should be readthedocs.io not org"

if obj is None:
requests.head(url + "objects.inv", allow_redirects=True).raise_for_status()
requests.head(join(url, "objects.inv"), allow_redirects=True).raise_for_status()
else:
assert obj.startswith("https://"), obj
assert obj.endswith("/"), obj
assert "readthedocs.org" not in obj
assert obj.startswith(url)
res = requests.head(obj, allow_redirects=True, timeout=TIMEOUT)
Expand All @@ -35,22 +35,19 @@ def test_reach_objects_inv(key: str):
for v in MAPPING[key]:
if v is None:
continue
res = requests.head(v + "objects.inv", timeout=TIMEOUT)
res = requests.head(join(v, "objects.inv"), timeout=TIMEOUT)
res.raise_for_status()
assert res.status_code in (200, 302, CLICK_WRONG_301)



def test_bad():
with pytest.raises(ValueError, match="Some libraries in"):
get_intersphinx_mapping(packages={"-nonexistent-"})


@pytest.mark.parametrize('key', sorted(keys))
@pytest.mark.parametrize("key", sorted(keys))
def test_lower_case(key):
"""
We agreed that all keys in the mapping should be lower case
"""
assert key == key.lower(), 'expecting all keys to be lowercase'


assert key == key.lower(), "expecting all keys to be lowercase"

0 comments on commit 9430626

Please sign in to comment.