Skip to content

Commit 47919db

Browse files
Documentation Maintenance (#52)
* split navigation into named parts * documented versioning and releases * adjusted some docstrings for consistency * expanded README blurb * added conda-forge badge
1 parent 6cdd381 commit 47919db

File tree

5 files changed

+103
-13
lines changed

5 files changed

+103
-13
lines changed

README.rst

+16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
:alt: Available on PyPI
1111
:target: https://pypi.python.org/pypi/asyncstdlib/
1212

13+
.. image:: https://anaconda.org/conda-forge/asyncstdlib/badges/version.svg
14+
:alt: Available on Conda-Forge
15+
:target: https://anaconda.org/conda-forge/asyncstdlib
16+
1317
.. image:: https://img.shields.io/github/license/maxfischer2781/asyncstdlib.svg
1418
:alt: License
1519
:target: https://github.com/maxfischer2781/asyncstdlib/blob/master/LICENSE
@@ -24,3 +28,15 @@ and context managers.
2428
It is fully agnostic to ``async`` event loops and seamlessly works with
2529
``asyncio``, third-party libraries such as ``trio``, as well as
2630
any custom ``async`` event loop.
31+
32+
* Full set of ``async`` versions of advantageous standard library helpers,
33+
such as ``zip``, ``map``, ``enumerate``, ``functools.reduce``,
34+
``itertools.tee``, ``itertools.groupby`` and many others.
35+
* Safe handling of ``async`` iterators to ensure prompt cleanup, as well as
36+
various helpers to simplify safely using custom ``async`` iterators.
37+
* Small but powerful toolset to seamlessly integrate existing sync code
38+
into ``async`` programs and libraries.
39+
40+
Check out the `documentation`_ to get started or take a look around.
41+
42+
.. _documentation: http://asyncstdlib.readthedocs.io/

asyncstdlib/asynctools.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,18 @@ async def await_each(awaitables: Iterable[Awaitable[T]]) -> AsyncIterable[T]:
209209
210210
import asyncstdlib as a
211211
212-
async def check1() -> bool:
213-
...
212+
async def check1() -> bool:
213+
...
214214
215215
async def check2() -> bool:
216-
...
216+
...
217217
218218
async def check3() -> bool:
219-
...
219+
...
220220
221-
okay = await a.all(
222-
a.await_each(
223-
[check1(), check2(), check3()]))
221+
okay = await a.all(
222+
a.await_each([check1(), check2(), check3()])
223+
)
224224
"""
225225
for awaitable in awaitables:
226226
yield await awaitable
@@ -329,12 +329,13 @@ async def compute_something_else() -> float:
329329

330330

331331
def sync(function: Callable[..., T]) -> Callable[..., Awaitable[T]]:
332-
"""
333-
Wraps any Callable, which allows to use it as Awaitable object
334-
335-
:param function: can be any Callable
332+
r"""
333+
Wraps a callable to ensure its result can be ``await``\ ed
336334
337-
:raise TypeError: if function argument is not Callable
335+
Useful to write :term:`async neutral` functions by wrapping callable arguments,
336+
or to use synchronous functions where asynchronous ones are expected.
337+
Wrapping a regular function defined using ``def`` or ``lambda`` makes it
338+
behave roughly as if it were defined using ``async def`` instead.
338339
339340
Example:
340341

docs/index.rst

+12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The missing ``async`` toolbox
1515
:alt: Available on PyPI
1616
:target: https://pypi.python.org/pypi/asyncstdlib/
1717

18+
.. image:: https://anaconda.org/conda-forge/asyncstdlib/badges/version.svg
19+
:alt: Available on Conda-Forge
20+
:target: https://anaconda.org/conda-forge/asyncstdlib
21+
1822
.. image:: https://img.shields.io/github/license/maxfischer2781/asyncstdlib.svg
1923
:alt: License
2024
:target: https://github.com/maxfischer2781/asyncstdlib/blob/master/LICENSE
@@ -28,6 +32,7 @@ The missing ``async`` toolbox
2832

2933
.. toctree::
3034
:maxdepth: 1
35+
:caption: The Async Toolbox
3136
:hidden:
3237

3338
source/api/builtins
@@ -36,7 +41,14 @@ The missing ``async`` toolbox
3641
source/api/itertools
3742
source/api/asynctools
3843
source/glossary
44+
45+
.. toctree::
46+
:maxdepth: 1
47+
:caption: Development & Maintenance
48+
:hidden:
49+
3950
source/contributing
51+
source/publishing
4052

4153
The ``asyncstdlib`` library re-implements functions and classes of the Python
4254
standard library to make them compatible with ``async`` callables, iterables

docs/source/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=======================
2-
Contributing Guidelines
2+
Contribution Guidelines
33
=======================
44

55
Contributions in code to the ``asyncstdlib`` library are highly welcome!

docs/source/publishing.rst

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
=====================
2+
Versions and Releases
3+
=====================
4+
5+
The ``asyncstdlib`` versioning closely follows
6+
versioning of the Python standard library.
7+
New versions are published via `PyPI`_ and `Conda-Forge`_
8+
for installation via ``pip`` and ``conda``.
9+
10+
Versioning and feature coverage
11+
===============================
12+
13+
The ``asyncstdlib`` mimics the versioning of the Python standard library:
14+
15+
* *Major and Minor version* indicate which Python feature set is supported, and
16+
* *Patch version* indicates the iteration of this feature set.
17+
18+
For example, ``asyncstdlib`` version 3.9.2 provides the feature set of Python 3.9,
19+
such as :py:func:`~asyncstdlib.functools.cache` added in 3.9
20+
and :py:func:`~asyncstdlib.functools.cached_property` added previously.
21+
22+
The ``asyncstdlib.asynctools`` feature set does not follow a strict version model.
23+
New features may be added at minor or patch releases.
24+
25+
Release workflow
26+
================
27+
28+
.. note::
29+
30+
This section is only relevant for maintainers of ``asyncstdlib``.
31+
32+
Releases are performed manually but should happen at least when
33+
an important fix or major feature is added.
34+
Most releases will bump the *patch* version number;
35+
only bump the *minor* or *major* version number to match a new Python release.
36+
37+
1. Review all changes added by the new releases:
38+
* Naming of functions/classes/parameters
39+
* Docs are up to date and consistent
40+
* Unittests cover all obvious cases
41+
42+
2. Bump the version number:
43+
* Adjust and commit ``asyncstdlib.__init__.__version__``
44+
* Create a git tag such as ``git tag -a "v3.9.2" -m "description"``
45+
* Push the commit and tags to github
46+
47+
3. Publish to PyPI
48+
* **You need maintainer access** on the `PyPI asyncstdlib project`_
49+
* Check out the tagged version commit
50+
* Run ``flit publish``
51+
52+
4. Publish to Conda-Forge
53+
* Create *a fork* of the `Conda-Forge asyncstdlib recipe`_
54+
* In `./recipe/meta.yaml` adjust the ``version`` and ``sha256`` as the `PyPI release`_
55+
* Create a Pull Request based on the fork
56+
57+
.. _PyPI: https://pypi.org
58+
.. _Conda-Forge: https://conda-forge.org
59+
.. _`PyPI asyncstdlib project`: https://pypi.org/project/asyncstdlib/
60+
.. _`Conda-Forge asyncstdlib recipe`: https://github.com/conda-forge/asyncstdlib-feedstock
61+
.. _`PyPI release`: https://pypi.org/project/asyncstdlib/#files

0 commit comments

Comments
 (0)