Developer Guidelines
We appreciate all types of contributions to pyrh: bug reports, documentation, and new features. The issue tracker is the best place to start if you are looking for small issues to get started with. Specifically look for those marked Needs Contributor.
Installation
Python 3.7+ is required
poetry
is used to manage package dependenciespre-commit
is used to manage the project’s tooling and lintingpyenv
/pyenv-virtualenv
are great and highly recommended but not covered in this guide
$ git clone https://github.com/robinhood-unofficial/pyrh.git
$ cd Robinhood
$ brew install poetry
$ brew install pre-commit
$ python -m venv pyrh_env
$ source pyrh_env/bin/activate
(pyrh_env) $ poetry install
(pyrh_env) $ pre-commit install
Lint checks are automatically run when you try to push the code. To manually run them
run the following command. If you want to skip the lint check, you can do that by using
--no-verify
when committing.
(pyrh_env) $ pre-commit run -a
(pyrh_env) $ git commit -am "Some patch commit" --no-verify # will skip lint checks
Running tests and viewing coverage
(pyrh_env) $ pytest # from the root directory
(pyrh_env) $ open htmlcov/index.html # opens coverage in browser (on macOS)
Contributing Code Changes
We operate using pull requests, please branch off of master to submit your changes. Make sure to go to GitHub fork the project and switch your remotes. Please try to update the docs and write some initial tests to aid with code review. Once you’re all set please add a towncrier file of your changes to the newsfragment directory.
(pyrh_env) $ git remote set-url origin https://github.com/{YOUR_USER_NAME}/pyrh.git
(pyrh_env) $ git remote add upstream https://github.com/robinhood-unofficial/pyrh.git
(pyrh_env) $ git checkout -b some_changes
(pyrh_env) $ # now make and commit your changes
(pyrh_env) $ git push --set-upstream origin some_changes
(pyrh_env) $ # now go to YOUR fork and submit a pull request upstream
Release
To cut a new release go through the following steps.
Make sure that the version is updated in both
__init__.py
andpyproject.toml
Make sure you’ve set up your PyPI credential with poetry
Then run:
towncrier build --draft # verify this works then run
towncrier build
poetry build
poetry publish --dry-run # verify this succeeds
poetry publish