diff options
-rw-r--r-- | .github/workflows/ci.yml | 4 | ||||
-rw-r--r-- | docs-requirements.txt | 3 | ||||
-rw-r--r-- | docs/changelog.rst | 1 | ||||
-rw-r--r-- | docs/conf.py | 8 | ||||
-rw-r--r-- | docs/getting_started.rst | 20 | ||||
-rw-r--r-- | docs/index.rst | 3 | ||||
-rw-r--r-- | lint-requirements.txt | 6 | ||||
-rw-r--r-- | mypy-requirements.txt | 2 |
8 files changed, 27 insertions, 20 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 330d2db..08c3fa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,10 @@ jobs: if: matrix.python-version == '3.10' run: | tox -e lint,mypy + - name: Docs + if: matrix.python-version == '3.10' + run: | + tox -e docs - name: Disable IPv6 localhost run: | sudo sed -i '/::1/d' /etc/hosts diff --git a/docs-requirements.txt b/docs-requirements.txt index 7989985..85f852f 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,4 +1,5 @@ -sphinx==5.0.0 +sphinx==5.1.1 sphinx_rtd_theme==1.0.0 sphinxcontrib-apidoc==0.3.0 sphinxcontrib-napoleon==0.7 +pytest diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 0000000..91bdab9 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1 @@ +.. include:: ../ChangeLog.rst diff --git a/docs/conf.py b/docs/conf.py index b781a5a..c78990a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ import os import sys import subprocess -sys.path.insert(0, os.path.abspath(".")) +sys.path.insert(0, os.path.abspath("..")) # -- General configuration ------------------------------------------------ @@ -65,9 +65,9 @@ author = "Charles Gordon, Jon Parise, Joe Gordon" # built documents. # # The short X.Y version. -version = "3.2" +version = "3.5" # The full version, including alpha/beta/rc tags. -release = "3.2.0" +release = "3.5.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -358,5 +358,5 @@ intersphinx_mapping = {"https://docs.python.org/": None} # Automate building apidoc when building with readthedocs apidoc_module_dir = os.path.join("..", "pymemcache") apidoc_output_dir = "apidoc" +apidoc_excluded_paths = ["test", "setup.py"] apidoc_separate_modules = True -apidoc_extra_args = ["--force"] diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 0107af7..c2f7bce 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -90,7 +90,7 @@ follows: 1. A :class:`pymemcache.client.hash.HashClient` is created with 3 nodes, ``node1``, ``node2`` and ``node3``. -2. A number of values is set in the client using ``set`` and ``set_many``. +2. A number of values are set in the client using ``set`` and ``set_many``. Example: - ``key1`` -> ``node2`` @@ -99,7 +99,7 @@ follows: - ``key4`` -> ``node1`` - ``key5`` -> ``node2`` -3. Subsequent ``get``s will hash to the correct server and requests are routed +3. Subsequent ``get`` calls will hash to the correct server and requests are routed accordingly. 4. ``node3`` goes down. 5. The hashclient tries to ``get("key2")`` but detects the node as down. This @@ -120,13 +120,13 @@ follows: Using the built-in retrying mechanism ------------------------------------- -The library comes with retry mechanisms that can be used to wrap all kind of -pymemcache clients. The wrapper allow you to define the exceptions that you want +The library comes with retry mechanisms that can be used to wrap all kinds of +pymemcache clients. The wrapper allows you to define the exceptions that you want to handle with retries, which exceptions to exclude, how many attempts to make and how long to wait between attempts. The ``RetryingClient`` wraps around any of the other included clients and will -have the same methods. For this example we're just using the base ``Client``. +have the same methods. For this example, we're just using the base ``Client``. .. code-block:: python @@ -250,10 +250,10 @@ For testing purpose pymemcache can be used in an interactive mode by using the python interpreter or again ipython and tools like tox. One main advantage of using `tox` to interact with `pymemcache` is that it -comes with it's own virtual environments. It will automatically install +comes with its own virtual environments. It will automatically install pymemcache and fetch all the needed requirements at run. See the example below: -.. code-block:: shell +.. code-block:: $ podman run --publish 11211:11211 -it --rm --name memcached memcached $ tox -e venv -- python @@ -274,8 +274,8 @@ pymemcache and fetch all the needed requirements at run. See the example below: You can instantiate all the classes and clients offered by pymemcache. Your client will remain open until you decide to close it or until you decide -to quit your interpreter. It can allow you to see what's happen if your server -is abruptly closed. Below is an by example. +to quit your interpreter. It can allow you to see what happens if your server +is abruptly closed. Below is an example. Starting your server: @@ -299,7 +299,7 @@ Restarting the server: $ podman restart memcached -The previous client is still opened, now try to retrieve some keys: +The previous client is still open, now try to retrieve some keys: .. code-block:: shell diff --git a/docs/index.rst b/docs/index.rst index 9d3b828..9bb44dc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,10 +9,11 @@ Welcome to pymemcache's documentation! Contents: .. toctree:: - :maxdepth: 2 + :maxdepth: 1 Getting Started </getting_started> Source Code </apidoc/modules> + ChangeLog </changelog> diff --git a/lint-requirements.txt b/lint-requirements.txt index 1059621..fd97c68 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,4 +1,4 @@ -black==22.6.0 +black==22.8.0 docutils==0.19 -flake8==4.0.1 -pygments==2.12.0 +flake8==5.0.2 +pygments==2.13.0 diff --git a/mypy-requirements.txt b/mypy-requirements.txt index 0e5730d..6107e5a 100644 --- a/mypy-requirements.txt +++ b/mypy-requirements.txt @@ -1,2 +1,2 @@ -r test-requirements.txt -mypy==0.961 +mypy==0.971 |