Skip to main content

KoKoS helper tool

Project description

KoKoS

Утилита для удобного решения задач курса АКОС.

Если есть вопросы по использованию — скорее всего это значит, что ответ на эти вопросы должен быть в README. Обязательно напишите об этом мне: @darkkeks. Также принимаю любые предложения и запросы фич.

Inspired by

Installation

Из PyPi

pip3 install kokos 
# or to update
pip3 install --upgrade kokos 

Возможно вы увидите варнинг вида

WARNING: The script kks is installed in '/home/darkkeks/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Это значит, что скрипт не добавлен в PATH. Чтобы пользоваться им без указания пути, стоит добавить его в PATH, например в .bashrc вот так:

PATH="/home/darkkeks/.local/bin":$PATH

Из исходников

git clone https://github.com/DarkKeks/kks.git
cd kks
pip3 install .

Usage

Про пароль

Для использования не обязательна авторизация в ejudge. Сборка, линтер, тестирование и генерация тестов будет работать без авторизации.

Авторизация используется, чтобы выкачать список задач либо парсить статус из ejudge.

Также, у kks auth есть флаг --no-store-password, который сохранит локально только логин и id контеста, но не пароль. Пароль будет запрашиваться каждый раз, когда сессия протухает.

Без этого флага, пароль хранится в plaintext в файле ~/.kks/config.ini.

Демо

TLDR

Почти у всех команд есть адекватный --help, там бывают полезные аргументы, не описанные ниже.

# Create .kks-workspace in current directory to mark kks workspace root
kks init

# Auth in ejudge
kks auth
# Dont store password in plaintext
kks auth --no-store-password

# Parse tasks from ejudge and create directories with template solutions
kks sync

# Show tasks status and user standings
kks status
kks top

# Build and run solution in current directory
cd sm01/1/
kks run
kks run --sample
kks run --test 10
kks run < input.txt

# Format solution using clang-format
kks lint

# Generate tests/001.in - tests/100.in using gen.py
# Generate tests/001.out - tests/100.out using solve.py
kks gen --range 1 100
# Generate test tests/123.{in,out}
kks gen --test 123
# Only generate *.out files (don't overwrite *.in)
# Useful if you entered tests manually and want to generate correct output
kks gen --range 1 10 --output-only
# Generate tests [1; 50] using gen.sh and other_solve.py, overwriting existing tests
kks gen --generator gen.sh --solution other_solve.py --range 1 50 --force

# Test solution
kks test
# Dont stop on error
kks test --continue
# Run solution on sample
kks test --sample
# Run solution on tests [1, 10]
kks test --range 1 10
kks test --test 15 -test 16

# Submit a solution
cd sm01/1; kks submit
kks submit -p sm02-3 ./code/main.c

Todo

  • run
    • run lint on every build
    • run with test as input
    • valgrind
  • test
    • only sample test with arg (-s, for example) and print output
    • test solve.py
    • .ans/.dat ?
  • gen
    • find gen.sh automatically
    • support .cpp and .c generator/solution
  • build
    • configure compiler
    • support multiple files
    • support asm
  • lint
    • show lint diff
    • dry run ?
  • ejudge
    • top
      • max score
      • optimistic scoreboard
      • sort/filter
  • sync
    • templates
    • reload samples for contest/task
  • activate / deactivate tasks ?

Project details


Release history Release notifications | RSS feed

This version

1.2.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kokos-1.2.5.tar.gz (21.2 kB view details)

Uploaded Source

File details

Details for the file kokos-1.2.5.tar.gz.

File metadata

  • Download URL: kokos-1.2.5.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for kokos-1.2.5.tar.gz
Algorithm Hash digest
SHA256 b135a1d18e2b63b65ff8b4768e197e8642189c651c9d5693bcfe35f91cfe3694
MD5 e8b4ea3995715ea7ddbe67acfc135619
BLAKE2b-256 087a026dc11892e0d1cd320a53a17f99d9db7f04f1ae47a9aa0ce14cab744187

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page