Metadata-Version: 2.2
Name: sio3pack
Version: 1.0.0.dev1
Summary: Library for interacting with packages
Author: Tomasz Kwiatkowski, Mateusz Masiarz, Jakub Rożek, Stanisław Struzik
Author-email: t.kwiatkowski@fri.edu.pl, m.masiarz@fri.edu.pl, j.rozek@fri.edu.pl, ss448502@students.mimuw.edu.pl
Maintainer: Tomasz Kwiatkowski, Mateusz Masiarz, Jakub Rożek, Stanisław Struzik
Maintainer-email: t.kwiatkowski@fri.edu.pl, m.masiarz@fri.edu.pl, j.rozek@fri.edu.pl, ss448502@students.mimuw.edu.pl
Project-URL: Bug Tracker, https://github.com/sio2project/SIO3Pack/issues
Project-URL: Homepage, https://github.com/sio2project/SIO3Pack
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: pytest-xdist; extra == "tests"
Provides-Extra: django-tests
Requires-Dist: pytest-django; extra == "django-tests"
Provides-Extra: django
Requires-Dist: django; extra == "django"

from sio3pack.graph import GraphOperation

# SIO3Pack

## Prerequisites
```
- Python 3.9 or higher
- pip
- Linux or macOS operating system
- Django 4.2.x (for Django support)
```

## Instalation
```
pip install sio3pack
```
## Example usage (in python)

### In OIOIOI

```python
# Package unpacking
import sio3pack, sio3workers
from django.conf import settings
package = sio3pack.from_file(path_to_package, django_settings=settings)
graph_op: GraphOperation = package.get_unpack_graph()
results = sioworkers.run(graph_op)
graph_op.return_results(results)
package.save_to_db(problem_id=1)
```

### Locally (for example `sinol-make`)

```python
import sio3pack, sio3workers.local
package = sio3pack.from_file(path_to_package)
graph_op: GraphOperation = package.get_unpack_graph()
results = sio3workers.local.run(graph_op)
graph_op.return_results(results)
```

---

## Development

### Test without django support

Install the package in editable mode and make sure that `django` and 
`pytest-django` are not installed.

```bash
pip install -e ".[tests]"
pip uninstall django pytest-django
```

Then follow the instructions in 
[General testing information](#general-testing-information).


### Test with django support

Install the package in editable mode along with Django dependencies:

```bash
pip install -e ".[django,tests,django_tests]"
```

Then follow the instructions in 
[General testing information](#general-testing-information).


### General testing information

Run the tests with `pytest` in the root directory of 
the repository.

```bash
pytest -v
```

To run tests in parallel, use the following command.

```bash
pytest -v -n auto
```

To run coverage tests, use the following command.

```bash
pytest -v --cov=sio3pack --cov-report=html
```

The coverage report will be generated in the file `htmlcov/index.html`.
