Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .dl_env.enc
Binary file not shown.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,7 +45,7 @@ deploy:
script: npx semantic-release
skip_cleanup: true
on:
python: '3.5'
python: '3.6'
branch: master

- provider: pypi
Expand All @@ -54,5 +54,5 @@ deploy:
repository: https://upload.pypi.org/legacy
skip_cleanup: true
on:
python: '3.5'
python: '3.6'
tags: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file added dl.env.enc
Binary file not shown.
1 change: 1 addition & 0 deletions ibm_cloud_networking_services/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
22 changes: 8 additions & 14 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
30 changes: 6 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand All @@ -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='[email protected]',
long_description=readme,
Expand All @@ -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)
4 changes: 2 additions & 2 deletions test/integration/test_direct_link_provider_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_direct_link_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down
3 changes: 3 additions & 0 deletions test/integration/test_ssl_certificate_api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 """

Expand Down Expand Up @@ -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 """

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down