This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
python: | |
- "3.5" | |
- "3.6" | |
install: | |
- sudo apt-get update | |
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; | |
- bash miniconda.sh -b -p $HOME/miniconda | |
- export PATH="$HOME/miniconda/bin:$PATH" | |
- hash -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: envname | |
channels: | |
- defaults | |
- conda-forge | |
dependencies: | |
- python=3 | |
- pytest | |
- pytest-cov | |
- pytest-flake8 | |
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pytest | |
pytest-cov | |
pytest-flake8 | |
coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response_yes = ['yes', 'y'] | |
response_no = ['no', 'n'] | |
response_cancel = ['quit', 'q', 'exit', 'cancel'] | |
known_responses = response_yes + response_no + response_cancel | |
user_response = '' | |
while user_response.lower() not in known_responses: | |
user_response = input("Please input a value, or enter 'quit': ") | |
print(user_response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pytest] | |
addopts = --cov-report xml:cov.xml --cov-report term-missing --cov=mypackagename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import inspect | |
from skimage import exposure, feature, filters, measure, morphology, \ | |
restoration, segmentation, transform, util | |
def only_one_nondefault(args): | |
""" | |
Returns True if the function has only one non-keyword parameter, | |
False otherwise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To generate baseline images | |
py.test --mpl-generate-path=baseline | |
# To run pytest with the matplotlib plugin | |
py.test --mpl | |
# See full details here | |
# https://github.com/matplotlib/pytest-mpl |