Skip to content

Commit cdf08a9

Browse files
committed
Added action to build docs, cleaned up docstrings.
1 parent 54a307f commit cdf08a9

File tree

8 files changed

+52
-27
lines changed

8 files changed

+52
-27
lines changed

.github/workflows/build-docs.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Build docs
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python 3.9
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.9
23+
cache: 'pip'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install flake8 pytest tox
29+
30+
- name: Build docs
31+
run: |
32+
tox -e docs
33+
touch ./docs/_build/html/.nojekyll
34+
35+
- name: GH Pages Deployment
36+
uses: JamesIves/github-pages-deploy-action@v4
37+
with:
38+
branch: gh-pages # The branch the action should deploy to.
39+
folder: ./docs/_build/html
40+
clean: true # Automatically remove deleted files from the deploy branch

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
## Version 0.1 (development)
3+
## Version 0.1.0
44

5-
- Feature A added
6-
- FIX: nasty bug #1729 fixed
7-
- add your changes here!
5+
- New release of this package.

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"sphinx.ext.ifconfig",
7373
"sphinx.ext.mathjax",
7474
"sphinx.ext.napoleon",
75+
"sphinx_autodoc_typehints",
7576
]
7677

7778
# Add any paths that contain templates here, relative to this directory.
@@ -171,7 +172,7 @@
171172

172173
# The theme to use for HTML and HTML Help pages. See the documentation for
173174
# a list of builtin themes.
174-
html_theme = "alabaster"
175+
html_theme = "furo"
175176

176177
# Theme options are theme-specific and customize the look and feel of a theme
177178
# further. For a list of options available for each theme, see the
@@ -301,4 +302,4 @@
301302
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
302303
}
303304

304-
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
305+
print(f"loading configurations for {project} {version} ...", file=sys.stderr)

docs/index.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
# SewerRat
22

3-
Add a short description here!
4-
5-
6-
## Note
7-
8-
> This is the main page of your project's [Sphinx] documentation. It is
9-
> formatted in [Markdown]. Add additional pages by creating md-files in
10-
> `docs` or rst-files (formatted in [reStructuredText]) and adding links to
11-
> them in the `Contents` section below.
12-
>
13-
> Please check [Sphinx] and [MyST] for more information
14-
> about how to document your project and how to configure your preferences.
15-
3+
Python client for the [SewerRat](https://github.com/ArtifactDB/SewerRat) API.
164

175
## Contents
186

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
# sphinx_rtd_theme
55
myst-parser[linkify]
66
sphinx>=3.2.1
7+
furo
8+
sphinx-autodoc-typehints

src/sewerrat/deregister.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def deregister(path: str, url: str, wait: float = 1):
2121
wait:
2222
Number of seconds to wait for a file write to synchronise before
2323
requesting verification.
24-
25-
Returns:
26-
On success, the directory is deregistered and nothing is returned.
2724
"""
2825
path = os.path.abspath(path)
2926
res = requests.post(url + "/deregister/start", json = { "path": path }, allow_redirects=True)

src/sewerrat/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def query(url, text: Optional[str] = None, user: Optional[str] = None, path: Optional[str] = None, after: Optional[int] = None, before: Optional[int] = None, number: int = 100) -> List[Dict]:
88
"""
99
Query the metadata in the SewerRat backend based on free text, the owner,
10-
creation time, etc.
10+
creation time, etc. This function does not require filesystem access.
1111
1212
Args:
1313
url:

src/sewerrat/register.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ def register(path: str, names: List[str], url: str, wait: int = 1):
1111
"""
1212
Register a directory into the SewerRat search index. It is assumed that
1313
that the directory is world-readable and that the caller has write access.
14+
If a metadata file cannot be indexed (e.g., due to incorrect formatting,
15+
insufficient permissions), a warning will be printed but the function will
16+
not throw an error.
1417
1518
Args:
1619
path:
@@ -26,10 +29,6 @@ def register(path: str, names: List[str], url: str, wait: int = 1):
2629
wait:
2730
Number of seconds to wait for a file write to synchronise before
2831
requesting verification.
29-
30-
Returns:
31-
On success, the directory is registered and nothing is returned.
32-
A warning is raised if a metadata file cannot be indexed.
3332
"""
3433
if len(names) == 0:
3534
raise ValueError("expected at least one entry in 'names'")

0 commit comments

Comments
 (0)