Skip to content

Commit

Permalink
v0.12 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook authored Feb 3, 2021
2 parents 89f0b84 + b936b81 commit 6624ca6
Show file tree
Hide file tree
Showing 109 changed files with 30,070 additions and 1,458 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE/new-api-endpoint.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# New API Endpoint(s):
# New API Endpoint(s):
Closes #<issue number>

### Checklist
Expand All @@ -12,4 +12,3 @@ Closes #<issue number>
* **Tests**
- [ ] Add sample response data
- [ ] Add unit tests for new endpoint(s)

23 changes: 23 additions & 0 deletions .github/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
- repo: git://github.com/luismayta/pre-commit-mypy
rev: 0.1.1
hooks:
- id: mypy
93 changes: 93 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build

on:
push:
branches: [master, dev]
tags: ['v*']
pull_request:
branches: [master, dev]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# Cache packages per python version, and reuse until setup.py changes
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip-${{ matrix.python-version }}

- name: Install dependencies
run: pip install ".[dev]"
- name: Run unit tests
run: pytest

analyze:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-3.8-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip-3.8

- name: Install dependencies
run: pip install ".[dev]"
- name: Run style checks
run: |
black --check --diff .
isort --check --diff .
- name: Run linter
run: flake8 .
- name: Run type checks
run: mypy .
- name: Generate code coverage report
run: pytest --cov --cov-report=term --cov-report=html
- name: Send code coverage report to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
- name: Test Sphinx documentation build
run: make -C docs all
- name: Test package build
run: |
python setup.py sdist bdist_wheel
twine check dist/*
# Deploy pre-release builds from dev branch, and stable builds on tags only
release:
needs: [test, analyze]
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: pip install -U ".[build]"
- name: Build wheel
run: python setup.py sdist bdist_wheel
- name: Deploy to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
25 changes: 14 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
.installed.cfg
.mypy_cache/
bin
var
sdist
build
develop-eggs
.installed.cfg
dist
eggs
lib
lib64
parts
sdist
var
venv/

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -48,8 +50,9 @@ docs/modules/
# Mac OS X
.DS_Store

.idea
.mypy_cache
venv/

# Editors
.~*
.idea/
.ipynb_checkpoints/
swagger.json
dev_*.py
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at nicolas@niconoe.eu. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
54 changes: 41 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

## Installation
To set up for local development:
```bash
$ git clone https://github.com/niconoe/pyinaturalist.git
$ cd pyinaturalist
$ pip install -Ue ".[dev]"
$ # Optional but recommended:
$ pre-commit install --config .github/pre-commit.yml
```

## Contribution Guidelines

### Documentation

We use [Sphinx](http://www.sphinx-doc.org/en/master/), and the references page is automatically
generated thanks to `sphinx.ext.autodoc` and `sphinx_autodoc_typehints` extensions. All
functions / methods / classes should have proper docstrings.

To build the docs locally:
```bash
$ tox -e docs
$ make -C docs html
```

To preview:
Expand All @@ -24,26 +33,45 @@ $ open docs/_build/index.html
$ xdg-open docs/_build/index.html
```

[Hosted documentation](https://pyinaturalist.readthedocs.io/) is automatically updated when code
gets pushed to the `master` branch.
Documentation is automatically built by ReadTheDocs whenever code is merged into either `master` or `dev`:
* [Stable release (master branch)](https://pyinaturalist.readthedocs.io/en/stable/)
* [Development pre-release (dev branch)](https://pyinaturalist.readthedocs.io/en/latest/)

For any new or changed behavior, add a brief high-level summary to `HISTORY.md`.
This isn't needed for internal changes (tests, other docs, refactoring, etc.).

### Tests

We use the [pytest](https://docs.pytest.org/en/latest/) framework for unit testing.

Just run the `pytest` command to run locally.

We also use [tox](https://tox.readthedocs.io/en/latest/) to test multiple python versions, as well as test coverage, style, and type checks:

Use the `tox` command to run locally. This is also run by Travis CI on all pull requests.
We also use [tox](https://tox.readthedocs.io/en/latest/) to test multiple python versions.
Use the `tox` command to run locally. This is also run by GitHub Actions on all pull requests.

### Type Annotations
All parameters and return values should have type annotations, which will be checked by `mypy` and
will show up in the documentation.

All functions / methods should have parameters and return value type annotations.
Those type annotations are checked by MyPy (`tox -e mypy`) and will appear in the documentation.
### Formatting, Linting, Type Checking, Etc.
Code checking and formatting tools used include:
* [black](https://github.com/psf/black)
* [isort](https://pycqa.github.io/isort/)
* [flake8](https://flake8.pycqa.org/en/latest/)
* [mypy](https://mypy.readthedocs.io/en/stable/getting_started.html)

All of these will be run by GitHub Actions on pull requests.

#### Pre-Commit Hooks
Optionally, there is included config to easily set these up to run as a
[pre-commit hook](https://github.com/pre-commit/pre-commit):
```bash
pre-commit install --config .github/pre-commit.yml
```

This can save you some time in that it will show you errors immediately rather than waiting for CI
jobs to complete. You can disable these hooks at any time with:
```bash
pre-commit uninstall
```

### Pull Requests
Here are some general guidelines for submitting a pull request:
Expand All @@ -56,7 +84,7 @@ Here are some general guidelines for submitting a pull request:
### Releases
For maintainers:

Releases are based on git tags. Travis CI will build and deploy packages to PyPi on tagged commits
Releases are based on git tags. GitHub Actions will build and deploy packages to PyPi on tagged commits
on the `master` branch. Release steps:

- Update the version in `pyinaturalist/__init__.py`
Expand Down Expand Up @@ -93,7 +121,7 @@ official pyinaturalist docs, in docstrings, or even on the web in blog posts,
articles, and such.

### Submit Feedback
The best way to send feedback is to file an issue at https://github.com/niconoe/pyinaturalist/issues.
The best way to send feedback is to [create an issue](https://github.com/niconoe/pyinaturalist/issues/new/choose)

If you are proposing a feature:

Expand Down
Loading

0 comments on commit 6624ca6

Please sign in to comment.