Skip to content

Commit

Permalink
test flit (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilo59 committed Dec 11, 2018
1 parent 93e3ac8 commit 486513c
Show file tree
Hide file tree
Showing 20 changed files with 490 additions and 236 deletions.
26 changes: 15 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ var/
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot
Expand All @@ -59,8 +49,22 @@ target/

\.pytest_cache/v/cache/

# IDE stuff
\.vscode/

ignore/
# Static Analysis Artifacts
.wily/
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# misc
ignore/
mass_replace/\.pytest_cache/v/cache/
file_exts\.txt
\.vagrant/
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: check-ast
- id: check-yaml
- id: sort-simple-yaml
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
26 changes: 26 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pylint:
options:
bad-names: foo,baz,toto,tutu,tata
disable:
- line-too-long

pyflakes:
disable:
# let pylint used-before-assignment handle this
- F821
- F401

pep8:
options:
max-line-length: 100

mccabe:
options:
# max-complexity default = 10
max-complexity: 20

pyroma:
run: false

pep257:
run: false
26 changes: 14 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
os:
- linux
# - osx
language: python
cache: pip
python:
- "3.5"
- "3.6"
Expand All @@ -12,15 +10,19 @@ matrix:
dist: xenial
sudo: true
# command to install dependencies
install:
- pip install pipenv
- pipenv install --dev --deploy
install: "make"
# command to run tests
script:
- pwd
- ls
# - pytest -v # or py.test for Python versions 3.5 and below
- pytest -v --cov-report term --cov-report xml --cov=mass_replace tests/
- ls
- make test
after_success:
- coveralls
- coveralls
- make lint
- make check_format
deploy:
provider: pypi
user: $FLIT_USERNAME
password: $FLIT_PASSWORD
server: $FLIT_INDEX_URL
skip_existing: true
on:
branch: dev
43 changes: 21 additions & 22 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@

The MIT License (MIT)

Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)

Copyright (c) 2018 Gabriel Gore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.MD
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
init:
ifeq ($(TRAVIS), true)
pip install pipenv
pipenv install --dev
pip install .
touch tests/__init__.py
else
pipenv install --dev
pre-commit install
endif

test:
pytest -rpsf --cov-report term-missing --cov-report xml --cov=mass_replace tests/

lint:
ifeq ($(TRAVIS_PYTHON_VERSION), 2.7)
echo "Skip linting for Python2.7"
else
prospector --output-format grouped
endif

format:
black .

check_format:
ifeq ($(TRAVIS_PYTHON_VERSION), 3.7)
black . --check
else
echo "Only check format on Python3.7"
endif

pre:
pre-commit run --all-files
10 changes: 7 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ name = "pypi"
pyyaml = ">=3.13"

[dev-packages]
flit = "*"
black = {version = "==18.9b0",markers = "python_version >= '3.6'"}
flake8 = "*"
pre-commit = "*"
pytest = "*"
pytest-cov = "*"
coveralls = "*"
prospector = {extras = ["with_pyroma"],version = "*"}
# wily = {version = "*",markers = "python_version >= '3.7'"}

[requires]
python_version = "3.7"

[scripts]
format = "black mass_replace tests"
format = "black ."
reqs = "sh scripts/update_reqs.sh"
pre = "pre-commit run --all-files"
lint = "prospector --output-format grouped"
test = "pytest -rpsf --cov-report term-missing --cov=mass_replace tests/"

0 comments on commit 486513c

Please sign in to comment.