-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from adambullmer/pipenv
Convert to pipenv
- Loading branch information
Showing
13 changed files
with
654 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
defaults: &defaults | ||
working_directory: ~/sublime_ansible_vault | ||
docker: | ||
- image: circleci/python:3.4 | ||
|
||
version: 2 | ||
jobs: | ||
test: | ||
<< : *defaults | ||
steps: | ||
- checkout | ||
- run: | ||
name: install pipenv | ||
command: pip install pipenv | ||
- run: | ||
name: install dependencies | ||
command: | | ||
pipenv install | ||
pipenv install --dev | ||
- run: | ||
name: run tests | ||
command: pipenv run tox | ||
- store_artifacts: | ||
path: pytest | ||
- store_test_results: | ||
path: pytest | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[run] | ||
omit = | ||
*/__main__.py | ||
tests/* | ||
__init__.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ nosetests.xml | |
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
pytest/ | ||
|
||
# Translations | ||
*.mo | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.4.3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
tox = "*" | ||
flake8 = "*" | ||
pytest = "*" | ||
pytest-cov = "*" | ||
pytest-sugar = "*" | ||
pydocstyle = "*" | ||
codecov = "*" | ||
|
||
[packages] | ||
ansible = "==2.2.3" | ||
|
||
[requires] | ||
python_version = "3.4" |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from unittest.mock import MagicMock, patch | ||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def sublime(request): | ||
mock = MagicMock() | ||
patcher = patch.dict('sys.modules', { | ||
'sublime': mock, | ||
}) | ||
patcher.start() | ||
request.addfinalizer(patcher.stop) | ||
|
||
return mock | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def sublime_plugin(request): | ||
mock = MagicMock() | ||
patcher = patch.dict('sys.modules', { | ||
'sublime_plugin': mock, | ||
}) | ||
patcher.start() | ||
request.addfinalizer(patcher.stop) | ||
|
||
return mock | ||
|
||
|
||
@pytest.fixture() | ||
def root_commands(): | ||
from .. import commands | ||
return commands |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def test_exists(root_commands): | ||
assert root_commands |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,51 @@ | ||
[tox] | ||
envlist = style | ||
skipsdist = True | ||
|
||
[testenv] | ||
install_command = | ||
pipenv install --ignore-pipfile && \ | ||
pipenv install --dev --ignore-pipfile && \ | ||
pipenv --dev -r {packages} | ||
list_dependencies_command = pipenv lock -r | ||
whitelist_externals = | ||
pipenv | ||
rm | ||
mkdir | ||
setenv = | ||
PYTHONPATH = {toxinidir} | ||
PIPENV_DOTENV_LOCATION = {toxinidir}/tests/.env | ||
CODECOV_ENV = | ||
passenv = TOXENV CI CODECOV_TOKEN CODECOV_ENV | ||
|
||
[testenv:test] | ||
commands = | ||
rm -rf pytest | ||
mkdir -p pytest/coverage | ||
pipenv run py.test | ||
pipenv run codecov -e TOXENV | ||
|
||
[testenv:style] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 --output-file={envdir}/flake8.txt {toxinidir}/commands.py | ||
pipenv run flake8 {toxinidir}/commands.py | ||
pipenv run pydocstyle | ||
|
||
[pytest] | ||
testpaths = tests | ||
addopts = | ||
-v | ||
--cov . | ||
--cov-config .coveragerc | ||
--cov-report term-missing | ||
--cov-report html:pytest/coverage | ||
--junitxml pytest/junit.xml | ||
|
||
[flake8] | ||
max-line-length = 120 | ||
max-complexity = 10 | ||
tee = True | ||
count = True | ||
statistics = True | ||
tee = true | ||
count = true | ||
show-statistics = true | ||
show-source = True | ||
|
||
[pydocstyle] | ||
match = '(?!test_).*\.py|(?!conftest\.py)' |