Contributing Guide
⏱ tutorial time: 20 minutes
This tutorial will help you set up a full Development environment with all components of the isabl infrastructure.
Isabl API
Clone locally:
git clone [email protected]:papaemmelab/isabl_api.git cd apiBuild containers:
docker-compose buildRun tests using tox:
docker-compose run --rm django toxOr run pytest, pylint or pydocstyle individually:
docker-compose run --rm django pytest --ds example.settings --cov=isabl_api docker-compose run --rm django pylint isabl_api docker-compose run --rm django pydocstyle isabl_api
Create a superuser
Create a superuser with username and password set to admin (we will need it later):
docker-compose run --rm django python manage.py migrate
docker-compose run --rm django python manage.py createsuperuser --email [email protected] --username adminStart the backend
docker-compose upNow you can login in the frontend at http://localhost:8000 (there won't be much to see). An easy way to create objects is to run the client tests.
Coverage report
Since tests were run inside a container, we need to combine the coverages to see the html report:
alias opencov="mv .coverage .coverage.tmp && coverage combine && coverage html && open htmlcov/index.html"
pip install coverage && opencovIsabl CLI
Clone locally:
git clone [email protected]:papaemmelab/isabl_cli.git cd cliInstall with pip, it is strongly recommended to install in a virtual environment:
pip install -r requirements.txtRun tests using tox, make sure you created the admin user:
toxOr run pytest, pylint or pydocstyle individually:
py.test tests/ --cov=isabl_cli -s pylint isabl_cli pydocstyle isabl_cli
Note: if your changes depend on a particular branch of Isabl API, make sure both Isabl CLI and Isabl API branches are called the same so that the travis configuration can pick that up.
Isabl Web
Clone locally:
git clone [email protected]:papaemmelab/isabl_web.git cd webInstall yarn:
brew install yarn --without-nodeInstall dependencies:
yarn installStart the react development server:
yarn serveImportant! export
FRONTEND_URL=localhost:8080before runningdocker-compose upin the api repository, note that the port may vary.
Documentation
Simply create a PR in github:
git clone [email protected]:isabl/docs.gitContribute with Github
Create a branch for local development and get ready to make changes locally:
git pull git checkout -b name-of-your-bugfix-or-featureCommit your changes and push your branch to GitHub (see the emoji reference):
git add . git config commit.template .gitmessage git commit -m ":emoji: your short and nice description" git push origin name-of-your-bugfix-or-featureCreate a test in:
tests/Submit a pull request through the GitHub website.
Formatting projects
Python Projects are formatted with black. Is required for api, cli and apps, simply run:
pip install black && black .Project web is formatted following the Vue style guide. For this one, simply run:
yarn lintBumping version of PyPi
Following the semantic versioning guidelines and update the VERSION file before creating a PR, for instance:
echo v0.1.0 > isabl_api/VERSION
git add isabl_api/VERSION
git commit -m ":gem: bump to version 0.1.0"Emoji reference
We use emojis to quickly categorize commits and pull requests. These are some common type of changes we use but feel free to ignore the conventions:
emoji
name
type of change
🚀
rocket
new feature
🐛
bug
bug fix
📝
memo
changes to documentation
🎨
art
formatting no code change
🔧
wrench
refactoring production code
✅
white_check_mark
adding/editing test logic
👕
shirt
no production code change
💎
gem
bump to new version
Last updated
Was this helpful?