Metadata-Version: 2.1
Name: sinol_make
Version: 1.6.0.dev2
Summary: CLI tool for creating sio2 task packages
Author: Mateusz Masiarz
Author-email: m.masiarz@fri.edu.pl
Maintainer: Tomasz Nowak, Mateusz Masiarz
Maintainer-email: tomasz.nowak@tonowak.com, m.masiarz@fri.edu.pl
Project-URL: Bug Tracker, https://github.com/sio2project/sinol-make/issues
Project-URL: Homepage, https://github.com/sio2project/sinol-make
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: argparse
Requires-Dist: argcomplete
Requires-Dist: requests
Requires-Dist: PyYAML
Requires-Dist: dictdiffer
Requires-Dist: importlib-resources
Requires-Dist: psutil
Requires-Dist: packaging
Provides-Extra: tests
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: pytest-xdist ; extra == 'tests'
Requires-Dist: requests-mock ; extra == 'tests'

# ![Logo](https://avatars.githubusercontent.com/u/2264918?s=60&v=4) sinol-make

`sinol-make` is a CLI tool for creating and verifying problem packages
for [sio2](https://github.com/sio2project/oioioi)
with features such as:

- measuring time and memory in the same deterministic way as sio2,
- running the solutions in parallel,
- keeping a git-friendly report of solutions' scores,
- catching mistakes in the problem packages as early as possible,
- and more.

## Contents

- [Why?](#why)
- [Installation](#installation)
- [Usage](#usage)
- [Reporting bugs and contributing code](#reporting-bugs-and-contributing-code)

### Why?

The purpose of the tool is to make it easier to create good problem packages
for official competitions, which requires collaboration with other people
and using a multitude of "good practices" recommendations.
While there are several excellent CLI tools for creating tests and solutions,
they lack some built-in mechanisms for verifying packages and finding mistakes
before uploading the package to the judge system.
As sinol-make was created specifically for the sio2 problem packages,
by default it downloads and uses sio2's deterministic mechanism of measuring
solutions' runtime, called `oiejq`.

### Installation

It's possible to directly install [sinol-make](https://pypi.org/project/sinol-make/)
through Python's package manager pip, which usually is installed alongside Python:

```bash
pip3 install sinol-make
```

`pip` installs the `sinol-make` executable in `~/.local/bin/` directory,
so make sure this directory is in your `PATH`.
[Here's](https://gist.github.com/nex3/c395b2f8fd4b02068be37c961301caa7) how to add a directory to `PATH`.

As `oiejq` works only on Linux-based operating systems,
*we do not recommend* using operating systems such as Windows or macOS.
Nevertheless `sinol-make` supports those operating systems,
though there are additional installation steps required to use
other tools for measuring time (which are non-deterministic and produce reports different from sio2):

- Debian-based systems (Ubuntu, usually Windows WSL): `apt install time`
- Arch-based systems: `pacman -S time`
- macOS: `brew install gnu-time coreutils`

#### Autocompletion (optional)

If you would like to have autocompletion for `sinol-make` commands,
run the following command and refresh the shell (e.g. by opening a new terminal):

```shell
activate-global-python-argcomplete
```

### Usage

The availabe commands (see `sinol-make --help`) are:

- `sinol-make run` -- Runs selected solutions (by default all solutions) on selected tests (by default all tests) with a given number
of CPUs. Measures the solutions' time with oiejq, unless specified otherwise. After running the solutions, it
compares the solutions' scores with the ones saved in config.yml. If you're using oiejq, make sure you are not running on efficiency
cpu cores. You can check if you have them [like this](https://stackoverflow.com/a/71282744). To run on normal cpu cores, use
`taskset -c 8-15 sinol-make ...`, assuming that cpu cores 8-15 are not efficiency cores.
Run `sinol-make run --help` to see available flags.
- `sinol-make gen` -- Generate input files using ingen program (for example prog/abcingen.cpp for abc task). 
Whenever the new input differs from the previous one, the model solution will be used to generate the new output file.
You can also specify your ingen source file which will be used.
Run `sinol-make gen --help` to see available flags.
- `sinol-make ingen` -- Generate input files using ingen program (for example prog/abcingen.cpp for abc task).
You can also specify your ingen source file which will be used.
Run `sinol-make ingen --help` to see available flags.
- `sinol-make outgen` -- Generate output files using the model solutions. Run `sinol-make outgen --help` to see available flags.
- `sinol-make inwer` -- Verifies whether input files are correct using your "inwer.cpp" program. You can specify what inwer
program to use, what tests to check and how many CPUs to use. Run `sinol-make inwer --help` to see available flags.
- `sinol-make export` -- Creates archive ready to upload to sio2 or szkopul. Run `sinol-make export --help` to see all available flags.
- `sinol-make doc` -- Compiles all LaTeX files in doc/ directory to PDF. Run `sinol-make doc --help` to see all available flags.
- `sinol-make init [id]` -- Creates package from template [on github](https://github.com/sio2project/sinol-make/tree/main/example_package) and sets task id to provided `[id]`. Requires an internet connection to run.

You can also run multiple commands at once, for example:

```shell
sinol-make gen prog/abcingen2.cpp inwer --cpus 4 run --tests abc1*.in doc export --no-statement
```

### Reporting bugs and contributing code

- Want to report a bug or request a feature? [Open an issue](https://github.com/sio2project/sinol-make/issues).
- Want to help us build `sinol-make`? Create a Pull Request and we will gladly review it.
