diff --git a/.dl_env.enc b/.dl_env.enc deleted file mode 100644 index a970542..0000000 Binary files a/.dl_env.enc and /dev/null differ diff --git a/.travis.yml b/.travis.yml index 56de52c..ef8e9ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,20 +6,20 @@ cache: pip matrix: include: - - python: 3.5 + - python: 3.6 before_script: - >- [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] && openssl aes-256-cbc -K $encrypted_fc092b9428d6_key -iv $encrypted_fc092b9428d6_iv -in cis.env.enc -out cis.env -d && openssl aes-256-cbc -K $encrypted_d4a185972ecc_key -iv $encrypted_d4a185972ecc_iv -in pdns.env.enc -out pdns.env -d && openssl aes-256-cbc -K $encrypted_16de86179301_key -iv $encrypted_16de86179301_iv -in .transit_env.enc -out .transit_env -d - && openssl aes-256-cbc -K $encrypted_b4d7fa377f59_key -iv $encrypted_b4d7fa377f59_iv -in .dl_env.enc -out .dl_env -d + && openssl aes-256-cbc -K $encrypted_27cb64608ff6_key -iv $encrypted_27cb64608ff6_iv -in dl.env.enc -out dl.env -d || true [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] && openssl aes-256-cbc -K $encrypted_89a9eb4f9417_key -iv $encrypted_89a9eb4f9417_iv -in dns.env.enc -out dns.env -d || true - - python: 3.6 - python: 3.7 - python: 3.8 + - python: 3.9 before_install: - npm install npm@latest -g @@ -45,7 +45,7 @@ deploy: script: npx semantic-release skip_cleanup: true on: - python: '3.5' + python: '3.6' branch: master - provider: pypi @@ -54,5 +54,5 @@ deploy: repository: https://upload.pypi.org/legacy skip_cleanup: true on: - python: '3.5' + python: '3.6' tags: true \ No newline at end of file diff --git a/README.md b/README.md index 7367ec1..31fa3dc 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ IBM Cloud services: - An [IBM Cloud][ibm-cloud-onboarding] account. - An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys). -- Python 3.5.3 or above. +- Python 3.6 or above. ## Installation diff --git a/dl.env.enc b/dl.env.enc new file mode 100644 index 0000000..3430182 Binary files /dev/null and b/dl.env.enc differ diff --git a/ibm_cloud_networking_services/common.py b/ibm_cloud_networking_services/common.py index 1df263d..51ee440 100644 --- a/ibm_cloud_networking_services/common.py +++ b/ibm_cloud_networking_services/common.py @@ -46,6 +46,7 @@ def get_user_agent(): def get_sdk_headers(service_name, service_version, operation_id): + #pylint: disable=unused-argument """ Get the request headers to be sent in requests by the SDK. diff --git a/requirements-dev.txt b/requirements-dev.txt index b4979ce..e380eaf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,16 +1,10 @@ # test dependencies -pytest>=2.8.2 -responses>=0.10 -python_dotenv>=0.1.5 -pylint>=1.4.4 -tox>=2.9.1 +codecov>=2.1.0,<3.0.0 +coverage>=4.5.4 +pylint>=2.6.0,<3.0.0 +pytest>=6.2.1,<7.0.0 +pytest-cov>=2.2.1,<3.0.0 pytest-rerunfailures>=3.1 - -# code coverage -coverage<5 -codecov>=1.6.3 -pytest-cov>=2.2.1 - -# documentation -recommonmark>=0.2.0 -Sphinx>=1.3.1 +responses>=0.12.1,<1.0.0 +tox>=3.2.0,<4.0.0 +python_dotenv>=0.1.5 diff --git a/requirements.txt b/requirements.txt index 993c5aa..e5b472b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ -jproperties -requests>=2.0,<3.0 -python_dateutil>=2.5.3 -websocket-client==0.48.0 -ibm_cloud_sdk_core>=3.0.0 +requests>=2.24.0,<3.0 +python_dateutil>=2.5.3,<3.0.0 +ibm_cloud_sdk_core>=3.4.0,<4.0.0 diff --git a/setup.py b/setup.py index 3953745..d54bfad 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,9 @@ PACKAGE_DESC = 'Python client library for IBM Cloud Networking Services' with open('requirements.txt') as f: - install_requires = [str(req) for req in pkg_resources.parse_requirements(f)] + install_requires = [ + str(req) for req in pkg_resources.parse_requirements(f) + ] with open('requirements-dev.txt') as f: tests_require = [str(req) for req in pkg_resources.parse_requirements(f)] @@ -38,35 +40,16 @@ os.system('python setup.py sdist upload -r pypi') sys.exit() -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = ['--strict', '--verbose', '--tb=long', 'test'] - self.test_suite = True - - def run_tests(self): - import pytest - errcode = pytest.main(self.test_args) - sys.exit(errcode) - -class PyTestUnit(PyTest): - def finalize_options(self): - self.test_args = ['--strict', '--verbose', '--tb=long', 'test/unit'] - -class PyTestIntegration(PyTest): - def finalize_options(self): - self.test_args = ['--strict', '--verbose', '--tb=long', 'test/integration'] - with open("README.md", "r") as fh: readme = fh.read() -setup(name=PACKAGE_NAME.replace('_', '-'), +setup( + name=PACKAGE_NAME.replace('_', '-'), version=__version__, description=PACKAGE_DESC, license='Apache 2.0', install_requires=install_requires, tests_require=tests_require, - cmdclass={'test': PyTest, 'test_unit': PyTestUnit, 'test_integration': PyTestIntegration}, author='IBM', author_email='devexdev@us.ibm.com', long_description=readme, @@ -89,5 +72,4 @@ def finalize_options(self): 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Application Frameworks', ], - zip_safe=True - ) + zip_safe=True) \ No newline at end of file diff --git a/test/integration/test_direct_link_provider_v2.py b/test/integration/test_direct_link_provider_v2.py index ebf83d1..125b991 100644 --- a/test/integration/test_direct_link_provider_v2.py +++ b/test/integration/test_direct_link_provider_v2.py @@ -18,9 +18,9 @@ # load the .env file containing your environment variables try: - load_dotenv(find_dotenv(filename=".dl_env")) + load_dotenv(find_dotenv(filename="dl.env")) except: - raise unittest.SkipTest('no .dl_env file loaded, skipping...') + raise unittest.SkipTest('no dl.env file loaded, skipping...') class TestDirectLinkProviderV2(unittest.TestCase): """ Test class for DirectLink Provider sdk functions """ diff --git a/test/integration/test_direct_link_v1.py b/test/integration/test_direct_link_v1.py index 1835369..cef3f34 100644 --- a/test/integration/test_direct_link_v1.py +++ b/test/integration/test_direct_link_v1.py @@ -25,9 +25,9 @@ # load the .env file containing your environment variables try: - load_dotenv(find_dotenv(filename=".dl_env")) + load_dotenv(find_dotenv(filename="dl.env")) except: - raise unittest.SkipTest('no .dl_env file loaded, skipping...') + raise unittest.SkipTest('no dl.env file loaded, skipping...') class TestDirectLinkV1(unittest.TestCase): """ Test class for DirectLink sdk functions """ diff --git a/test/integration/test_ssl_certificate_api_v1.py b/test/integration/test_ssl_certificate_api_v1.py index ba70701..338204d 100644 --- a/test/integration/test_ssl_certificate_api_v1.py +++ b/test/integration/test_ssl_certificate_api_v1.py @@ -8,6 +8,7 @@ import os import unittest import time +import pytest from dotenv import load_dotenv, find_dotenv from ibm_cloud_networking_services import SslCertificateApiV1 from ibm_cloud_sdk_core import ApiException @@ -99,6 +100,7 @@ def test_1_list_custom_certificates(self): assert resp is not None assert resp.status_code == 200 + @pytest.mark.skip(reason="No need to run this test case") def test_1_custom_certificate_actions(self): """ test method upload/delete/update/get given customized ssl certificate """ @@ -155,6 +157,7 @@ def test_1_custom_certificate_actions(self): assert resp is not None assert resp.status_code == 200 + @pytest.mark.skip(reason="No need to run this test case") def test_1_universal_certificate_setting_actions(self): """ test method get/set custom ssl certificate settings """ diff --git a/tox.ini b/tox.ini index 636c2a8..e04b5c7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = lint, py35, py36, py37, py38 +envlist = py37-lint, py36, py37, py38, py39 -[testenv:lint] +[testenv:py37-lint] basepython = python3.7 deps = pylint commands = pylint --rcfile=.pylintrc ibm_cloud_networking_services test