Skip to content

Commit 8fe9245

Browse files
Add utility scripts for problem resource generation and testing (#9)
* Add utility scripts for problem resource generation and testing - Implement `generateresources.py` to generate test plans and images for problems. - Create `lint` script for linting checks in a Docker container. - Introduce `problems.py` to manage problem loading and validation. - Develop `runtests.py` for running tests on problems with concurrent execution. - Add a sample configuration file `sample-config.yaml` for problem setup. - Implement `upload.py` to handle problem uploads to omegaUp, including zip creation and API interactions. * Update container image version in lint script to v1.0.9 * Enhance error handling in Problem.load method for loading settings.json * Improve error handling in repositoryRoot function to raise RuntimeError for Git repository issues * changed from 'open' to 'with open' while opening zipPath * Refactor constants in problems and upload modules for better maintainability * updating the readme * adding runtest.py file
1 parent 9ed24b0 commit 8fe9245

13 files changed

Lines changed: 1750 additions & 1 deletion

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
* emacs temp files
2+
*~
3+
4+
* MAC
5+
*.DS_STORE
6+
Thumbs.db
7+
8+
*.zip
9+
*.exe
10+
a.out
11+
*.o
12+
*.orig
13+
*.bak
14+
*.bat
15+
16+
# libinteractive
17+
*.cbp
18+
*.layout
19+
*.bat
20+
libinteractive
21+
libinteractive.jar
22+
Makefile
23+
24+
.vscode
25+
results

.lint.config.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"lint": {
3+
"clang-format": {
4+
"allowlist": [".*\\.cpp$"]
5+
},
6+
"karel": {
7+
"allowlist": [".*\\.(kp|kj)$"]
8+
},
9+
"json": {
10+
"allowlist": [".*\\.json$"]
11+
},
12+
"markdown": {
13+
"allowlist": [".*\\\\Palindromos\\\\.*\\.cpp"]
14+
},
15+
"python": {
16+
"allowlist": [".*\\.py$"],
17+
"pylint_config": ".pylintrc"
18+
},
19+
"problematic-terms": {
20+
"terms": [
21+
{
22+
"regexps": ["^[ \\t]*using\\s+namespace\\s+std\\s*;[ \\t]*$"],
23+
"message": "El uso de `using namespace std;` es no-deseable.\n\nEl comité de C++ se reserva el derecho de usar cualquier nombre en `std::`, porque hacer `using namespace std;` es una causa común de errores al momento de cambiar de compilador. Por ejemplo, C++17 introdujo `std::count()`[1], así que todos los códigos de C++ que usan `using namespace std;` y declaran algo con el nombre `count` tienen un CE instantáneo.\n\n1: https://en.cppreference.com/w/cpp/algorithm/count"
24+
},
25+
{
26+
"regexps": [
27+
"^[ \\t]*#\\s*include\\s*<\\s*bits/stdc\\+\\+\\.h\\s*>[ \\t]*$"
28+
],
29+
"message": "El uso de `bits/stdc++.h` es no-deseable.\n\nTodas las cabeceras de `bits/` son específicas al compilador y la arquitectura. Una causa común de errores de compilación locales es el uso de esta librería."
30+
}
31+
],
32+
"allowlist": [".*\\\\Palindromos\\\\.*\\.cpp"]
33+
}
34+
}
35+
}

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# public-courses
1+
# Public Courses on Omegaup
2+
This repository contains the course content for the public courses on Omegaup.
3+
4+
## How to Contribute
5+
You can contribute to the courses by adding new content, fixing typos, or improving existing materials. To do so, please follow these steps:
6+
1. Fork the repository.
7+
2. Create a new branch for your changes.
8+
3. Make your changes and commit them with a clear message.
9+
4. Push your changes to your forked repository.
10+
5. Create a pull request to the main repository.
11+
12+
## How to Sync Courses:
13+
If you think that a course content in this repository has ran out of sync with the omegaup.com you can raise a pull request to sync the content.
14+
To do this, follow these steps:
15+
1. Fork the repository.
16+
2. Create a new branch for your changes.
17+
3. Edit the `sync-course.json` file to include the course name and the specific content that is out of sync.
18+
4. Commit your changes with a clear message.
19+
5. Push your changes to your forked repository.
20+
6. Create a pull request to the main repository with target branch sync-course.
21+
7. When your pull request is merged a github action will run to sync the course content with omegaup.com and add commit to your pull request.
22+
8. Now the admins will merge this pull request to the main branch.

problems.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"problems": []
3+
}

utils/Pipfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[dev-packages]
9+
10+
mypy = ">=0.782"
11+
pycodestyle = ">=2.6.0"
12+
13+
14+
[packages]
15+
16+
libkarel = ">=1.0.2"
17+
omegaup = ">=1.3.0"
18+
19+
20+
[requires]
21+
22+
python_version = "3.8"

utils/Pipfile.lock

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)