Skip to content

Commit 63074ea

Browse files
committed
fixed README and hashing, added CI
1 parent a54cbf7 commit 63074ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+431
-254
lines changed

.github/workflows/python-app.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on: [push, pull_request]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.10"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
# testing packages
26+
pip install pytest mock pytest-timeout
27+
# linter
28+
pip install pylint
29+
# dependencies
30+
pip install .
31+
- name: Lint with pylint
32+
run: |
33+
pylint $(git ls-files '*.py')
34+
- name: Test with pytest
35+
run: |
36+
pytest

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include pyalgotask/languages/*.yaml

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ Generally, for input the parameters `-i` are used for commandline input and `-f`
5757

5858
Further customization is possible and explained in the help for each task.
5959

60+
### Virtual Environment
61+
You may need to use a virtual environment to install pylatex. To do this, execute the following
62+
63+
python -m venv ./venv
64+
source ./venv/bin/activate
65+
6066
## Project Structure
61-
This project is structured in five parts, the [Main part](#main-part), the [Tasks](#tasks), the [Inpud modules](#input), the [Randomizer modules](#randomizer) and the [Output modules](#output). Additionally, we use unittesting with [pytest](https://pytest.org/).
67+
This project is structured in five parts, the [Main part](#main-part), the [Tasks](#tasks), the [Input modules](#input), the [Randomizer modules](#randomizer) and the [Output modules](#output). Additionally, we use unittesting with [pytest](https://pytest.org/).
6268

6369
### Main part
6470
The main class `src/pyAlgoTask/__man__` deals with reading the parser and calling all other modules. This includes error handling, to call the exporter `src/pyAlgoTask/export` for file export and allowing all tasks to register themself using the module `src/pyAlgoTask/tasks/tasks.py` and their argument parsers. Most modules have the possibility to register parser options themself (using [argparse](https://docs.python.org/3/library/argparse.html)) and to parse the parameter themself.
@@ -79,7 +85,7 @@ Generally, every Input module also has a Randomizer module to generate a certain
7985
Output modules are used to generate LaTeX code for certain types of tasks. Since tasks are rather diverse, so are their respective output modules. Generally speaking, the exercise file contains first some text, usually consisting of a pretext, the input for the algorithm, followed by a posttext. Lastly space for entering the solution is given. The space is roughly oriented on the solution, but sometimes a bit more space is given (i.e. for open hashing we offer sufficient place to insert every item at one position)
8086

8187
### Testing
82-
The module `tests/...` offer various testing classes using [pytest](https://pytest.org/) with [mock](https://docs.python.org/3/library/unittest.mock.html). We use one testing file per category, where we try to test all algorithms in the same class similarly or even the same to enforce uniformity.
88+
The module `tests/...` offer various testing classes using [pytest](https://pytest.org/) with [mock](https://docs.python.org/3/library/unittest.mock.html) and [pytest-timeout](https://pypi.org/project/pytest-timeout/). We use one testing file per category, where we try to test all algorithms in the same class similarly or even the same to enforce uniformity.
8389

8490
### Documentation
8591
Documentation is designed for pydoctor using the command

__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Main method for directly calling with python"""
2+
from pyalgotask.main import main
3+
4+
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)