-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20449ba
commit ca49deb
Showing
11 changed files
with
304 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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,4 +1,7 @@ | ||
[flake8] | ||
ignore = | ||
; Parameter type mismatch | ||
DAR103 | ||
select = DAR | ||
docstring_style=google | ||
max-line-length = 88 | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: readthedocs/actions | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
documentation-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: readthedocs/actions/preview@v1 | ||
with: | ||
project-slug: "pep610" |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
jobs: | ||
post_checkout: | ||
- git fetch --unshallow || true | ||
|
||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
fail_on_warning: true | ||
|
||
formats: | ||
- epub | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
"""Sphinx configuration.""" | ||
|
||
from __future__ import annotations | ||
|
||
import pep610 | ||
|
||
# Add any Sphinx extension module names here, as strings. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.extlinks", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.napoleon", | ||
"myst_parser", | ||
"sphinx_design", | ||
] | ||
|
||
# General information about the project. | ||
project = "pep610" | ||
author = "Edgar Ramírez-Mondragón" | ||
version = pep610.__version__ | ||
release = pep610.__version__ | ||
project_copyright = f"2023, {author}" | ||
|
||
# -- Options for HTML output -------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
|
||
html_theme = "furo" | ||
html_title = "PEP 610 - Direct URL Parser and Builder for Python" | ||
html_theme_options = { | ||
"navigation_with_keys": True, | ||
"source_repository": "https://github.com/edgarrmondragon/citric/", | ||
"source_branch": "main", | ||
"source_directory": "docs/", | ||
} | ||
|
||
# -- Options for autodoc ---------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration | ||
|
||
autodoc_member_order = "bysource" | ||
autodoc_preserve_defaults = True | ||
|
||
# Automatically extract typehints when specified and place them in | ||
# descriptions of the relevant function/method. | ||
autodoc_typehints = "description" | ||
|
||
# Only document types for parameters or return values that are already documented by the | ||
# docstring. | ||
autodoc_typehints_description_target = "documented" | ||
|
||
# -- Options for extlinks ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html | ||
|
||
extlinks_detect_hardcoded_links = True | ||
extlinks = { | ||
"spec": ( | ||
"https://packaging.python.org/en/latest/specifications/direct-url-data-structure/#%s-urls", | ||
"specification for %s URLs", | ||
), | ||
} | ||
|
||
# -- Options for intersphinx ---------------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration | ||
intersphinx_mapping = { | ||
"metadata": ("https://importlib-metadata.readthedocs.io/en/latest", None), | ||
"python": ("https://docs.python.org/3/", None), | ||
} | ||
|
||
# -- Options for Myst Parser ------------------------------------------------------- | ||
# https://myst-parser.readthedocs.io/en/latest/configuration.html | ||
myst_enable_extensions = ["colon_fence"] |
This file contains 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# PEP 610 Parser and Builder | ||
|
||
*A parser and builder for [PEP 610 direct URL metadata](https://packaging.python.org/en/latest/specifications/direct-url-data-structure).* | ||
|
||
Release **v{sub-ref}`version`**. | ||
|
||
::::{tab-set} | ||
|
||
:::{tab-item} Python 3.10+ | ||
|
||
```python | ||
from importlib import metadata | ||
|
||
import pep610 | ||
|
||
dist = metadata.distribution("pep610") | ||
data = pep610.read_from_distribution(dist) | ||
|
||
match data: | ||
case pep610.DirData(url, pep610.DirInfo(editable=True)): | ||
print("Editable install") | ||
case _: | ||
print("Not editable install") | ||
``` | ||
|
||
::: | ||
|
||
:::{tab-item} Python 3.9+ | ||
```python | ||
from importlib import metadata | ||
|
||
import pep610 | ||
|
||
dist = metadata.distribution("pep610") | ||
data = pep610.read_from_distribution(dist) | ||
|
||
if isinstance(data, pep610.DirData) and data.dir_info.is_editable(): | ||
print("Editable install") | ||
else: | ||
print("Not editable install") | ||
``` | ||
::: | ||
:::: | ||
|
||
## Supported formats | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.ArchiveData | ||
:members: | ||
``` | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.DirData | ||
:members: | ||
``` | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.VCSData | ||
:members: | ||
``` | ||
|
||
## Other classes | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.ArchiveInfo | ||
:members: | ||
``` | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.DirInfo | ||
:members: | ||
``` | ||
|
||
```{eval-rst} | ||
.. autoclass:: pep610.VCSInfo | ||
:members: | ||
``` | ||
|
||
## Functions | ||
|
||
```{eval-rst} | ||
.. autofunction:: pep610.read_from_distribution | ||
``` |
This file contains 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
Oops, something went wrong.