Skip to content

Commit

Permalink
Merge pull request #93 from ucfopen/develop
Browse files Browse the repository at this point in the history
Release v0.7.0
  • Loading branch information
Thetwam authored Oct 4, 2017
2 parents f2faa18 + 8c84b21 commit db3c377
Show file tree
Hide file tree
Showing 58 changed files with 1,564 additions and 833 deletions.
27 changes: 16 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
*.egg-info
*.pyc
.coverage
*~
.DS_Store
build/
coverage.xml
dist/
htmlcov/
venv/
_build/
_static/
_templates/
_test.py
/*.egg-info
/.coverage
/.project
/.pyproject
/_build/
/_static/
/_templates/
/_test.py
/build/
/coverage.xml
/dist/
/docs/_build/
/env/
/htmlcov/
\#*#
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style "markdown-style.rb"
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ python:
install:
- pip install -r tests_requirements.txt
- pip install coveralls
- gem install mdl
script:
- coverage run -m unittest discover
- pycodestyle canvasapi tests
- pyflakes canvasapi tests
- flake8 canvasapi tests
- mdl *.md
after_success:
- coveralls
notifications:
Expand Down
14 changes: 11 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
Authors
=======

Development Lead
================
----------------

- Matthew Emond <me@ucf.edu> [@Thetwam](https://github.com/Thetwam)
- Jesse McBride <jm@ucf.edu> [@jessemcbride](https://github.com/jessemcbride)


Patches and Suggestions
=======================
-----------------------

- Adrian Goetz [@a-goetz](https://github.com/a-goetz)
- Alyssa Davis [@allygator](https://github.com/allygator)
- Anthony Rodriguez [@AnthonyRodriguez726](https://github.com/AnthonyRodriguez726)
- Ben Liblit [@liblit](https://github.com/liblit)
- Daniel Grobani [@dgrobani](https://github.com/dgrobani)
- Devin Singh [@devints47](https://github.com/devints47)
- Elise Heron [@thedarkestknight](https://github.com/thedarkestknight)
- Ian Turgeon [@iturgeon](https://github.com/iturgeon)
- [@jackrsteiner](https://github.com/jackrsteiner)
- John Raible [@rebelaide](https://github.com/rebelaide)
- Nathan Dabu [@nathaned](https://github.com/nathaned)
- Philip Carter [@phillyc](https://github.com/phillyc)
- Sigurður Baldursson [@sigurdurb](https://github.com/sigurdurb)
- Spencer Rogers [@spencer1248](https://github.com/spencer1248)
- Stephen Woosley [@stephenwoosley](https://github.com/stephenwoosley)
- Tuan Pham [@tuanvpham](https://github.com/tuanvpham)
- William Funk [@WilliamRADFunk](https://github.com/WilliamRADFunk)
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
# Change Log

## [0.7.0] - 2017-10-04

Thanks to all the contributors who helped with this release: [@stephenwoosley](https://github.com/stephenwoosley), [@jackrsteiner](https://github.com/jackrsteiner), and [@allygator](https://github.com/allygator). You guys are awesome!

Huge thanks to [@liblit](https://github.com/liblit) for lots of issues, suggestions, and pull requests. Couldn't have done all this without you!

### New Endpoint Coverage

- Upload file to a Submission Comment (`Submission.upload_comment()`)

### General

- Switched to `flake8` instead of just `pyflakes` and `pycodestyle`.
- Added markdown linter and fixed related issues.
- `DateTime` "Smart Objects" are now timezone aware.
- Keyword arguments now support lists and tuples. Can be nested in other lists and/or inside dictionaries. See issue [#55](https://github.com/ucfopen/canvasapi/issues/55) for details.
- `DateTime` objects passed as params now auto-format to ISO 8601 strings.
- Added table of contents to README.
- Updated "Getting Started" page in Documentation to match README.

### Bugfixes

- Fixed an issue where editing a page would report a missing ID.
- Fixed an issue where kwargs weren't passed along in `Course.get_pages()`.
- Fixed an issue where `Course.list_multiple_submissions()` would always set grouped to `True`. It now correctly always sets grouped to `False` by removing the param.
- Fixed several issues relating to `DiscussionTopic` methods returning incorrect types.
- Fixed an issue where reordering pinned topics had no valid values for the order param.

## [0.6.0] - 2017-08-15

### General

- Added support for SIS IDs to get accounts, courses, groups and sections. (Thanks for the suggestion, [@sigurdurb](https://github.com/sigurdurb)!)

## [0.5.1] - 2017-08-02

### General

- Moved documentation to [Read the Docs](http://canvasapi.readthedocs.io).

### Bugfixes

- Fixed an issue where kwargs in Python 2.7 wouldn't be properly formatted when converted to get parameters.

## [0.5.0] - 2017-07-10

### New Endpoint Coverage

- Files (Get file from Canvas, Course, Group, or User)
Expand All @@ -26,6 +59,7 @@
- Fixed an issue where non-ASCII characters in CanvasObject data would throw UnicodeEncodeError exceptions.

## [0.4.0] - 2017-06-16

### New Endpoint Coverage

- Analytics
Expand All @@ -47,6 +81,7 @@
- Updated CONTRIBUTING.md to more accurately reflect our dev process.

## [0.3.0] - 2017-03-30

### New Endpoint Coverage

- Appointment Groups
Expand All @@ -67,6 +102,7 @@
- Changed `assert` statements to use the assertion methods built into unittest.

## [0.2.0] - 2017-01-04

### New Endpoint Coverage

- Groups
Expand All @@ -82,14 +118,14 @@
- Nested dictionaries are now allowed as kwargs
- Split 401 into two exceptions: `InvalidAccessToken` if `'WWW-Authenticate'` header is present. Otherwise, `Unauthorized`.


### Bugfixes

- Moved some incorrectly placed enrollment methods to the Enrollment class.
- Corrected `Process` class to `Progress`
- Minor text fixes.

## [0.1.2] - 2016-07-22

### New Endpoint Coverage

- Getting a Group
Expand All @@ -111,6 +147,7 @@
- Fixed some incorrectly defined parameters
- Fixed an issue where tests would fail due to an improperly configured requires block

[0.7.0]: https://github.com/ucfopen/canvasapi/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/ucfopen/canvasapi/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/ucfopen/canvasapi/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/ucfopen/canvasapi/compare/v0.4.0...v0.5.0
Expand Down
54 changes: 33 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Thanks for your interest in contributing!

Below you'll find guidelines for contributing that will keep our codebase clean and happy.
Below you'll find guidelines for contributing that will keep our codebase clean and happy.

## Table of Contents

Expand All @@ -15,6 +15,7 @@ Below you'll find guidelines for contributing that will keep our codebase clean
* [API Coverage Tests](#api-coverage-tests)
* [Engine tests](#engine-tests)
* [Running tests / coverage reports](#running-tests-coverage-reports)
* [Making a Pull Request](#making-a-pull-request)
* [Code style guidelines](#code-style-guidelines)
* [Foolish consistency](#foolish-consistency)
* [Method docstrings](#method-docstrings)
Expand All @@ -32,7 +33,8 @@ Bug reports are awesome. Writing quality bug reports helps us identify issues an

Here are a few things worth mentioning when making a report:

* What **version** of CanvasAPI are you running? (Use `pip show canvasapi` -- we try to build frequently so "latest" isn't always accurate.)
* What **version** of CanvasAPI are you running? (`pip show canvasapi`)
* What **version** of Python are you using? (`python --version`)
* What steps can be taken to **reproduce the issue**?
* **Detail matters.** Try not to be too be verbose, but generally the more information, the better!

Expand All @@ -42,9 +44,13 @@ We welcome pull requests for bug fixes and new features! Feel free to browse our

* [simple](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Asimple) -- easier issues to start working on; great for getting familiar with the codebase.
* [api coverage](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Aapi-coverage) -- covering new endpoints or updating existing ones.
* [internal](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Ainternal) -- updates to the engine to improve performance.
* [enhancement](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Aenhancement) -- updates to the engine to improve performance or add new functionality.
* [major](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Amajor) -- difficult or major changes or additions that require familiarity with the library.
* [bug](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Abug) -- happy little code accidents.
* [fixed-in-develop](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Afixed-in-develop) -- issues that have been resolved but the changes are not in the latest release yet.
* [canvas-bug](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Acanvas-bug) -- confirmed to be an issue with the Canvas LMS rather than the CanvasAPI library.
* [help wanted](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3A"help%20wanted") -- we need *your* help to figure these out!
* [documentation](https://github.com/ucfopen/canvasapi/issues?q=sort%3Aid_desc-desc+is%3Aopen+label%3Adocumentation) -- issues relating to Documentation. Specifically, any of the `.md` files or our [class reference docs](http://canvasapi.readthedocs.io/en/latest/).

Once you've found an issue you're interested in tackling, take a look at our [first contribution tutorial](#making-your-first-contribution) for information on our pull request policy.

Expand All @@ -55,8 +61,8 @@ Once you've found an issue you're interested in tackling, take a look at our [fi
Now that you've selected an issue to work on, you'll need to set up an environment for writing code. We'll assume you already have pip, virtualenv, and git installed and are using a terminal. If not, please set those up before continuing.

1. Clone our repository by executing `git clone git@github.com:ucfopen/canvasapi.git`
2. Pull the latest commit from the **master** branch: `git pull origin master`
3. Create a new branch with the format **issue/[issue_number]-[issue-title]**: `git branch -b issue/1-test-issue-for-documentation`
2. Pull the latest commit from the **develop** branch: `git pull origin develop`
3. Create a new branch with the format **issue/[issue_number]-[issue-title]**: `git checkout -b issue/1-test-issue-for-documentation`
4. Set up a new virtual environment ( `virtualenv env` ) and activate it (`source env/bin/activate`)
5. Install the required dependencies with `pip install -r dev_requirements.txt`

Expand Down Expand Up @@ -131,13 +137,15 @@ user = self.course.get_user(1)
self.assertIsInstance(user, User)
self.assertTrue(hasattr(user, 'name'))
```

The rest is basic unit testing. Call the function to be tested, and assert various outcomes. If necessary, multiple tests can written for a single method. All related tests should appear together under the same comment, as described earlier.

---

It is common to need certain object(s) for multiple tests. For example, most methods in `test_course.py` require a `Course` object. In this case, save a course to the class in `self.course` for later use.

Do this in the `setUp` class method:

```python
with requests_mock.Mocker() as m:
requires = {
Expand Down Expand Up @@ -171,7 +179,7 @@ You'll do this by running `coverage run -m unittest discover` from the main `can

Coverage reports tell us how much of our code is actually being tested. As of right now, we're happily maintaining 100% code coverage (🎉!) and our goal is to keep it there. Ensure you've covered your changes entirely by running `coverage report`. Your output should look something like this:

```
```Formatted
Name Stmts Miss Cover
----------------------------------------------------
canvasapi/__init__.py 3 0 100%
Expand All @@ -188,8 +196,9 @@ TOTAL 1586 0 100%

Certain statements can be omitted from the coverage report by adding `# pragma: no cover` but this should be used conservatively. If your tests pass and your coverage is at 100%, you're ready to [submit a pull request](https://github.com/ucfopen/canvasapi/pulls)!

Be sure to include the issue number in the title with a pound sign in front of it (#123) so we know which issue the code is addressing. Point the branch at `develop` and then submit it for review.
#### Making a Pull Request

Be sure to include the issue number in the title with a pound sign in front of it (#123) so we know which issue the code is addressing. Point the branch at `develop` and then submit it for review.

## Code Style Guidelines

Expand All @@ -198,14 +207,10 @@ We try to adhere to Python's [PEP 8](https://www.python.org/dev/peps/pep-0008/)
* We use four spaces for indentation.
* Lines should be around 80 characters long, but up to 99 is allowed. Once you get into the 85+ territory, consider breaking your code into separate lines.

We use `pycodestyle` and `pyflakes` for linting:
We use `flake8` for linting:

```
pycodestyle canvasapi tests
```

```
pyflakes canvasapi tests
```sh
flake8 canvasapi tests
```

### Foolish consistency
Expand All @@ -217,35 +222,41 @@ An important tenet of PEP8 is to not get hung up on PEP8. While we try to be as
Below you'll find several established styles that'll help you along the way.

### Method docstrings

Method docstrings should include a description, a link to the related API endpoint (if available), parameter name, parameter description, and parameter type, return description (if available), and return type. They should be included in the following order:

#### Descriptions
A description should be a concise, *action* statement (use "*write* a good docstring" over "*writes* a good docstring") that describes the method. Generally, the official API documentation's description is usable (make sure it's an **action statement** though). Special functionality should be documented.

A description should be a concise, *action* statement (use "*write* a good docstring" over "*writes* a good docstring") that describes the method. Generally, the official API documentation's description is usable (make sure it's an **action statement** though). Special functionality should be documented.

#### Links to related API endpoints

A link to a related API endpoint is denoted with `:calls:`. CanvasAPI uses Sphinx to automatically generate documentation, so we can provide a link to an API endpoint with the reStructuredText syntax:

```
:calls: `THE TEXT OF THE HYPERLINK \
```rst
:calls: `THE TEXT OF THE HYPERLINK \
<https://the.url/to/use/>`_
```

Hyperlink text should match the text underneath the endpoint in the official Canvas API documentation. Generally, that looks like this:

```
```rst
:calls: `HTTP_METHOD /api/v1/endpoint/:variable
```

**Note**: It's okay to go over 80 characters for the URL, it can't be helped. Use a backslash to split the hyperlink text from the actual URL to limit line length.

#### Parameters

Parameters should be listed in the order that they appear in the method prototype. They should take on the following form:
```

```rst
:param PARAMETER_NAME: PARAMETER_DESCRIPTION.
:type PARAMETER_NAME: PYTHON_TYPE
```

#### Returns

**Return description** should be listed first, if available. This should be included to clarify a returned value, for example:

```python
Expand All @@ -262,17 +273,18 @@ In most cases, the return value is easy to infer based on the type and the descr

**Return type** should always be included when a value is returned. If it's not a primitive type (`int`, `str`, `bool`, `list`, etc.) a fully-qualified class name should be included:

```
```rst
:rtype: :class:`canvasapi.user.User`
```

In the event a PaginatedList is returned:

```
```rst
:rtype: :class:`canvasapi.paginated_list.PaginatedList` of :class:`canvasapi.user.User`
```

#### Docstring Examples

Here are some real world examples of how docstrings should be formatted:

```python
Expand Down
4 changes: 1 addition & 3 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ Update version number in `__init__.py`.

Run `python setup.py sdist`. This should create a file in the `dist` directory called something like `canvasapi-0.0.0.tar.gz`.


Generate Documentation
----------------------

Documentation should now be automatically pushed to readthedocs.


Deploy
------

Expand All @@ -37,4 +35,4 @@ Push the tag: `git push origin v0.0.0`

Run `twine upload dist/canvasapi-0.0.0.tar.gz` to upload to PyPI.

Create release on GitHub for the new tag. Use the text from the changelog for content.
Create release on GitHub for the new tag. Use the text from the changelog for content.
Loading

0 comments on commit db3c377

Please sign in to comment.