Skip to content

fmipython/pygrader

Repository files navigation

pygrader

Logo

pygrader CI&CDGPL-3.0

A grader for Python projects, used in the "Programming with Python" course at Sofia University "St. Kliment Ohridski", Faculty of Mathematics and Informatics.

Automatically grader Python projects based on a set of checks. Current supported set of checks are:

  • Project structure
  • Pylint
  • Type hints (via mypy)
  • Code coverage (via pytest & coverage)
  • Run the code against certain tests
  • If the project has a requirements.txt/pyproject.toml file

The tool supports configuration files, where you can specify the score for each check.

How to use (easier way)

  1. If you don't have Docker (or Docker Desktop) already, install it from here.

  2. Download or clone this repository, if you haven't already.

  3. Navigate to the project repository in a terminal and execute the following command:

./run <path_to_Python_project>

Replace <path_to_Python_project> with the path to your project directory. This command should work on all operating systems.

⚠️ If you are on Windows, <path_to_Python_project> should be a full path, not a relative one. For example, write C:\Users\YourName\Documents\Project instead of just ..\Project.

How to use 2.0 (raw way)

  1. Clone the repository and create a virtual environment:
git clone https://github.com/fmipython/pygrader
cd pygrader
python3 -m venv .venv
  1. Activate the virtual environment:

    • On Linux/MacOS:
    source .venv/bin/activate
    • On Windows:
    .venv\Scripts\activate
  2. Install the dependencies:

pip install .

Usage

python3 pygrader.py -c CONFIG_PATH PROJECT_PATH

Where PROJECT_PATH is the path to the project you want to grade and CONFIG_PATH is the path to the configuration you want to use.

Configuration

The grader supports configuration files in JSON format. The configuration specifies which checks to run, their maximum score, as well as other requirements. Refer to the documentation for more information.

Documentation

Link to the documentation here

Contributing

Licence

GPL-3.0

About

An overengineered grader for Python projects

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages