Skip to content

Commit 87ba2b3

Browse files
authored
Documentation update (#34)
* Update documentation for workflows * Update django documentation * Update documentation * Run formatters * Fix doc coverage * Fix tests * Formatters * Some workflow documentation * Workflow documentation * Almost whole documentation * Almost whole documentation * Some usage documentation * Small development guide * Update readme * Fix readme
1 parent 22c247c commit 87ba2b3

34 files changed

+921
-158
lines changed

README.md

Lines changed: 5 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,8 @@
1-
from sio3pack.graph import GraphOperation
2-
31
# SIO3Pack
42

5-
## Prerequisites
6-
```
7-
- Python 3.9 or higher
8-
- pip
9-
- Linux or macOS operating system
10-
- Django 4.2.x (for Django support)
11-
```
12-
13-
## Instalation
14-
```
15-
pip install sio3pack
16-
```
17-
## Example usage (in python)
18-
19-
### In OIOIOI
20-
21-
```python
22-
# Package unpacking
23-
import sio3pack, sio3workers
24-
from django.conf import settings
25-
26-
package = sio3pack.from_file(path_to_package, django_settings=settings)
27-
graph_op: GraphOperation = package.get_unpack_operation()
28-
results = sioworkers.run(graph_op)
29-
graph_op.return_results(results)
30-
package.save_to_db(problem_id=1)
31-
```
32-
33-
### Locally (for example `sinol-make`)
34-
35-
```python
36-
import sio3pack, sio3workers.local
37-
38-
package = sio3pack.from_file(path_to_package)
39-
graph_op: GraphOperation = package.get_unpack_operation()
40-
results = sio3workers.local.run(graph_op)
41-
graph_op.return_results(results)
42-
```
43-
44-
---
45-
46-
## Development
47-
48-
### Test without django support
49-
50-
Install the package in editable mode and make sure that `django` and
51-
`pytest-django` are not installed.
52-
53-
```bash
54-
pip install -e ".[tests]"
55-
pip uninstall django pytest-django
56-
```
57-
58-
Then follow the instructions in
59-
[General testing information](#general-testing-information).
60-
61-
62-
### Test with django support
63-
64-
Install the package in editable mode along with Django dependencies:
65-
66-
```bash
67-
pip install -e ".[django,tests,django_tests]"
68-
```
69-
70-
Then follow the instructions in
71-
[General testing information](#general-testing-information).
72-
73-
74-
### General testing information
75-
76-
Run the tests with `pytest` in the root directory of
77-
the repository.
78-
79-
```bash
80-
pytest -v
81-
```
82-
83-
To run tests in parallel, use the following command.
84-
85-
```bash
86-
pytest -v -n auto
87-
```
88-
89-
To run coverage tests, use the following command.
90-
91-
```bash
92-
pytest -v --cov=sio3pack --cov-report=html
93-
```
3+
SIO3Pack is a Python package designed to facilitate the creation and manipulation
4+
of packages supported by the SIO2 system. It provides a set of classes and functions
5+
to handle various operations related to package interaction, including workflow
6+
management and creation.
947

95-
The coverage report will be generated in the file `htmlcov/index.html`.
8+
Full documentation is available at [SIO3Pack Documentation](https://sio2project.github.io/SIO3Pack/).

docs/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

99
import sio3pack
10+
import django
11+
import sys
12+
import os
13+
14+
15+
sys.path.append(os.path.abspath('../tests/test_django'))
16+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_django.settings')
17+
django.setup()
18+
1019

1120
project = 'SIO3Pack'
1221
copyright = '2025, Tomasz Kwiatkowski, Mateusz Masiarz, Jakub Rożek, Stanisław Struzik'
@@ -21,6 +30,7 @@
2130
'sphinx.ext.autodoc', # Also required by AutoAPI.
2231
'sphinx.ext.viewcode',
2332
'sphinx.ext.intersphinx',
33+
'sphinx.ext.coverage',
2434
]
2535

2636
templates_path = ['_templates']
@@ -38,6 +48,7 @@
3848
autoapi_include = [
3949
"sio3pack.django.common.handler.DjangoHandler",
4050
"sio3pack.django.sinolpack.handler.SinolpackDjangoHandler",
51+
"sio3pack.files.remote_file.RemoteFile",
4152
]
4253
autodoc_typehints = 'description'
4354

docs/development.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Development
2+
===========
3+
4+
This section is intended for developers who want to contribute to the project or understand its inner workings.
5+
It provides guidelines on how to set up the development environment, run tests, and contribute code.
6+
7+
Setting Up the Development Environment
8+
--------------------------------------
9+
10+
If you want to develop or run tests without Django support, you can use the following command:
11+
12+
.. code-block:: bash
13+
14+
pip install -e .[tests]
15+
pip uninstall django pytest-django
16+
17+
This will install the package in editable mode, without Django support. Uninstall Django and pytest-django to make sure
18+
that the tests run without Django support.
19+
20+
If you want to run tests with Django support, you can use the following command:
21+
22+
.. code-block:: bash
23+
24+
pip install -e .[django,tests,django_tests]
25+
26+
This will install the package in editable mode with Django support, along with the necessary testing dependencies.
27+
28+
Running Tests
29+
-------------
30+
31+
To run the tests, you can use the following command:
32+
33+
.. code-block:: bash
34+
35+
pytest -v
36+
37+
The tests can also be run in parallel using the `pytest-xdist` plugin. To do this, you can use the following command:
38+
39+
.. code-block:: bash
40+
41+
pytest -v -n auto
42+
43+
You can also run coverage reports to see how much of the code is covered by tests. To do this, you can use the following
44+
command:
45+
46+
.. code-block:: bash
47+
48+
pytest --cov=src --cov-report=html --cov-report=html
49+
50+
The coverage report will be generated in the `htmlcov` directory, and you can open the `index.html` file in your web browser
51+
to view the report.
52+
53+
Contributing Code
54+
-----------------
55+
56+
If you want to contribute code to the project, please follow these guidelines:
57+
1. Fork the repository and create a new branch for your feature or bug fix.
58+
2. Write tests for your code and make sure they pass.
59+
3. Make sure your code follows the project's coding style and conventions.
60+
4. Submit a pull request with a clear description of your changes and why they are needed.
61+
5. Be open to feedback and willing to make changes based on code reviews.
62+
6. Ensure that your code is well-documented, including docstrings for functions and classes.
63+
7. Update the documentation if your changes affect the usage or functionality of the package.
64+
8. Keep your pull request focused on a single feature or bug fix to make it easier to review.

docs/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ SIO3Pack documentation
88
:maxdepth: 2
99
:caption: Contents:
1010

11+
usage
12+
workflows
1113
sinolpack
14+
development

0 commit comments

Comments
 (0)