dmugtasimov / dmu-utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Development

Initial installation

  1. Install prerequisites:

    sudo apt-get install python-dev build-essential pkg-config python-pip
    sudo apt-get install libssl-dev libffi-dev
    
  2. Make sure that Python 2.7.12 is installed:

    python --version
    
  3. Install and configure git:

    sudo apt-get install git
    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'youremail@youremail_domain.com'
    
  4. Fork https://github.com/dmugtasimov/dmu-utils repository

  5. Clone forked repository (replace <username> with your github account name):

    git clone git@github.com:<username>/dmu-utils.git
    cd dmu-utils
    
  6. Create .gitignore:

    cat << EOF >> .gitignore
    .gitignore
    *.py[cod]
    /local/
    # insert personal development environment entries here
    EOF
    
  7. Install virtualenvwrapper:

    sudo pip install virtualenv
    sudo pip install setuptools
    pip install --user virtualenvwrapper
    cat << EOF >> ~/.bashrc
    export WORKON_HOME=$HOME/.virtualenvs
    source ~/.local/bin/virtualenvwrapper.sh
    EOF
    
    export WORKON_HOME=$HOME/.virtualenvs
    source ~/.local/bin/virtualenvwrapper.sh
    
  8. Create virtualenv:

    mkvirtualenv dmu-utils
    
  9. Install Python prerequisites:

    pip install setuptools==34.3.3
    pip install pip==9.0.1
    
  10. Continue with Upgrade section

Upgrade

  1. Install dmu-utils in development mode:

    cd dmu-utils
    workon dmu-utils
    pip install -e .[schematics,sqlalchemy,dev]
    

Run tests

  1. Activate virtual env:

    cd dmu-utils
    workon dmu-utils
    
  2. With pytest:

    pytest
    # or
    mkdir tmp
    pytest --cov-report annotate:./tmp/cov_annotate --cov=dmu_utils
    

Various tasks

  1. Remove all .pyc and .pyo files:

    find . -name '*.pyc' -delete
    find . -name '*.pyo' -delete
    

About


Languages

Language:Python 100.0%