Skip to content

Commit 93c6450

Browse files
authored
Merge pull request #23 from Terseus/docs
Add generated doc
2 parents f97334c + 16f6f22 commit 93c6450

File tree

11 files changed

+166
-9
lines changed

11 files changed

+166
-9
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Validations
22

33
on:
44
push:
@@ -9,8 +9,7 @@ on:
99
- "*"
1010

1111
jobs:
12-
build:
13-
12+
tests:
1413
runs-on: ubuntu-latest
1514
strategy:
1615
fail-fast: false
@@ -28,7 +27,7 @@ jobs:
2827
- name: Install dependencies
2928
run: |
3029
python -m pip install --upgrade pip
31-
python -m pip install build tox tox-gh-actions twine
30+
python -m pip install tox tox-gh-actions
3231
3332
- name: Test with tox
3433
run: tox
@@ -38,7 +37,46 @@ jobs:
3837
with:
3938
token: ${{ secrets.CODECOV_TOKEN }}
4039

41-
- name: Build wheel
40+
build_package:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: '3.11'
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
python -m pip install build twine
57+
58+
- name: Build wheel and sdist
4259
run: |
43-
python -m build --wheel --sdist
44-
twine check dist/*
60+
python -m build --sdist --wheel --outdir dist/
61+
62+
- name: Check packages
63+
run: twine check dist/*
64+
65+
docs:
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- uses: actions/checkout@v3
70+
71+
- name: Set up Python
72+
uses: actions/setup-python@v4
73+
with:
74+
python-version: '3.11'
75+
76+
- name: Install dependencies
77+
run: |
78+
python -m pip install --upgrade pip
79+
python -m pip install tox tox-gh-actions
80+
81+
- name: Build doc
82+
run: tox -e docs

.github/workflows/upload-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to https://test.pypi.org/
1+
name: Publish package
22

33
on:
44
push:

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3"
11+
12+
sphinx:
13+
builder: dirhtml
14+
configuration: docs/conf.py
15+
16+
python:
17+
install:
18+
- requirements: requirements-doc.txt

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3131
- Change `README.rst` to `README.md`.
3232
- Replace `setup.py` with `pyproject.toml`.
3333
- Renamed `chunks.py` to `raw_io_chunk.py`.
34+
- Changed Sphinx doc to use Markdown with the [Myst parser](https://myst-parser.readthedocs.io/en/latest/).
3435

3536
### Fixed
3637

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ with open("test_file", "rb") as file_handle:
3434

3535
Amazing, right?
3636

37+
## Why?
38+
39+
While writing a parser I found this class to be somewhat useful, around 7 years ago.
40+
41+
While today I don't really see it today, I decided to clean it up and released it in case it's useful for someone.
42+
3743
## Install
3844

3945
Use `pip`:
@@ -44,7 +50,7 @@ $ pip install io-chunks
4450

4551
## Documentation
4652

47-
Use the source, Luke!
53+
You can read it at [readthedocs](https://python-io-chunks.readthedocs.io/en/latest/).
4854

4955
## Run the tests
5056

docs/_static/.gitkeep

Whitespace-only changes.

docs/conf.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
import sys
8+
9+
sys.path.insert(0, os.path.abspath(".."))
10+
11+
# -- Project information -----------------------------------------------------
12+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
13+
14+
project = "io-chunks"
15+
copyright = "2022, David Caro Martínez <terseus@fastmail.com>"
16+
author = "David Caro Martínez <terseus@fastmail.com>"
17+
18+
# -- General configuration ---------------------------------------------------
19+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
20+
21+
extensions = [
22+
"myst_parser",
23+
"sphinx.ext.autodoc",
24+
]
25+
source_suffix = [".md"]
26+
templates_path = ["_templates"]
27+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
28+
29+
30+
# -- Options for HTML output -------------------------------------------------
31+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
32+
33+
html_theme = "sphinx_rtd_theme"
34+
html_static_path = ["_static"]

docs/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% io-chunks documentation master file, created by
2+
% sphinx-quickstart on Sat Nov 12 10:42:33 2022.
3+
% You can adapt this file completely to your liking, but it should at least
4+
% contain the root `toctree` directive.
5+
6+
```{include} ../README.md
7+
```
8+
9+
# API
10+
11+
```{eval-rst}
12+
.. automodule:: io_chunks
13+
:members:
14+
:special-members: __init__
15+
:inherited-members:
16+
```

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

requirements-doc.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
myst-parser
3+
sphinx-rtd-theme

0 commit comments

Comments
 (0)