Skip to content

Commit 68d8538

Browse files
Documentation and fixes (#3)
Add library documentation and make some fixes
2 parents c349e44 + 0374993 commit 68d8538

31 files changed

Lines changed: 1734 additions & 63 deletions

Taskfile.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tasks:
3434
desc: Lint Python code
3535
cmds:
3636
- uv run mypy src
37-
- uv run pylint src
37+
- uv run pylint src tests
3838

3939
build:
4040
desc: Build Python package
@@ -75,6 +75,7 @@ tasks:
7575
prompt: Bump Python package version from {{.CURRENT}} to {{.NEXT}}?
7676
cmds:
7777
- uv version --bump minor
78+
- uv sync
7879
- git add pyproject.toml uv.lock
7980
- git commit -m "bump version"
8081

@@ -101,3 +102,8 @@ tasks:
101102
desc: Run Redis Service
102103
cmds:
103104
- docker run --rm -p 127.0.0.1:6379:6379 docker.io/redis:8
105+
106+
rq-info:
107+
desc: Show RQ information
108+
cmds:
109+
- uv run rq info --interval 5

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
templates_path = ["_templates"]
2323
exclude_patterns = []
24-
24+
add_module_names = True
2525

2626
# -- Options for HTML output -------------------------------------------------
2727
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

docs/source/getting-started.rst

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Getting Started with Tasktronaut
2+
=================================
3+
4+
Welcome to Tasktronaut!
5+
6+
This guide will help you install the library, set up your first process, and run it successfully.
7+
8+
Installation
9+
------------
10+
11+
Prerequisites
12+
~~~~~~~~~~~~~
13+
14+
Tasktronaut requires:
15+
16+
- Python 3.7 or higher
17+
- pip (Python package manager)
18+
19+
Installing from PyPI
20+
~~~~~~~~~~~~~~~~~~~~
21+
22+
The easiest way to install Tasktronaut is using pip:
23+
24+
.. code-block:: bash
25+
26+
pip install tasktronaut[rq]
27+
28+
For a specific version:
29+
30+
.. code-block:: bash
31+
32+
pip install tasktronaut[rq]==0.3.0
33+
34+
Installing with Optional Dependencies
35+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
37+
Tasktronaut may offer optional extras for extended functionality. Install them as follows:
38+
39+
.. code-block:: bash
40+
41+
pip install tasktronaut[dev]
42+
pip install tasktronaut[docs]
43+
44+
Installing from Source
45+
~~~~~~~~~~~~~~~~~~~~~~
46+
47+
To install the development version from the repository:
48+
49+
.. code-block:: bash
50+
51+
git clone https://github.com/virtualstaticvoid/tasktronaut.git
52+
cd tasktronaut
53+
uv sync
54+
55+
Verifying Your Installation
56+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+
Verify the installation was successful by importing Tasktronaut in a Python shell:
59+
60+
.. code-block:: python
61+
62+
>>> import tasktronaut
63+
>>> print(tasktronaut.__version__)
64+
x.x.x
65+
66+
If you see the version number without errors, you're ready to go!
67+
68+
69+
Your First Process
70+
------------------
71+
72+
Creating a Simple Process
73+
~~~~~~~~~~~~~~~~~~~~~~~~~~
74+
75+
Let's create a basic process with three sequential tasks. Create a file called ``my_first_process.py``:
76+
77+
.. code-block:: python
78+
79+
from tasktronaut import ProcessDefinition, Builder
80+
81+
class GreetingProcess(ProcessDefinition):
82+
"""A simple process that greets the user."""
83+
84+
def define_process(self, builder: Builder):
85+
builder.task(self.say_hello)
86+
builder.task(self.say_name)
87+
builder.task(self.say_goodbye)
88+
89+
def say_hello(self):
90+
print("Hello!")
91+
92+
def say_name(self, name: str = "World", **kwargs):
93+
print(f"Nice to meet you, {name}.")
94+
95+
def say_goodbye(self):
96+
print("Goodbye!")

docs/source/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
``tasktronaut`` Documentation
77
=============================
88

9+
Welcome to Tasktronaut!
10+
911
.. toctree::
1012
:maxdepth: 1
1113
:caption: Contents:
1214

13-
user_guide
15+
getting-started
16+
user-guide
1417
advanced
1518
api/modules
1619

0 commit comments

Comments
 (0)