Skip to content

Commit f2a5096

Browse files
committedJan 21, 2021
chore: migrate to travis
1 parent f5fa00f commit f2a5096

File tree

14 files changed

+776
-570
lines changed

14 files changed

+776
-570
lines changed
 

‎.gitignore

+70-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,75 @@
1+
# IDE OS
12
.DS_Store
2-
*.pyc
3-
__pycache__
4-
dist
5-
build
6-
docs/build
7-
docs/source/reference/services
8-
tests/cover
9-
tests/.coverage
10-
*.egg-info
11-
.env
3+
.idea
4+
.project
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# Distribution / packaging
12+
.Python
13+
env/
14+
build/
15+
develop-eggs/
16+
dist/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
1233

13-
# Test state / virtualenvs
14-
.tox
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
1541
.coverage
16-
coverage.xml
42+
.coverage.*
43+
.cache
1744
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
48+
.vscode
49+
50+
# virtual env
51+
venv/
52+
# python 3 virtual env
53+
python3/
54+
55+
*.env
56+
.env
57+
58+
# resources
59+
resources/output.wav
60+
61+
docs/_build/
62+
deploy.sh
63+
docs/apis
64+
docs/gh-pages
65+
test/__init__.py
66+
*~
67+
68+
.sfdx/tools/apex.db
69+
.pytest_cache/
1870

19-
# Common virtualenv names
20-
venv
21-
env
22-
env1
23-
env2
24-
env3
71+
# openapi-sdkgen
72+
.openapi-generator/
73+
.openapi-generator-ignore
74+
/.pydevproject
75+
/.settings/

‎.pylintrc

+576
Large diffs are not rendered by default.

‎.releaserc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"debug": true,
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/exec",
9+
{
10+
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
11+
}
12+
],
13+
[
14+
"@semantic-release/git",
15+
{
16+
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
17+
}
18+
],
19+
"@semantic-release/github"
20+
]
21+
}

‎.travis.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
language: python
2+
3+
matrix:
4+
include:
5+
- python: 3.5
6+
- python: 3.6
7+
- python: 3.7
8+
- python: 3.8
9+
10+
dist: xenial
11+
12+
cache: pip
13+
14+
before_install:
15+
- npm install npm@latest -g
16+
- sudo apt-get update
17+
- sudo apt-get install pandoc
18+
- pip install pypandoc
19+
20+
install:
21+
- pip install tox-travis
22+
23+
# before_script:
24+
# - 'openssl aes-256-cbc -K $ghost_key -iv $ghost_iv -in .ghostenv.enc -out .ghostenv -d || true'
25+
26+
script:
27+
- tox
28+
29+
before_deploy:
30+
- pip install bump2version
31+
- nvm install 12
32+
- npm install @semantic-release/changelog
33+
- npm install @semantic-release/exec
34+
- npm install @semantic-release/git
35+
- npm install @semantic-release/github
36+
37+
38+
deploy:
39+
- provider: script
40+
script: npx semantic-release
41+
skip_cleanup: true
42+
on:
43+
python: '3.5'
44+
branch: master
45+
46+
# - provider: pypi
47+
# user: $PYPI_USER
48+
# password: $PYPI_PASSWORD
49+
# repository: https://upload.pypi.org/legacy
50+
# skip_cleanup: true
51+
# on:
52+
# python: '3.5'
53+
# tags: true

‎MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include requirements.txt
2+
include requirements-dev.txt
3+
include LICENSE

‎Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This makefile is used to make it easier to get the project set up
2+
# to be ready for development work in the local sandbox.
3+
# example: "make setup"
4+
5+
setup: deps dev_deps install_project
6+
7+
all: setup test-unit lint
8+
9+
deps:
10+
python -m pip install -r requirements.txt
11+
12+
dev_deps:
13+
python -m pip install -r requirements-dev.txt
14+
15+
install_project:
16+
python -m pip install -e .
17+
18+
test: test-unit test-int
19+
20+
test-unit:
21+
python -m pytest ibm-whcs-sdk/annotator-for-clinical-data/tests/unit
22+
python -m pytest ibm-whcs-sdk/insights-for-medical-literature/tests/unit
23+
24+
test-int:
25+
python -m pytest ibm-whcs-sdk/annotator-for-clinical-data/tests/integration
26+
python -m pytest ibm-whcs-sdk/insights-for-medical-literature/tests/integration
27+
28+
lint:
29+
./pylint.sh

‎ibm_whcs_sdk/annotator_for_clinical_data/build/pylintrc

-31
This file was deleted.

‎ibm_whcs_sdk/annotator_for_clinical_data/tests/integration/test_acd_flows_apis.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
version=VERSION
3434
)
3535
ACD.set_service_url(BASE_URL)
36+
ACD.set_disable_ssl_verification(DISABLE_SSL)
3637

