Skip to content

Commit

Permalink
Merge pull request #38 from niconoe/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook authored Jun 16, 2020
2 parents 71a297f + 8623120 commit 91d3531
Show file tree
Hide file tree
Showing 44 changed files with 6,181 additions and 1,709 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
test-reports/

# Translations
*.mo
Expand All @@ -39,10 +40,13 @@ output/*.html
output/*/index.html

# Sphinx
docs/_build
docs/_build/
docs/docs/
docs/modules/

# Mac OS X
.DS_Store

.idea
.mypy_cache
.mypy_cache
venv/
42 changes: 34 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,39 @@ matrix:
- python: "3.5"
- python: "3.6"
- python: "3.7"
- python: "3.8-dev"
env: TOXENV=py38
# Run a separate job for combined code quality checks & build tests
- python: "3.8"
env: TOXENV=coverage,mypy,style,docs,dist-test
# Only this job will contain an encrypted PYPI_TOKEN for deployment
- python: "3.8"
env:
- secure: QFRSBbtAPfFxO2GONfI2KCrq7gdSI6zj4wI5QEunjz8xVjvb60TD2Q4ULmoMPBqgFkqV6NZr6bB49MpNcpfw9aeBkUqjYmWWkLfZZsFWvJeRnkPV4EcfmMKJ9pph9QUYQ1BUcqWPZbPYk0VQdDxMVwDKETW2nzVNgRFaJm4O9kM6qV462/3dN53Q0NNTBfSju80nV8YQycP7onEQQILFityDOThKqR3FctDiwrfMo3ALWSfghkyvCgvrvpf6uAWncM1hwDwga+1Luo3vDG6reDE+M3AitFwo5XsPXy8hER8BwuUh8MRrr/HbakH66e83vvBX593DoGZr7UMqwEg+Xzpa2yUvSszW2U9ksh9BaYPbZG3nzsJJlTg61k6Sh7OU4AXglsDBPVX5aoLVz6XSAL97p+Ec85yo8dzpxzBc31ow8rI6JS9yycRnHXGATKqTIQ7Z3QiVaNKrIJVKhMdqvng1zb8RFR49MbPFT5QQuxOJLe/S1qkzOjclp2scZV17TPa6hkfTuDz01+rPXKh3US0WbR689TtNCBB/UwuoX5vnFqcvmqi0sZtl0G4eqXPvik4r7JnuX3d81LIGzF6e45FyO8sSvicZxCu8KmQQ7xI0hXjP6+vfEOnnz4xpAKmHmf2xTIStpuaCm7xqdt3M070P/A4kC0xBGcbcNCq1xU4=

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- pip install tox-travis
# Install dependencies, run tests, and run coveralls after 'coverage' job
install: pip install ".[build]"
script: tox
after_success: if [[ $TOXENV == *"coverage"* ]]; then coveralls; fi

# command to run tests, e.g. python setup.py test
script:
- tox
# Note: These two release types could be combined, but requires a long, ugly custom condition
# See: https://docs.travis-ci.com/user/deployment#conditional-releases-with-on
deploy:
# Stable releases: only git tags on master branch
- provider: pypi
user: __token__
password: $PYPI_TOKEN
distributions: sdist bdist_wheel
skip_cleanup: true # Don't delete build artifacts
skip_existing: true # Don't overwrite an existing package with the same name
on:
tags: true
condition: $PYPI_TOKEN # Only run in the job containing an encrypted PYPI_TOKEN
# Pre-releases: dev branch only; pre-release version number is set in __init__.py
- provider: pypi
user: __token__
password: $PYPI_TOKEN
distributions: sdist bdist_wheel
skip_cleanup: true
skip_existing: true
on:
branch: dev
condition: $PYPI_TOKEN
74 changes: 72 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,80 @@ Contributing
Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

You can contribute in many ways:
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 a
proper docstrings.

To build the docs locally::

$ tox -e docs

To preview::

# MacOS:
$ open docs/_build/index.html
# Linux:
$ xdg-open docs/_build/index.html

`Hosted documentation <https://pyinaturalist.readthedocs.io/>`_ is automatically updated when code gets pushed to
the ``master`` branch.

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

Testing
~~~~~~~

We use the `pytest framework <https://docs.pytest.org/en/latest/>`_.

To run locally::

$ pytest

It is however always good to run ``tox`` frequently, to run the tests against multiple Python versions, as well as some
style and type annotations checks::

$ tox

Travis CI will run tests, coverage, black, and mypy when code is pushed to GitHub.

Type Annotations
~~~~~~~~~~~~~~~~

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.

Pull Requests
~~~~~~~~~~~~~
Here are some general guidelines for submitting a pull request:

- If the changes are trivial, just briefly explain the changes in the PR description.
- Otherwise, please submit an issue describing the proposed change prior to submitting a PR.
- Make sure the code is tested, annotated and documented as described above.
- Submit the PR to be merged into the ``dev`` branch.

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

- Update the version in ``pyinaturalist/__init__.py``
- Update the release notes in ``HISTORY.rst``
- Merge changes into the ``master`` branch
- Push a new tag, e.g.: ``git tag v0.1 && git push origin --tags``
- This will trigger a deployment. Verify that this completes successfully and that the new version
can be installed from pypi with ``pip install``


Types of Contributions
----------------------
You can contribute in many ways:

Report Bugs
~~~~~~~~~~~
Expand Down Expand Up @@ -50,4 +120,4 @@ If you are proposing a feature:
* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)
are welcome :)
31 changes: 20 additions & 11 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,51 +1,60 @@
.. :changelog:

History
-------

0.10.0 (2020-06-16)
^^^^^^^^^^^^^^^^^^^

* Added more info & examples to README for taxa endpoints, and other documentation improvements
* Added `minify` option to `node_api.get_taxa_autocomplete()`
* Added conversion for all date and datetime parameters to timezone-aware ISO 8601 timestamps
* Added a dry-run mode to mock out API requests for testing
* Added 6 additional observation response formats, including GeoJSON, Darwin Core, and others
* Set up pre-release builds for latest development version

0.9.1 (2020-05-26)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* Bugfix: proper support for boolean and integer list parameters (see https://github.com/niconoe/pyinaturalist/issues/17). Thanks Jordan Cook!

0.9.0 (2020-05-06)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* new taxa-related functions: node_api.get_taxa(), node_api.get_taxa_autocomplete(), node_api.get_taxa_by_id(). Many thanks to Jordan Cook!

0.8.0 (2019-07-11)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* all functions now take an optional `user-agent <https://en.wikipedia.org/wiki/User_agent>`_ parameter in order to identify yourself to iNaturalist. If not set, `Pyinaturalist/<VERSION>` will be used.

0.7.0 (2019-05-08)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* rest_api.delete_observation() now raises ObservationNotFound if the observation doesn't exists
* minor dependencies update for security reasons

0.6.0 (2018-11-15)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* New function: rest_api.delete_observation()

0.5.0 (2018-11-05)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* New function: node_api.get_observation()

0.4.0 (2018-11-05)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* create_observation() now raises exceptions in case of errors.

0.3.0 (2018-11-05)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* update_observation() now raises exceptions in case of errors.

0.2.0 (2018-10-31)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* Better infrastructure (type annotations, documentation, ...)
* Dropped support for Python 2.
Expand All @@ -54,6 +63,6 @@ History


0.1.0 (2018-10-10)
++++++++++++++++++
^^^^^^^^^^^^^^^^^^

* First release on PyPI.
56 changes: 0 additions & 56 deletions Makefile

This file was deleted.

Loading

0 comments on commit 91d3531

Please sign in to comment.