Hi there! Welcome to the tilesets-cli contributing document. Issues, comments, and pull requests are welcome. Please tag @mapbox/maps-api for any questions or reviews.
First, clone the repo and cd
into the folder:
# clone
git clone git@github.com:mapbox/tilesets-cli.git
cd tilesets-cli
# virtual env (optional)
mkvirtualenv tilesets-cli
# install deps
pip install -e '.[test]'
# confirm installation was successful
tilesets --help
tilesets --version
We use pre-commit hooks to auto-format and validate code before committing. pre-commit
is included with the [test]
extras, but you must run:
$ pre-commit install
within the repo to have the actions specified in .pre-commit-config.yaml
registered.
After this, when committing, you'll see:
git commit -m 'update version'
black....................................................................Passed
Flake8...................................................................Passed
If your pre-commit hooks ran successfully. Note that black
modifies your code, which means that if there is a syntax error you'll first see something like:
git commit -m '{message}'
black....................................................................Failed
hookid: black
Files were modified by this hook. Additional output:
reformatted this/file/was/reformatted.py
All done! ✨ 🍰 ✨
1 file reformatted.
Flake8...................................................................Failed
hookid: flake8
this/file/was/reformatted.py:{line}:{character}: {what was incorrect}
After which you can add these changes and commit again. Note that failing pre-commit commands mean that the commit has not taken place: you must commit again!
Releases to PyPi are handled via TravisCI and GitHub tags. Once changes have been merged to master:
- Update the version in mapbox_tilesets/init.py
- Update the changelog
- Commit changes to your branch. For example
git commit -am '0.2.0' && git push origin HEAD
- Get a review and merge your changes to master.
- Get the latest changes locally from master
git checkout master && git pull origin master
- Tag on GitHub with
git tag
and push tags. For examplegit tag -a v0.2.0 -m 'v0.2.0' && git push --tags
- Watch for tag build on travis at https://travis-ci.com/github/mapbox/tilesets-cli/builds
- Once travis completes successfully, look for the release at https://pypi.org/project/mapbox-tilesets/#history
All tests are runnable with pytest. pytest is not installed by default and can be installed with the pip test extras
pip install -e '.[test]'
Running tests
pytest