3738
def test_get_flows():
3839
response = ACD.get_flows()

‎pylint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
pylint ibm-whcs-sdk test

‎requirements-dev.txt

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# test dependencies
2-
pytest>=2.8.2
3-
responses>=0.9.0
2+
jproperties
3+
pytest>=5.0
4+
responses>=0.10
45
pylint>=1.4.4
56
tox>=2.9.1
67
pytest-rerunfailures>=3.1
78

89
# code coverage
910
coverage<5
10-
codecov>=1.6.3
11-
pytest-cov>=2.2.1
12-
13-
# semantic
14-
bumpversion>=0.5.3
11+
codecov>=1.6.3,<3.0.0
12+
pytest-cov>=2.2.1,<3.0.0
1513

1614
# documentation
1715
recommonmark>=0.2.0
18-
Sphinx>=1.3.1
16+
Sphinx>=1.3.1

‎requirements.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
jproperties
2-
requests>=2.0,<3.0
3-
python_dateutil>=2.5.3
4-
websocket_client>=0.48.0
5-
ibm_cloud_sdk_core>=1.7.1
1+
requests>=2.20,<3.0
2+
python_dateutil>=2.5.3,<3.0.0
3+
ibm_cloud_sdk_core>=3.3.1,<4.0.0

‎setup.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
PACKAGE_NAME = 'ibm_whcs_sdk'
2525
PACKAGE_DESC = 'This is the Watson Health Cognitive Services Python SDK containing ACD and IML',
2626

27-
#with open('requirements.txt') as f:
28-
# install_requires = [str(req) for req in pkg_resources.parse_requirements(f)]
29-
#with open('requirements-dev.txt') as f:
30-
# tests_require = [str(req) for req in pkg_resources.parse_requirements(f)]
27+
with open('requirements.txt') as f:
28+
install_requires = [str(req) for req in pkg_resources.parse_requirements(f)]
29+
with open('requirements-dev.txt') as f:
30+
tests_require = [str(req) for req in pkg_resources.parse_requirements(f)]
3131

3232
if sys.argv[-1] == 'publish':
3333
# test server
@@ -66,8 +66,8 @@ def finalize_options(self):
6666
version=__version__,
6767
description=PACKAGE_DESC,
6868
license='Apache 2.0',
69-
install_requires=['requests>=2.0,<3.0', 'python_dateutil>=2.5.3', 'websocket_client>=0.48.0', 'ibm_cloud_sdk_core>=1.7.1'],
70-
tests_require=['pytest', 'responses', 'pylint', 'tox', 'coverage', 'codecov', 'pytest-cov', 'bumpversion'],
69+
install_requires=install_requires,
70+
tests_require=tests_requires,
7171
cmdclass={'test': PyTest, 'test_unit': PyTestUnit, 'test_integration': PyTestIntegration},
7272
author='IBM',
7373
author_email='dcweber@us.ibm.com',
@@ -89,8 +89,7 @@ def finalize_options(self):
8989
'License :: OSI Approved :: Apache Software License',
9090
'Operating System :: OS Independent',
9191
'Topic :: Software Development :: Libraries :: Python Modules',
92-
'Topic :: Software Development :: Libraries :: Application '
93-
'Frameworks',
92+
'Topic :: Software Development :: Libraries :: Application Frameworks',
9493
],
9594
zip_safe=True
9695
)

‎tox.ini

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
[tox]
2-
envlist = lin, py35, py36, py37, py38
2+
envlist = lint, py35, py36, py37, py38
33

44
[testenv:lint]
55
basepython = python3.6
66
deps = pylint
77
commands =
8-
pylint --rcfile=annotator_for_clinical_data/build/pylintrc ibm_whcs_sdk/annotator_for_clinical_data_v1
9-
pylint --rcfile=insights_for_medical_literature/build/pylintrc ibm_whcs_sdk/insights_for_medical_literature_v1
8+
pylint --rcfile=.pylintrc ibm_whcs_sdk/annotator_for_clinical_data_v1 ibm_whcs_sdk/annotator_for_clinical_data_v1/tests/unit ibm_whcs_sdk/annotator_for_clinical_data_v1/tests/integration
9+
pylint --rcfile=.pylintrc ibm_whcs_sdk/insights_for_medical_literature_v1 ibm_whcs_sdk/insights_for_medical_literature_v1/tests/unit ibm_whcs_sdk/insights_for_medical_literature_v1/tests/integration
1010

1111
[testenv]
1212
passenv = TOXENV CI JENKINS*
1313
commands =
14-
py.test --cov=annotator_for_clinical_data
14+
py.test --cov=ibm-whcs-sdk {posargs}
1515
codecov -e TOXENV
16-
py.test --cov=insights_for_medical_literature
17-
codecov -e TOKENV
1816

1917
deps =
2018
-r{toxinidir}/requirements.txt

‎watson_service.py

-493
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.