Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 2.04 KB

CONTRIBUTING.md

File metadata and controls

93 lines (65 loc) · 2.04 KB

Contributing to this repo

Virtual environment

Install dependencies

Instructions for POSIX bash/zsh (see here for syntax for other shells):

python3 -m venv env
source env/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt -r requirements-dev.txt
source env/bin/activate
pre-commit install

Setup

Personal access token (PAT)

Follow these instructions to configure a PAT in GitHub.

Scopes:

  • repo (and all sub-items)
  • workflow

Save the token to a secure location. Click the "Configure SSO" button and "Authorize" if applicable.

Config

cp config.example.json config.json

# Add the relevant GitHub username, email address and token
$EDITOR config.json

# Export the JSON credentials into an environment variable
export CONFIG=$(<config.json)

Run in test mode

  • Set "repo": "hub.getdbt.com-test" within config.json (or specify some other non-production repository).
  • Optional: set "push_branches": false within config.json.

Run:

python3 hubcap.py

Run in production mode

WARNING: Use with caution -- will modify state.

  • Set "repo": "hub.getdbt.com" within config.json (since hub.getdbt.com is the production repository).
  • Set "push_branches": true within config.json.

Run:

python3 hubcap.py

Testing locally

python -m pytest

Or just:

tox

GitHub Actions (GHA) locally

Download and install act then:

act

For Apple M1 Mac users, might need to do this:

act --container-architecture linux/amd64

Generate requirements.txt

Put any first degree dependencies within requirements.in, then run:

pip-compile

It will generate a new version of requirements.txt with each transitive dependency pinned to a specific version.