From 222f54fa45d3d3d1f5e768f34e294966cb7f217d Mon Sep 17 00:00:00 2001 From: Ajay Malhotra Date: Tue, 9 Mar 2021 14:32:39 -0800 Subject: [PATCH 1/4] chore: upgraded the minimum supported version of python to 3.6 --- .dl_env.enc | Bin 912 -> 0 bytes .travis.yml | 10 +++--- README.md | 2 +- dl.env.enc | Bin 0 -> 528 bytes requirements-dev.txt | 22 +++++-------- requirements.txt | 8 ++--- setup.py | 30 ++++-------------- test/integration/test_direct_link_v1.py | 4 +-- .../test_ssl_certificate_api_v1.py | 3 ++ tox.ini | 4 +-- 10 files changed, 30 insertions(+), 53 deletions(-) delete mode 100644 .dl_env.enc create mode 100644 dl.env.enc diff --git a/.dl_env.enc b/.dl_env.enc deleted file mode 100644 index a970542c1ccd8ce18e63bab9dc9d77225745245a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmV;B18@A>rgXn9j+C@1niPz=xK;+ud_GfN|Fc@&pq<+%z>Out%NXFxsI&^En|>?k z9Tn>x8zPgM4+pLL)s7lurx*}UPtXK7ng=M zhfCgw7pzmz+E_D)b>=vpmSA#<0t1gSArKXlQM&7DmwF*i91d$ic>6<0YWG|Ql}}K4 zTqXaq$D2V9of!&nSJTfO{Qoex+}@hd>@{oQWL z1!3Agz~ak2w-ST|d!>aSmWZT8J=~Pewg!yhgfhNSx+4u4pxnmosmXA{^hPE;5($1Edf#Be0v+R}xOUdyjQxu_jIl4zxANssYrB=}hf@oIGE>seledyy!g&^3Ok=fe1891;DXl*c)pvwq z+XXa0H*LSBw(^@;B176y7q^~&yXopzw__o@;bQmciv)s!m>?OlBS7r|_6|yaxW6$} zH9Z-3W|rcEYEpgeSXHjbG3#I-5LsD}0#CwD{mD&BqVe?F= z-jn;fh0^(ZTYdLKH&3lp6t?Vru%hC^n+p?N0SP=R zdxb7An8EcC^Mcg(;X7Yvp;KI=n^*QJL&r+@;{DR7dO=13p2|J4?IeLKZVw1g96A)_ zD;J4;)D4B0>@C+|q!qB|=?o;+`+&A$EI-ga;LazH1f=LIc7r^w58KtN$6zTR98V{i z^s5dSdQQj#H3RQlp%}2+R^nqJ>E%5&IRIeR2~gQTr*v}V!+`W~o6E1?Clu9WXP5Wm m@vGo+cdnLj#9KX)JCh- [ -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 0000000000000000000000000000000000000000..5d002dc40713fa9587db26f9d8b495a7d468ce96 GIT binary patch literal 528 zcmV+r0`L8ndsN8IIw{vn<-ieC5!5mPQ3g(bC*fi7sKR14^yl^4^cyHrOkhn#lBpY) zjeBh4qEmWytLMQ{mTpIAY4F$~IoBpc^*TA&VX^&4t4A5qB|;viToq$qX8=mS@aX4r zIw%GMtu$1KSnb9~(jPZCfE?tTDUwq zWUXK9-`371=j7&Bq6ZO7ApeY8{obu;#-y1wt*9=RhSYxBmDlvPCap+ilffXuq*G+kwz=xLhMkzg0MJs_A^)`KMrq;m8SuEdD?|go zL5cCFT%xCNM1sQ3>QT8BIe@P1c>pW9LZ?*^o)L(t1nLD67Z9KwYq;1f=CgcmR-&6L zo2Q`mJtwmmF?UM_HZK@1vgJe<=JZRn9T;UNaWre~+C^k%@5#H2G;rQ{23wz=+9-Q{ S3+qvxvQGW(Cc5`8yuC|bU;|tL literal 0 HcmV?d00001 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_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 From b3114a8d9561973f06c1f6d9a853bcfb18ae0a84 Mon Sep 17 00:00:00 2001 From: Ajay Malhotra Date: Tue, 9 Mar 2021 15:00:22 -0800 Subject: [PATCH 2/4] chore: enabled the test for direct link provider --- test/integration/test_direct_link_provider_v2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 """ From 21ce9308a50b90f9f46dc955d282acaa9a7cb852 Mon Sep 17 00:00:00 2001 From: Ajay Malhotra Date: Tue, 9 Mar 2021 15:04:46 -0800 Subject: [PATCH 3/4] chore: fixed linter errors --- ibm_cloud_networking_services/common.py | 1 + 1 file changed, 1 insertion(+) 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. From b80a289aa61e8f2ca67a30ac5d7e83e2666516cc Mon Sep 17 00:00:00 2001 From: Ajay Malhotra Date: Tue, 9 Mar 2021 17:46:18 -0800 Subject: [PATCH 4/4] test: added updated encrypted file for dl environment variables --- dl.env.enc | Bin 528 -> 784 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dl.env.enc b/dl.env.enc index 5d002dc40713fa9587db26f9d8b495a7d468ce96..343018210adac679d95ae6f972c8289a9fe61763 100644 GIT binary patch literal 784 zcmV+r1MmFNYVyvH@Rk@Hs!CTU_zbZ8P_DejJL}U-@*P1RnL8fi>V73VZ=CdwI;yMT zqa__-o6b!JaWDk1+yDTIFN>?}#Dy{SYl@J)T(8Lej~68NX@U(Ox{>ZMFl|?j_7xtN zrchWIsYXzV?pSuKSVu{`xW7tU;VsCb*0^t9oRMOe#vyH&u;zT;H#j%%iNeCg&nM*2 zw<5-?JqhIYF6CR+T^tqZ-kT|aokMDV$}jB$-*M+5(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