Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thebjorn committed Dec 8, 2023
1 parent b88c37a commit 75a7cb7
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 91 deletions.
53 changes: 33 additions & 20 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,42 @@ jobs:
LINTDIR: ./ghlint
steps:
# setup environment
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup directories
shell: bash
run: |
mkdir -p $PIP_CACHE_DIR
mkdir -p $LINTDIR
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- run: pip install flake8
- run: flake8 dkredis/** --max-line-length=199

docs:
name: CI:Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: setup directories
shell: bash
run: |
mkdir -p build
- run: pip install sphinx
- run: pip install -e .
- run: sphinx-build -W -b html docs build/sphinx/html
- run: sphinx-build -W -n -T -b man docs build/sphinx/man

- name: Upload docs as artifact
uses: actions/upload-artifact@v3
with:
name: Docs
path: build/sphinx/

ci-test:
name: CI:Test
runs-on: ${{ matrix.os }}
Expand All @@ -37,9 +60,9 @@ jobs:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11']

os: [ubuntu-latest]
# include:
# - python-version: '3.9'
# os: windows-latest
include:
- python-version: '3.11'
os: windows-latest
# - python-version: '3.9'
# os: macos-latest
# - python-version: '3.10.0-rc.2'
Expand All @@ -49,7 +72,7 @@ jobs:

steps:
# setup environment
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup global directories
shell: bash
run: mkdir -p $PIP_CACHE_DIR
Expand Down Expand Up @@ -77,38 +100,28 @@ jobs:
runs-on: ubuntu-latest
steps:
# setup environment
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup directories
shell: bash
run: mkdir -p $PIP_CACHE_DIR
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Cleanup
run: |
rm -rf dist
rm -rf build
- run: pip install -U wheel packaging twine
- run: pip install -r requirements.txt
- run: python setup.py sdist bdist_wheel
- run: pip install -U build twine
- run: python -m build

- name: Upload packages as artifact
uses: actions/upload-artifact@v3
with:
name: Packages
path: dist/

# - name: Build docs
# run: python setup.py build_sphinx

# - name: Upload docs as artifact
# uses: actions/upload-artifact@v2
# with:
# name: Docs
# path: build/sphinx/html/

- name: Deploy to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == env.HOME_REPO
shell: bash
Expand Down
23 changes: 12 additions & 11 deletions dkredis/rediscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ def _cache_unserialize(val):


class cache:
"""Usage::
"""Python value cache.
from dkredis.rediscache import cache
Usage::
try:
v = cache.get(key)
except cache.DoesNotExist:
v = mk_object_value(...)
cache.put(
key, v,
duration=secs) # or datetime.duration()
from dkredis.rediscache import cache
you can use a datetime value for the valid_until parameter,
or anything the timeperiod.when() function accepts.
try:
v = cache.get(key)
except cache.DoesNotExist:
v = mk_object_value(...)
cache.put(
key, v,
duration=secs) # or datetime.duration()
you can use a datetime value for the valid_until parameter,
or anything the timeperiod.when() function accepts.
"""

class DoesNotExist(Exception):
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {'Python': ('http://docs.python.org/', None)}
45 changes: 0 additions & 45 deletions docs/dkredis.rst

This file was deleted.

45 changes: 38 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,49 @@



Module contents
---------------

..
Contents:
.. toctree::
:maxdepth: 2
.. automodule:: dkredis
:members:
:undoc-members:
:show-inheritance:


API documentation
=================
Submodules
----------

dkredis.dkredis module
----------------------

.. include:: modules.rst
.. automodule:: dkredis.dkredis
:members:
:undoc-members:
:show-inheritance:

dkredis.dkredislocks module
---------------------------

.. automodule:: dkredis.dkredislocks
:members:
:undoc-members:
:show-inheritance:

dkredis.rediscache module
-------------------------

.. automodule:: dkredis.rediscache
:members:
:undoc-members:
:show-inheritance:

dkredis.utils module
--------------------

.. automodule:: dkredis.utils
:members:
:undoc-members:
:show-inheritance:



Expand Down
7 changes: 0 additions & 7 deletions docs/modules.rst

This file was deleted.

0 comments on commit 75a7cb7

Please sign in to comment.