Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dog authored Apr 24, 2019
2 parents 0aa3391 + 222c029 commit 381ec6e
Show file tree
Hide file tree
Showing 378 changed files with 11,240 additions and 3,822 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @exercism/python
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exemptLabels:
- epic
- enhancement
- beginner friendly
- awaiting review
# Label to use when marking an issue as stale
staleLabel: abandoned
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
30 changes: 18 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
sudo: false

language: python

dist: xenial

python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7
- nightly

matrix:
include:
# Python 3.4 not supported in xenial
- python: 3.4
dist: trusty
- env: JOB=HOUSEKEEPING
install: ./bin/fetch-configlet
before_script: ./bin/check-readmes.sh
script:
# May provide more useful output than configlet fmt
# if JSON is not valid or items are incomplete
- ./bin/configlet lint .
# Verify correct formatting in config.json
- ./bin/configlet fmt . && git diff --quiet
allow_failures:
- python: nightly

install:
- pip install -r requirements-travis.txt

before_script:
- flake8
- ./bin/fetch-configlet
- ./bin/configlet lint .

script:

script:
- ./test/check-exercises.py
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please see the [contributing guide](https://github.com/exercism/docs/blob/master
## Working on the Exercises

We welcome both improvements to the existing exercises and new exercises.
A list of missing exercise can be found here: http://exercism.io/languages/python/todo
A list of missing exercise can be found here: https://github.com/exercism/python/issues/417#issuecomment-366040062


### Conventions
Expand All @@ -23,13 +23,14 @@ A list of missing exercise can be found here: http://exercism.io/languages/pytho
- We use `unittest` (Python Standard Library) and no 3rd-party-framework.
- We use the parameter order `self.assertEqual(actual, expected)` ([#440](https://github.com/exercism/python/issues/440)).
- We use context managers (`with self.assertRaises(\<exception type\>):`) for testing for exceptions ([#477](https://github.com/exercism/python/issues/477)).
- We use an established utility method to confirm that expected exceptions contain a non-empty message. This method must be included for any test class with an exception-based test case ([#1080](https://github.com/exercism/python/issues/1080#issuecomment-442068539)).
- We use `assertIs(actual, True)` and `assertIs(actual, False)` rather than `assertTrue(actual)` or `assertFalse(actual)` ([#419](https://github.com/exercism/python/pull/419)).
- We use a comment string in the test file to reference the version of the exercise's `canonical-data.json` that tests were adapted from (wording can be found in: [#784](https://github.com/exercism/python/issues/784)).


### Testing

All exercises must be compatible with Python versions 2.7 and 3.3 upwards.
All exercises must be compatible with Python versions 2.7 and 3.4 upwards.

To test a single exercise (e.g., with Python 2.7):
```
Expand Down Expand Up @@ -71,9 +72,5 @@ If you're interested, Tim Pope even has an [entire blog post](http://tbaggery.co

If you're new to Git, take a look at [this short guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md#git-basics).


## Python icon
The Python logo is an unregistered trademark. We are using a derived logo with the permission of the Python Software Foundation.

## License
This repository uses the [MIT License](/LICENSE).
22 changes: 22 additions & 0 deletions bin/check-readmes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

get_timestamp()
{
path="$1"
git log -n1 --pretty=format:%ct -- "$path"
}

ret=0
for exercise in $(ls -d exercises/*/); do
meta_dir="${exercise}.meta"
if [ -d "$meta_dir" ]; then
meta_timestamp="$(get_timestamp "$meta_dir")"
readme_timestamp="$(get_timestamp "${exercise}README.md")"
if [ "$meta_timestamp" -gt "$readme_timestamp" ]; then
ret=1
echo "$(basename "$exercise"): .meta/ contents newer than README. Please regenerate it with configlet."
fi
fi
done

exit $ret
Loading

0 comments on commit 381ec6e

Please sign in to comment.