Skip to content

Commit

Permalink
Additional sinol -> st changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adespawn committed Feb 24, 2024
1 parent a890c57 commit e48e6fe
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ with features such as:
- catching mistakes in the problem packages as early as possible,
- and more.

This tool is a fork of [sinol-make](https://github.com/sio2project/sinol-make), with features specific for [Talent](https://talent.edu.pl/) contests
This tool is a fork of [sinol-make](https://github.com/sio2project/sinol-make), with features specific for [Talent](https://talent.edu.pl/) contests.

# Contents

Expand All @@ -33,13 +33,13 @@ solutions' runtime, called `oiejq`.

### Installation

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

```
pip3 install sinol-make
pip3 install st-make
```
`pip` installs the `sinol-make` executable in `~/.local/bin/` directory,
`pip` installs the `st-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`.

Expand Down Expand Up @@ -88,5 +88,5 @@ program to use, what tests to check and how many CPUs to use. Run `st-make inwer

- Want to report a bug or request a feature? Open issue:
- [for Talent specific features](https://github.com/Stowarzyszenie-Talent/st-make/issues),
- [for sinol-make](https://github.com/sio2project/sinol-make/issues).
- [for other areas](https://github.com/sio2project/sinol-make/issues).
- Want to help us build `st-make`? Create a Pull Request and we will gladly review it.
2 changes: 1 addition & 1 deletion example_package/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sinol-make
# st-make
.cache
cache
in/.md5sums
Expand Down
10 changes: 5 additions & 5 deletions example_package/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ override_limits:
# extra_compilation_files: ['abclib.cpp', 'abclib.py']


### Keys used by sinol-make:
### Keys used by st-make:

# This key represents the short name (consisting of 3 letters) of the task.
# The names of files in `prog/`, `doc/`, `in/` and `out/` directories have to start with this task id.
# This key is only used by `sinol-make`: running `sinol-make export` creates
# This key is only used by `st-make`: running `st-make export` creates
# an archive with the proper name, which sio2 uses as the task id.
sinol_task_id: abc

# sinol-make can behave differently depending on the value of `sinol_contest_type` key.
# st-make can behave differently depending on the value of `sinol_contest_type` key.
# Mainly, it affects how points are calculated.
# If the key is not specified, then `default` is used.
# Possible values are:
Expand All @@ -83,8 +83,8 @@ sinol_task_id: abc
# A solution passes when all groups pass.
sinol_contest_type: oi

# sinol-make can check if the solutions run as expected when using `run` command.
# st-make can check if the solutions run as expected when using `run` command.
# Key `sinol_expected_scores` defines expected scores for each solution on each tests.
# There should be no reason to change this key manually.
# It is automatically generated and managed by sinol-make.
# It is automatically generated and managed by st-make.
sinol_expected_scores: {}
4 changes: 2 additions & 2 deletions src/sinol_make/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def main_exn():
new_version = util.check_for_updates(__version__)
if new_version is not None:
print(util.warning(
f'New version of sinol-make is available (your version: {__version__}, available version: {new_version}).\n'
f' You can update it by running `pip3 install sinol-make --upgrade`.'))
f'New version of st-make is available (your version: {__version__}, available version: {new_version}).\n'
f' You can update it by running `pip3 install st-make --upgrade`.'))

if util.is_linux() and not oiejq.check_oiejq():
print(util.warning('`oiejq` in `~/.local/bin/` not found, installing now...'))
Expand Down
4 changes: 2 additions & 2 deletions src/sinol_make/commands/init/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def configure_subparser(self, subparser: argparse.ArgumentParser):
parser.add_argument('task_id', type=str, help='Id of the task to create')

def download_template(self):
repo = 'https://github.com/sio2project/sinol-make.git'
package_dir = 'sinol-make/example_package'
repo = 'https://github.com/Stowarzyszenie-Talent/st-make.git'
package_dir = 'st-make/example_package'
self.used_tmpdir = tempfile.TemporaryDirectory()
tmp_dir = self.used_tmpdir.name
ret = subprocess.run(['git', 'clone', '-q', '--depth', '1', repo], cwd=tmp_dir)
Expand Down
6 changes: 3 additions & 3 deletions src/sinol_make/commands/run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,9 @@ def use_oiejq():
if not util.is_linux():
util.exit_with_error('As `oiejq` works only on Linux-based operating systems,\n'
'we do not recommend using operating systems such as Windows or macOS.\n'
'Nevertheless, you can still run sinol-make by specifying\n'
'Nevertheless, you can still run st-make by specifying\n'
'another way of measuring time through the `--time-tool` flag.\n'
'See `sinol-make run --help` for more information about the flag.\n'
'See `st-make run --help` for more information about the flag.\n'
'See https://github.com/sio2project/sinol-make#why for more information about `oiejq`.\n')

oiejq.check_perf_counters_enabled()
Expand Down Expand Up @@ -1203,6 +1203,6 @@ def run(self, args):
except Exception:
util.exit_with_error("Validating expected scores failed. "
"This probably means that `sinol_expected_scores` is broken. "
"Delete it and run `sinol-make run --apply-suggestions` again.")
"Delete it and run `st-make run --apply-suggestions` again.")
self.print_expected_scores_diff(validation_results)
self.exit()
2 changes: 1 addition & 1 deletion src/sinol_make/helpers/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def check_can_access_cache():
os.unlink(paths.get_cache_path("test"))
except PermissionError:
util.exit_with_error("You don't have permission to access the `.cache/` directory. "
"`sinol-make` needs to be able to write to this directory.")
"`st-make` needs to be able to write to this directory.")


def has_file_changed(file_path: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion src/sinol_make/helpers/package_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _get_limit_from_dict(dict: Dict[str, Any], limit_type: LimitTypes, test_id:
return dict[plural_limit_name][test_id]
else:
util.exit_with_error(
f'{os.path.basename(test_path)}: Specifying limit for a single test is not allowed in sinol-make.')
f'{os.path.basename(test_path)}: Specifying limit for a single test is not allowed in st-make.')
elif test_group in dict[plural_limit_name]:
return dict[plural_limit_name][test_group]
if limit_name in dict:
Expand Down
2 changes: 1 addition & 1 deletion src/sinol_make/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def check_for_updates(current_version) -> Union[str, None]:

def check_version():
"""
Function that asynchronously checks for new version of sinol-make.
Function that asynchronously checks for new version of st-make.
Writes the newest version to data/version file.
"""
importlib = import_importlib_resources()
Expand Down
10 changes: 5 additions & 5 deletions tests/commands/run/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def test_override_limits(create_package, time_tool):
@pytest.mark.parametrize("create_package", [get_stack_size_package_path()], indirect=True)
def test_mem_limit_kill(create_package, time_tool):
"""
Test if `sinol-make` kills solution if it runs with memory limit exceeded.
Test if `st-make` kills solution if it runs with memory limit exceeded.
"""
package_path = create_package
command = get_command()
Expand Down Expand Up @@ -516,13 +516,13 @@ def test_undocumented_test_limits_option(create_package, capsys):

assert e.value.code == 1
out = capsys.readouterr().out
assert "und1a.in: Specifying limit for a single test is not allowed in sinol-make." in out
assert "und1a.in: Specifying limit for a single test is not allowed in st-make." in out


@pytest.mark.parametrize("create_package", [get_simple_package_path(), get_example_tests_package_path()], indirect=True)
def test_no_tests(create_package, time_tool, capsys):
"""
Test if `sinol-make` doesn't crash when there are no tests to run.
Test if `st-make` doesn't crash when there are no tests to run.
"""
parser = configure_parsers()
args = parser.parse_args(["run", "--time-tool", time_tool])
Expand All @@ -538,7 +538,7 @@ def test_no_tests(create_package, time_tool, capsys):
@pytest.mark.parametrize("create_package", [get_example_tests_package_path()], indirect=True)
def test_only_example_tests(create_package, time_tool, capsys):
"""
Test if `sinol-make` works only on example tests
Test if `st-make` works only on example tests
"""
package_path = create_package
create_ins_outs(package_path)
Expand Down Expand Up @@ -719,7 +719,7 @@ def test_contest_type_change(create_package, time_tool):
@pytest.mark.parametrize("create_package", [get_simple_package_path()], indirect=True)
def test_cwd_in_prog(create_package, time_tool):
"""
Test if `sinol-make` works when cwd is in prog.
Test if `st-make` works when cwd is in prog.
"""
package_path = create_package
os.chdir("prog")
Expand Down

0 comments on commit e48e6fe

Please sign in to comment.