Skip to content
Mariano Reingart edited this page Mar 20, 2022 · 8 revisions

Quick Start Tutorial

Pre-requisites

You need to create a GitHub account and fork the project: https://docs.github.com/es/repositories/creating-and-managing-repositories/cloning-a-repository

forking

Python interpreter

For Windows, download the installer from the official page: www.python.org/downloads

For Ubuntu:

sudo apt-get install python3.8 python3.8-venv

Git

To clone the source code repository, you will need to install Git. For windows, see instructions in https://github.com/git-guides/install-git

For Ubuntu:

sudo apt-get install git

Dev environment

Download the source code (remember to use the URL for your fork):

git clone https://github.com/PyAr/PyZombis.git
cd PyZombis

cloning

Create a virtual environment:

# linux:
virtualenv .venv
# windows:
python3 -m venv .venv
        or
python -m venv .venv

Activate the virtual environment:

# linux:
. .venv/bin/activate
# windows:
.venv\Scripts\activate

Install the dependencies:

pip install -r requirements.txt

Finally, install End2End test framework (browsers):

python -m playwright install

installation

Ubuntu needs some additional packages:

sudo apt-get install libatk1.0-0 libatk-bridge2.0-0 libxkbcommon0 libgbm1 libpango-1.0-0 libatspi2.0-0

Build and serve the book

You need to activate the virtual environment (previous step)

To "compile" the code and create the interactive book pages, run:

runestone build

Then you can start a minimal webserver to browse the book at http://localhost:8080/

runestone serve

runestone_bs

Run the tests

You need to activate the virtual environment (previous step) You need to have running the webserver in background (see previous step)

pytest

pytest

Write a new E2E test:

Run the test generator to record your actions: https://playwright.dev/python/docs/codegen

playwright codegen http://localhost:8080/

playwright

Creating a Pull Request

To submit your code, you need to

  • Create a branch (for example my_first_branch, name it appropiatelly)
  • Commit your changes (with a message like "Fixes issue #..." with the ticket number)
  • Push (upload) the changes to the remote repository

Recommended reading: https://docs.github.com/en/get-started/quickstart/contributing-to-projects

Example

git checkout -b my_first_branch
git commit -a -m "Fixes issue #101"
git push --set-upstream origin my_first_branch

If you created a new file, please include it before committing with git add mynewfile.py

Then, you can open a ticket for this branch in GitHub: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request