Git Product home page Git Product logo

brainbot's Introduction

brainbot Repo

A framework to experiment with using asyncio coroutines to control 2D objects in a simulation

How to run tools against the code

# create and activate virtual environment
python -m venv venv  # or `py -3.8 -m venv venv`
source venv/Scripts/activate

# install to current environment (with current dir at top of repo) 
pip install .     # "static" install
pip install -e .  # "editable" install (setup.py handles source being under `src/`)

# run app from install
python -m brainbot

# run app directly from local repo (with current dir at top of repo)
cd src/
python -m brainbot

# run tests: path-based 
python -m pytest tests/
python -m pytest tests/test_common.py
python -m pytest tests/sub
# run tests: package syntax
python -m pytest --pyargs tests.sub

# run tests with coverage metrics
python -m pytest --cov tests/
python -m pytest --cov tests/sub
python -m pytest --cov tests.sub

# run linting
pylint src/  # recurses into directory
pylint src/ tests/
pylint brainbot.common  # can use package names to lint what is installed

# run mypy
mypy src/  # recurses into directory tree
mypy src/brainbot/common/util.py

cd src
mypy -p brainbot
mypy -p brainbot.common
mypy -m brainbot.common.util

Running app from PyCharm

Use Default Python Interpreter from PyCharm

  • For src/, do "Mark Directory" and set as "Sources Root" (folder turns light blue)
  • Right click on src/brainbot/__main__.py and choose "Run __main__"
    • This relies on the Run Configuration having "Add source roots to PYTHONPATH" set to true (the default)

Use local venv

  • Create venv
  • Install package into the venv (ex: pip install -e .)
  • Set venv as the project's Python interpreter in PyCharm
  • Right click on src/brainbot/__misc__.py and choose "Run __main__"
    • Note: This does NOT rely on a Sources Root folder being set or PYTHONPATH in the Run Configuration.

brainbot's People

Contributors

sirgnip avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.