From 4628bc6164be900c98b4026d20ea3fce35c6caa2 Mon Sep 17 00:00:00 2001 From: Kyle Hornberg Date: Sat, 13 Apr 2019 15:27:10 -0500 Subject: [PATCH 1/4] Peripheral: Remove travis --- .travis.yml | 71 ----------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 98510c3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -language: python -dist: xenial -python: - - '3.6' -sudo: false -cache: pip -env: - global: - - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - - SEGFAULT_SIGNALS=all - matrix: - - TOXENV=check - - TOXENV=docs -matrix: - include: - - python: '3.7' - env: - - TOXENV=py37 - - python: '3.6' - env: - - TOXENV=py36 - - python: '3.5' - env: - - TOXENV=py35 -before_install: - - python --version - - uname -a - - lsb_release -a -install: - - pip install tox - - virtualenv --version - - easy_install --version - - pip --version - - tox --version -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build -script: - - tox -v -after_script: - - ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $TRAVIS_TEST_RESULT -after_failure: - - more .tox/log/* | cat - - more .tox/*/log/* | cat -before_deploy: - - git config --local user.name "Kyle Hornberg" - - git config --local user.email "khornberg@users.noreply.github.com" - - if [ ! -f .git/refs/tags/$(python ./setup.py --version) ]; then git tag $(python ./setup.py --version); fi - - echo $(git tag -l) - - pip install twine -deploy: - - provider: releases - api_key: $KEY - file_glob: true - file: dist/** - skip_cleanup: true - on: - branch: master - condition: '$TRAVIS_TAG != $(python ./setup.py--version)' - condition: '$TOXENV = py36' - - provider: script - script: scripts/pypi.sh - on: - branch: master - condition: '$TRAVIS_TAG != $(python ./setup.py--version)' - condition: '$TOXENV = py36' -notifications: - email: - on_success: never - on_failure: never From 199fdcc4b233a8097da18fa4f6976d9d9b8a50be Mon Sep 17 00:00:00 2001 From: Kyle Hornberg Date: Mon, 15 Apr 2019 07:17:37 -0500 Subject: [PATCH 2/4] Peripheral: Combine workflows --- .github/main.workflow | 63 +++++++++++++++++++++++++++++++++++++++++-- MANIFEST.in | 2 +- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index a60cb60..b20c89d 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -5,7 +5,7 @@ workflow "Publish to PyPi" { ] } -action "action-filter" { +action "Master Workflow" { uses = "actions/bin/filter@master" args = "branch master" } @@ -13,7 +13,7 @@ action "action-filter" { action "Package" { uses = "khornberg/python-actions/setup-py/3.7@master" args = "bdist_wheel sdist" - needs = ["action-filter"] + needs = ["Master Workflow"] } action "PyPi Twine Upload" { @@ -22,3 +22,62 @@ action "PyPi Twine Upload" { args = "upload dist/*" secrets = ["TWINE_USERNAME", "TWINE_PASSWORD"] } + +# PR workflow + +workflow "Test" { + on = "push" + resolves = [ + "Report", "Lint", "Docs" + ] +} + +action "Filter" { + uses = "actions/bin/filter@master" + args = "not branch master" +} + +action "Curl" { + uses = "actions/bin/curl@master" + args = "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter" + needs = ["Filter"] +} + +action "Prepare" { + uses = "actions/bin/sh@master" + args = ["chmod +x ./cc-test-reporter && ./cc-test-reporter before-build"] + secrets = ["CC_TEST_REPORTER_ID"] + needs = ["Curl"] +} + +action "Requirements 3.6" { + uses = "jefftriplett/python-actions@master" + args = "pip install tox" + needs = ["Prepare"] +} + +action "Test 3.6" { + uses = "jefftriplett/python-actions@master" + args = "tox -e py36 -v" + needs = ["Requirements 3.6"] +} + +action "Lint" { + uses = "jefftriplett/python-actions@master" + args = "tox -e check -v" + needs = ["Requirements 3.6"] +} + +action "Docs" { + uses = "jefftriplett/python-actions@master" + args = "tox -e docs -v" + needs = ["Requirements 3.6"] +} + +action "Report" { + uses = "actions/bin/sh@master" + args = ["apt-get update && apt-get install git-core -y && ./cc-test-reporter after-build --coverage-input-type coverage.py"] + needs = ["Test 3.6"] + secrets = ["CC_TEST_REPORTER_ID"] +} + diff --git a/MANIFEST.in b/MANIFEST.in index 29b2564..d135714 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -21,4 +21,4 @@ include .pyup.yml include *.json include *.sh -global-exclude *.py[cod] __pycache__ *.so *.dylib +global-exclude *.py[cod] __pycache__ *.so *.dylib .github .github/* From daa1b25129d6bfc960c33a1810f59c1a6e292b0f Mon Sep 17 00:00:00 2001 From: Kyle Hornberg Date: Mon, 15 Apr 2019 12:40:46 -0500 Subject: [PATCH 3/4] Limit yapf --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b878b1b..3ec896f 100644 --- a/tox.ini +++ b/tox.ini @@ -61,7 +61,7 @@ deps = readme-renderer pygments isort - yapf + yapf<0.20 skip_install = true commands = python setup.py check --strict --metadata --restructuredtext From be189533747ac92a99efe82b7c5cb36e16c61bce Mon Sep 17 00:00:00 2001 From: Kyle Hornberg Date: Mon, 15 Apr 2019 15:11:17 -0500 Subject: [PATCH 4/4] Fix style --- tests/test_auth.py | 2 +- tests/test_methods.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 39c6dea..0dc4d6f 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -142,7 +142,7 @@ class TestAuth(object): 'https://api.github.com/users/octokit/followers', headers={ 'Content-Type': 'application/json', - 'accept': 'application/vnd.github.v3+json' + 'accept': 'application/vnd.github.v3+json', }, params={ 'page': 1, diff --git a/tests/test_methods.py b/tests/test_methods.py index 3fc8463..5d21480 100644 --- a/tests/test_methods.py +++ b/tests/test_methods.py @@ -233,7 +233,9 @@ class TestClientMethods(object): mocker.patch('requests.get') headers = {'accept': 'application/vnd.github.ant-man-preview+json', 'Content-Type': 'application/json'} Octokit().oauth_authorizations.get_authorization( - authorization_id=100, headers={'accept': 'application/vnd.github.ant-man-preview+json'} + authorization_id=100, headers={ + 'accept': 'application/vnd.github.ant-man-preview+json' + } ) requests.get.assert_called_once_with('https://api.github.com/authorizations/100', params={}, headers=headers)