Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 2.13 KB

DEVELOPMENT.md

File metadata and controls

87 lines (64 loc) · 2.13 KB

Development Environment

Project Setup

System Requirements

Virtual environment

Option 1: Use an already created virtual environment via pyenv-virtualenv

# Create the virtual environment
pyenv virtualenv 3.11 easynetwork-3.11

# Set the local python (3.12 and upward are still needed for tox)
pyenv local "easynetwork-3.11" 3.12 3.13

# Tell pdm to use your virtualenv
pdm use -f $VIRTUAL_ENV
# -> Using Python interpreter: /path/to/.pyenv/versions/3.11.x/envs/easynetwork-3.11/bin/python3 (3.11)

Option 2: Let pdm create a .venv folder

  1. For the pyenv users, set the local python :
pyenv local 3.11 3.12 3.13
  1. Create the virtual environment :
# Creates the virtual environment ( in .venv directory )
pdm venv create 3.11

# Tell pdm to use this virtualenv
pdm use --venv in-project
  1. Activate the virtual environment in the current shell using either :

Installation

  1. Install the project with its dependencies and development tools :
pdm install -G:all
  1. If it is a clone of the git project, run :
pre-commit install
  1. Check the installation :
# Run pre-commit hooks
pre-commit run --all-files

# Run mypy against all the project
tox run -q -f mypy

Configure the IDE

Visual Studio Code

  1. The recommended extensions are in .vscode/extensions.json

  2. Copy .vscode/settings.example.json to .vscode/settings.json

  3. (Optional) To enable VS code's integrated testing tool, add this in your settings.json:

{
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.pytestArgs": [
        "-n",
        "auto"
    ]
}

⚠️ NEVER run all the test suite with VS code integrated testing tool ! There are 8000+ tests.