Skip to content

Contributors ‐ Development environment

Simon Olofsson edited this page Sep 23, 2023 · 1 revision

Setting up a dev environment to contribute to Pyttman

First off - Thank you for reading this! It means you're considering contributing to this project, and for that I'm truly grateful. Here's how I setup an environment locally, to test deployments of the framework as I develop Pyttman.

0. Forking the project

Start by creating a fork of the project from GitHub. You can read more on how this is done here:

https://docs.github.com/en/get-started/quickstart/fork-a-repo

1. Cloning the project to your machine

Now, with git already installed, clone the repo by following these instructions:

https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository

2. Installing dependencies

2.1 You need Python >= 3.10 to start contributing. Install Python 3.10 or greater here:

https://www.python.org/downloads/

2.2 You need a few packages globally installed: outside the the virtual environment. Install them by pasting these commands in your terminal:

pip install multidict, setuptools, wheel, virtualenv

3. Creating a virtual environment

There are scripts setting things up for you. Run them in the order of appearence.

  1. Navigate to the pyttman root directory (contains the setup.py file)
  2. Paste and execute the following commands in order:
  • Mac / Linux:
# Ensure you're using the correct interpreter: 3.10. Your syntax may vary.
python3 devtools/build.py
python3 devtools/create_environment.py
  • Windows:
python devtools\build.py
python devtools\create_environment.py

Using the dev environment

The development environment setup for you is stored in your pyttman repository directory, and contains a dev_env directory. This directory simulates how an empty directory will look, for users who are building an app with Pyttman.

The directory should reflect this tree:

- pyttman/
  - build/
  - dev_env/
  - devtools/
  - dist/
  - pyttman/
  - tests/
  - CHANGELOG.md
  - conftest.py
  - LICENSE
  - README.md
  - setup.py

Creating an app using the current build version

Navigate to pyttman\dev_env and activate the virtual environment:

  • ** Mac / Linux:** source venv/bin/activate

  • ** Windows:** venv\scripts\activate

Create an app with your current build of Pyttman

pyttman new app {app_name}

Configure the app to your liking and run it by:

pyttman dev {app_name

Refreshing the environment

As you fix features or bugs, and you want to try them in your app: just run python devtools\create_environment.py again, to get your latest Pyttman code accessible in your test app.