Machine Learning for Software Engineering Seminar @HPI
Python and a package manager like pip and/or conda need to be installed on your system.
-
Open your terminal and clone the repository:
git clone https://github.com/valeriatisch/ml4testing.git
To update the repo with remote changes, run:
git pull
-
We recommend using a virtual environment. You can create and activate a new environment with conda or another package manager of your preference.
conda create -n ml4testing pip python=3.8 conda activate ml4testing
You will be asked to proceed; type
y
and enter. This might take a while.To deactivate the environment, run:
conda deactivate
To remove the environment, run:
conda remove -n ml4testing --all
Hint: You can use direnv to automatically (de)activate the environment when you enter the directory. Install direnv and run
direnv allow .
inside the repo. That is what the.envrc
file is for. -
Install the dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add the following variables:GITHUB_TOKEN=<your github token> REPO=<your username>/<your reponame> OPENAI_API_KEY=<your openai api key>
Find an example in
.env.example
.
Note:- The GitHub Token needs to have permissions to read and write issues on this repository.
- The OpenAI API Key can be generated here. You need to have a payment method set.
-
You can run the app with:
python main.py
To keep the code clean and consistent, we use pre-commit as a linter and black as a code formatter.
The configuration is stored in .pre-commit-config.yaml
.
Inside the repo, run:
pre-commit install
Now, pre-commit will run automatically on git commit
.
If you want to run it manually on all files, use pre-commit run --all-files
or pre-commit run <file>
for a specific file. This works only on files that are added.
Run black .
to format all files automatically or black <file>
for a specific file.