Skip to content

Commit

Permalink
Merge 8d96362 into 4ba69eb
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisfennerpaypay committed Oct 8, 2021
2 parents 4ba69eb + 8d96362 commit a3aca25
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 16 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/build-ci.yml
Expand Up @@ -18,35 +18,52 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: register repo token
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
echo repo_token: ${COVERALLS_REPO_TOKEN} > ./.coveralls.yml

- name: Install dependencies
run: pip install -e ".[test]"

- name: Install CI dependencies
run: |
pip install pytest
pip install responses
pip install pytest-cov
pip install coveralls
pip install requests
pip install pyjwt
- name: Before script
run: |
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
- name: test script
run: pytest --cov=tests/ --cov-report xml

# Run snyk test and use snyk-to-html to upload an artifact.
- name: Install snyk
run: npm install snyk

- name: Install snyk-to-html
run: npm install snyk-to-html

- name: snyk -v
run: ./node_modules/.bin/snyk -v
- name: snyk auth
run: ./node_modules/.bin/snyk auth ${{ secrets.SNYK_TOKEN }}
- name: snyk test
run: ./node_modules/.bin/snyk test --json --file=setup.py > snyk-test-results.json
- name: Generate snyk HTML results
if: always()
run: ./node_modules/.bin/snyk-to-html -d -i snyk-test-results.json -o snyk-test-results.html
- name: Upload snyk-test-results artifact
uses: actions/upload-artifact@v2
if: always()
with:
name: snyk-results
path: snyk-test-results.html

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github

- name: Upload to CoPilot
run: bash <(curl -s https://copilot.blackducksoftware.com/ci/githubactions/scripts/upload)

- name: After build
run: ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code 0
run: ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code 0
22 changes: 18 additions & 4 deletions setup.py
@@ -1,15 +1,26 @@
from setuptools import setup

from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

def fetch_long_description():
"""
Loads the `long_description` from README.md.
If `README.md` does not exist, returns a placeholder `long_description`.
This is necessary when setup.py is analyzed by a tool like `snyk test`.
"""
this_directory = path.abspath(path.dirname(__file__))
try:
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as readme_file:
return readme_file.read()
except FileNotFoundError:
return 'See https://github.com/paypay/paypayopa-sdk-python'

setup(
name="paypayopa",
version="0.0.0",
description="PayPay OPA SDK",
long_description=long_description,
long_description=fetch_long_description(),
long_description_content_type='text/markdown',
author="Team PayPay",
author_email="opensource@paypay-corp.co.jp",
Expand All @@ -19,6 +30,9 @@
'Source': 'https://github.com/paypay/paypayopa-sdk-python',
},
install_requires=["requests", "pyjwt"],
extras_require={
'test': ['responses'],
},
include_package_data=True,
package_dir={'paypayopa': 'paypayopa',
'paypayopa.resources': 'paypayopa/resources',
Expand Down

0 comments on commit a3aca25

Please sign in to comment.