Skip to content

Latest commit

 

History

History
121 lines (78 loc) · 3.4 KB

INSTALL.linux.rst

File metadata and controls

121 lines (78 loc) · 3.4 KB

Local development environment setup for Linux

This section describes how to setup development environment for Debian-based distributions (tested on Linux Mint 20.2 specifically)

Initial setup

Once initial setup is done only corresponding Update section should be performed to get the latest version for development.

  1. Install prerequisites ( as prescribed at https://github.com/pyenv/pyenv/wiki/Common-build-problems and some other):

    # TODO(dmu) MEDIUM: Remove dependencies that are not really needed
    # TODO(dmu) MEDIUM: These dependencies seem to be candidates for removal: tk-dev wget curl llvm
    sudo apt update && \
    apt install git make build-essential libssl-dev zlib1g-dev libbz2-dev \
                libreadline-dev libsqlite3-dev libncurses5-dev \
                libncursesw5-dev xz-utils libffi-dev liblzma-dev \
                python-openssl libpq-dev
    
  2. Install Docker according to https://docs.docker.com/engine/install/ubuntu/ (known working: Docker version 20.10.14, build a224086)

  3. Add your user to docker group:

    sudo usermod -aG docker $USER
    exit  # you may actually need to reboot for group membership to take effect
    
  4. Install Docker Compose according to https://docs.docker.com/compose/install/ (known working: Docker Compose version v2.4.1)

  5. Clone the repository:

    git clone [email protected]:thenewboston-developers/Core.git
    
  6. [if you have not configured it globally] Configure git:

    git config user.name 'Firstname Lastname'
    git config user.email 'youremail@youremail_domain.com'
    
  7. Ensure you have Python 3.10.x installed and it will be used for running the project (you can do it with optional steps below)

  8. [Optional] Install Python 3.10.x with pyenv

    1. Install and configure pyenv according to https://github.com/pyenv/pyenv#basic-github-checkout

    2. Install Python 3.10.4:

      pyenv install 3.10.4
      pyenv local 3.10.4 # run from the root of this repo (`.python-version` file should appear)
      
  9. Install Poetry:

    export PIP_REQUIRED_VERSION=22.2.1
    pip install pip==${PIP_REQUIRED_VERSION} && \
    pip install virtualenvwrapper && \
    pip install poetry==1.1.13 && \
    poetry config virtualenvs.path ${HOME}/.virtualenvs && \
    poetry run pip install pip==${PIP_REQUIRED_VERSION}
    
  10. Setup local configuration for running code on host:

    mkdir -p local && \
    cp core/project/settings/templates/settings.dev.py ./local/settings.dev.py && \
    cp core/project/settings/templates/settings.unittests.py ./local/settings.unittests.py
    
    # Edit files if needed
    vim ./local/settings.dev.py
    vim ./local/settings.unittests.py
    
  11. Install dependencies, run migrations, etc by doing Update section steps

  12. Create superuser:

    make superuser
    

Update

  1. (in a separate terminal) Run dependency services:

    make up-dependencies-only
    
  2. Update:

    make update
    

Run quality assurance tools

  1. Lint:

    make lint
    

Run

  1. (in a separate terminal) Run only dependency services with Docker:

    make up-dependencies-only
    
  2. (in a separate terminal) Run server:

    make run-server
    

Run dockerized

  1. Run dockerized:

    make run-dockerized
    

Development tools

  1. Make migrations:

    make migrations
    

This is a technical last line to serve as end-of-file-fixer workaround.