From ee5dc5e3a05d6ded2891da91ceef0dec6e133ebb Mon Sep 17 00:00:00 2001 From: Jake Brown Date: Wed, 5 Jan 2022 14:12:13 -0500 Subject: [PATCH 01/17] Un-pin dependencies jsonschema and pyrsistent --- requirements/core.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/core.txt b/requirements/core.txt index 18bc3f3c..f5362041 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,5 +1,5 @@ -jsonschema==3.2.0 -pyrsistent==0.16.0 +jsonschema>=3.2.0 +pyrsistent>=0.16.0 requests>=2.21 pyOpenSSL>=19.1.0 cryptography>=2.8.0 From cae52d98a7386da27c2adb4ab1745386b2cf37a8 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Wed, 5 Jan 2022 12:41:38 -0800 Subject: [PATCH 02/17] relax jsonschema, but constrain pyrsistent --- requirements/core.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/core.txt b/requirements/core.txt index f5362041..7e900571 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,5 +1,5 @@ jsonschema>=3.2.0 -pyrsistent>=0.16.0 +pyrsistent==0.16.0 requests>=2.21 pyOpenSSL>=19.1.0 cryptography>=2.8.0 From 8b3f6012fa5af8bea9584b0322d00ca4df37ad69 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Wed, 5 Jan 2022 12:57:39 -0800 Subject: [PATCH 03/17] jsonschema>=3.2.0,<=4.01 pyrsistent>=0.16.0,<=0.17.3 --- requirements/core.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/core.txt b/requirements/core.txt index 7e900571..f9551ea4 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,5 +1,5 @@ -jsonschema>=3.2.0 -pyrsistent==0.16.0 +jsonschema>=3.2.0,<=4.01 +pyrsistent>=0.16.0,<=0.17.3 requests>=2.21 pyOpenSSL>=19.1.0 cryptography>=2.8.0 From dbf7496eec8369c1fefcb1480e09299e51dce96c Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Wed, 5 Jan 2022 12:58:23 -0800 Subject: [PATCH 04/17] fix dot typo --- requirements/core.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/core.txt b/requirements/core.txt index f9551ea4..b28f670c 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,4 +1,4 @@ -jsonschema>=3.2.0,<=4.01 +jsonschema>=3.2.0,<=4.0.1 pyrsistent>=0.16.0,<=0.17.3 requests>=2.21 pyOpenSSL>=19.1.0 From f2d50105aa74137a133f841c73eebe804f41c174 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 13:18:03 -0800 Subject: [PATCH 05/17] Update core.txt --- requirements/core.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/core.txt b/requirements/core.txt index b28f670c..f5362041 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,5 +1,5 @@ -jsonschema>=3.2.0,<=4.0.1 -pyrsistent>=0.16.0,<=0.17.3 +jsonschema>=3.2.0 +pyrsistent>=0.16.0 requests>=2.21 pyOpenSSL>=19.1.0 cryptography>=2.8.0 From 94b1f3e007b220df8eee8a96e155bcf55f3e9b18 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 14:32:26 -0800 Subject: [PATCH 06/17] remove old py version refs from .travis file --- .travis.yml | 33 +++++++++++++++++++++++---------- requirements/test.txt | 8 ++++---- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 562c11b3..eaa1536c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,18 @@ language: python python: - - "2.7" +# - "2.7" # - "3.4" - - "3.5.5" - - "3.6" +# - "3.5.5" +# - "3.6" # - "3.7" is handled in 'Test' job using xenial as Python 3.7 is not available for trusty. # - "3.8" is handled in 'Test' job using xenial as Python 3.8 is not available for trusty. # - "pypy" # - "pypy3" + - "pypy3" + - "3.7" + - "3.8" + - "3.9" + - "3.10" install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" script: "pytest --cov=optimizely" after_success: @@ -35,10 +40,12 @@ jobs: - stage: 'Linting' language: python - python: "2.7" +# python: "2.7" + python: "3.9" # flake8 version should be same as the version in requirements/test.txt # to avoid lint errors on CI - install: "pip install flake8==3.6.0" +# install: "pip install flake8==3.6.0" + install: "pip install flake8>=3.6.0" script: "flake8" after_success: travis_terminate 0 @@ -61,20 +68,26 @@ jobs: SDK=python SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH FULLSTACK_TEST_REPO=ProdTesting - - stage: 'Test' - python: "pypy" - before_install: - - pip install "cryptography>=1.3.4,<=3.1.1" # installing in before_install doesn't re-install the latest version of the same package in the next stage. +# - stage: 'Test' +# python: "pypy" +# before_install: +# - pip install "cryptography>=1.3.4,<=3.1.1" # installing in before_install doesn't re-install the latest version of the same package in the next stage. - stage: 'Test' python: "pypy3" before_install: - - pip install "cryptography>=1.3.4,<=3.1.1" + - pip install "cryptography>=1.3.4,<=3.1.1" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? - stage: 'Test' dist: xenial python: "3.7" - stage: 'Test' dist: xenial python: "3.8" + - stage: 'Test' + dist: xenial + python: "3.9" + - stage: 'Test' + dist: xenial + python: "3.10" - stage: 'Source Clear' if: type = cron diff --git a/requirements/test.txt b/requirements/test.txt index 7ccdb70e..7a628ad5 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,7 +1,7 @@ coverage -flake8==3.6.0 -funcsigs==0.4 -mock==1.3.0 -pytest>=4.6.0 +flake8 >= 3.6.0 +funcsigs >= 0.4 +mock >= 1.3.0 +pytest >= 4.6.0 pytest-cov python-coveralls \ No newline at end of file From e41bc98ca6fcf1ac48558ace8f79989e019f51a1 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 15:08:02 -0800 Subject: [PATCH 07/17] remove py2 lines --- tests/helpers_tests/test_condition.py | 133 -------------------------- tests/helpers_tests/test_validator.py | 13 --- tests/test_optimizely.py | 5 +- 3 files changed, 3 insertions(+), 148 deletions(-) diff --git a/tests/helpers_tests/test_condition.py b/tests/helpers_tests/test_condition.py index 1a20e9ae..78dfe38c 100644 --- a/tests/helpers_tests/test_condition.py +++ b/tests/helpers_tests/test_condition.py @@ -13,7 +13,6 @@ import json import mock -from six import PY2 from optimizely.helpers import condition as condition_helper @@ -394,13 +393,6 @@ def test_exact_string__returns_null__when_no_user_provided_value(self): def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ): - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - exact_int_condition_list, {'lasers_count': long(9000)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - evaluator = condition_helper.CustomAttributeConditionEvaluator( exact_int_condition_list, {'lasers_count': 9000}, self.mock_client_logger ) @@ -415,13 +407,6 @@ def test_exact_int__returns_true__when_user_provided_value_is_equal_to_condition def test_exact_float__returns_true__when_user_provided_value_is_equal_to_condition_value(self, ): - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - exact_float_condition_list, {'lasers_count': long(9000)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - evaluator = condition_helper.CustomAttributeConditionEvaluator( exact_float_condition_list, {'lasers_count': 9000}, self.mock_client_logger ) @@ -599,13 +584,6 @@ def test_greater_than_int__returns_true__when_user_value_greater_than_condition_ self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - gt_int_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_greater_than_float__returns_true__when_user_value_greater_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -620,13 +598,6 @@ def test_greater_than_float__returns_true__when_user_value_greater_than_conditio self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - gt_float_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_greater_than_int__returns_false__when_user_value_not_greater_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -641,13 +612,6 @@ def test_greater_than_int__returns_false__when_user_value_not_greater_than_condi self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - gt_int_condition_list, {'meters_travelled': long(47)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_greater_than_float__returns_false__when_user_value_not_greater_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -662,13 +626,6 @@ def test_greater_than_float__returns_false__when_user_value_not_greater_than_con self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - gt_float_condition_list, {'meters_travelled': long(48)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_greater_than_int__returns_null__when_user_value_is_not_a_number(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -733,13 +690,6 @@ def test_greater_than_or_equal_int__returns_true__when_user_value_greater_than_o self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - gt_int_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_greater_than_or_equal_float__returns_true__when_user_value_greater_than_or_equal_condition_value(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -760,13 +710,6 @@ def test_greater_than_or_equal_float__returns_true__when_user_value_greater_than self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - ge_float_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_greater_than_or_equal_int__returns_false__when_user_value_not_greater_than_or_equal_condition_value( self): @@ -782,13 +725,6 @@ def test_greater_than_or_equal_int__returns_false__when_user_value_not_greater_t self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - ge_int_condition_list, {'meters_travelled': long(47)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_greater_than_or_equal_float__returns_false__when_user_value_not_greater_than_or_equal_condition_value( self): @@ -804,13 +740,6 @@ def test_greater_than_or_equal_float__returns_false__when_user_value_not_greater self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - ge_float_condition_list, {'meters_travelled': long(48)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_greater_than_or_equal_int__returns_null__when_user_value_is_not_a_number(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -869,13 +798,6 @@ def test_less_than_int__returns_true__when_user_value_less_than_condition_value( self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - lt_int_condition_list, {'meters_travelled': long(47)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_less_than_float__returns_true__when_user_value_less_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -890,13 +812,6 @@ def test_less_than_float__returns_true__when_user_value_less_than_condition_valu self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - lt_float_condition_list, {'meters_travelled': long(48)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_less_than_int__returns_false__when_user_value_not_less_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -911,13 +826,6 @@ def test_less_than_int__returns_false__when_user_value_not_less_than_condition_v self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - lt_int_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_less_than_float__returns_false__when_user_value_not_less_than_condition_value(self, ): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -932,13 +840,6 @@ def test_less_than_float__returns_false__when_user_value_not_less_than_condition self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - lt_float_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_less_than_int__returns_null__when_user_value_is_not_a_number(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -991,19 +892,6 @@ def test_less_than_or_equal_int__returns_true__when_user_value_less_than_or_equa self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - le_int_condition_list, {'meters_travelled': long(47)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - - evaluator = condition_helper.CustomAttributeConditionEvaluator( - le_int_condition_list, {'meters_travelled': long(48)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_equal_condition_value(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -1024,13 +912,6 @@ def test_less_than_or_equal_float__returns_true__when_user_value_less_than_or_eq self.assertStrictTrue(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - le_float_condition_list, {'meters_travelled': long(48)}, self.mock_client_logger, - ) - - self.assertStrictTrue(evaluator.evaluate(0)) - def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or_equal_condition_value(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -1045,13 +926,6 @@ def test_less_than_or_equal_int__returns_false__when_user_value_not_less_than_or self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - le_int_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_or_equal_condition_value(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( @@ -1066,13 +940,6 @@ def test_less_than_or_equal_float__returns_false__when_user_value_not_less_than_ self.assertStrictFalse(evaluator.evaluate(0)) - if PY2: - evaluator = condition_helper.CustomAttributeConditionEvaluator( - le_float_condition_list, {'meters_travelled': long(49)}, self.mock_client_logger, - ) - - self.assertStrictFalse(evaluator.evaluate(0)) - def test_less_than_or_equal_int__returns_null__when_user_value_is_not_a_number(self): evaluator = condition_helper.CustomAttributeConditionEvaluator( diff --git a/tests/helpers_tests/test_validator.py b/tests/helpers_tests/test_validator.py index f27b45a3..2a97a538 100644 --- a/tests/helpers_tests/test_validator.py +++ b/tests/helpers_tests/test_validator.py @@ -14,8 +14,6 @@ import json import mock -from six import PY2 - from optimizely import config_manager from optimizely import error_handler from optimizely import event_dispatcher @@ -230,12 +228,6 @@ def test_is_attribute_valid(self): mock_is_finite.assert_called_once_with(5.5) - if PY2: - with mock.patch('optimizely.helpers.validator.is_finite_number', return_value=None) as mock_is_finite: - self.assertIsNone(validator.is_attribute_valid('test_attribute', long(5))) - - mock_is_finite.assert_called_once_with(long(5)) - def test_is_finite_number(self): """ Test that it returns true if value is a number and not NAN, INF, -INF or greater than 2^53. Otherwise False. @@ -257,9 +249,6 @@ def test_is_finite_number(self): self.assertFalse(validator.is_finite_number(-int(2 ** 53) - 1)) self.assertFalse(validator.is_finite_number(float(2 ** 53) + 2.0)) self.assertFalse(validator.is_finite_number(-float(2 ** 53) - 2.0)) - if PY2: - self.assertFalse(validator.is_finite_number(long(2 ** 53) + 1)) - self.assertFalse(validator.is_finite_number(-long(2 ** 53) - 1)) # test valid numbers self.assertTrue(validator.is_finite_number(0)) @@ -269,8 +258,6 @@ def test_is_finite_number(self): self.assertTrue(validator.is_finite_number(float(2 ** 53) + 1.0)) self.assertTrue(validator.is_finite_number(-float(2 ** 53) - 1.0)) self.assertTrue(validator.is_finite_number(int(2 ** 53))) - if PY2: - self.assertTrue(validator.is_finite_number(long(2 ** 53))) class DatafileValidationTests(base.BaseTest): diff --git a/tests/test_optimizely.py b/tests/test_optimizely.py index 185f9033..f1956cf1 100644 --- a/tests/test_optimizely.py +++ b/tests/test_optimizely.py @@ -15,6 +15,7 @@ from operator import itemgetter import mock +import six from optimizely import config_manager from optimizely import decision_service @@ -36,12 +37,12 @@ class OptimizelyTest(base.BaseTest): strTest = None try: - isinstance("test", basestring) # attempt to evaluate basestring + isinstance("test", six.string_types) # attempt to evaluate string _expected_notification_failure = 'Problem calling notify callback.' def isstr(self, s): - return isinstance(s, basestring) + return isinstance(s, six.string_types) strTest = isstr From ed15020f313751b96788406bec75e095cd506845 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 15:24:27 -0800 Subject: [PATCH 08/17] open up cryptography version for pypy3 --- .travis.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index eaa1536c..8e93ea3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,11 +40,9 @@ jobs: - stage: 'Linting' language: python -# python: "2.7" python: "3.9" # flake8 version should be same as the version in requirements/test.txt # to avoid lint errors on CI -# install: "pip install flake8==3.6.0" install: "pip install flake8>=3.6.0" script: "flake8" after_success: travis_terminate 0 @@ -68,14 +66,11 @@ jobs: SDK=python SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH FULLSTACK_TEST_REPO=ProdTesting -# - stage: 'Test' -# python: "pypy" -# before_install: -# - pip install "cryptography>=1.3.4,<=3.1.1" # installing in before_install doesn't re-install the latest version of the same package in the next stage. - stage: 'Test' python: "pypy3" before_install: - - pip install "cryptography>=1.3.4,<=3.1.1" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? +# - pip install "cryptography>=1.3.4,<=3.1.1" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? + - pip install "cryptography>=1.3.4" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? - stage: 'Test' dist: xenial python: "3.7" @@ -85,9 +80,9 @@ jobs: - stage: 'Test' dist: xenial python: "3.9" - - stage: 'Test' - dist: xenial - python: "3.10" +# - stage: 'Test' +# dist: xenial +# python: "3.10" - stage: 'Source Clear' if: type = cron From fcbeae4edb767fabfd6ef5464a625113e76da223 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 15:55:25 -0800 Subject: [PATCH 09/17] temporarily comment out v3.10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8e93ea3c..8ecd59a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ python: - "3.7" - "3.8" - "3.9" - - "3.10" +# - "3.10" install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" script: "pytest --cov=optimizely" after_success: From 52b496b755d3987f296aa21ac37df510564d4482 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 16:44:05 -0800 Subject: [PATCH 10/17] upgrade pip --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ecd59a3..7786ac45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ python: - "3.8" - "3.9" # - "3.10" +before_install: + - python -m pip install --upgrade pip install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" script: "pytest --cov=optimizely" after_success: @@ -67,21 +69,21 @@ jobs: SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH FULLSTACK_TEST_REPO=ProdTesting - stage: 'Test' - python: "pypy3" + python: "pypy3.7-7.3.5" before_install: # - pip install "cryptography>=1.3.4,<=3.1.1" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? - pip install "cryptography>=1.3.4" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? - stage: 'Test' - dist: xenial + dist: focal python: "3.7" - stage: 'Test' - dist: xenial + dist: focal python: "3.8" - stage: 'Test' - dist: xenial + dist: focal python: "3.9" # - stage: 'Test' -# dist: xenial +# dist: focal # python: "3.10" - stage: 'Source Clear' From ff4dba5c8d9c7e22b8638c4674c3de3e6882bd90 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 17:05:19 -0800 Subject: [PATCH 11/17] restrick cryptography lib version --- .travis.yml | 16 +++++++--------- requirements/core.txt | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7786ac45..3c653837 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,8 @@ python: - "3.7" - "3.8" - "3.9" -# - "3.10" -before_install: - - python -m pip install --upgrade pip + - "3.10" +before_install: "python -m pip install --upgrade pip" install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" script: "pytest --cov=optimizely" after_success: @@ -69,10 +68,9 @@ jobs: SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH FULLSTACK_TEST_REPO=ProdTesting - stage: 'Test' - python: "pypy3.7-7.3.5" + python: "pypy3" before_install: -# - pip install "cryptography>=1.3.4,<=3.1.1" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? - - pip install "cryptography>=1.3.4" # TODO: check if these versions can now be simplified - remove upper boundary <=3.1.1? + - pip install "cryptography>=1.3.4,<=3.1.1" - stage: 'Test' dist: focal python: "3.7" @@ -82,9 +80,9 @@ jobs: - stage: 'Test' dist: focal python: "3.9" -# - stage: 'Test' -# dist: focal -# python: "3.10" + - stage: 'Test' + dist: focal + python: "3.10" - stage: 'Source Clear' if: type = cron diff --git a/requirements/core.txt b/requirements/core.txt index f5362041..a60ed954 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -2,6 +2,6 @@ jsonschema>=3.2.0 pyrsistent>=0.16.0 requests>=2.21 pyOpenSSL>=19.1.0 -cryptography>=2.8.0 +cryptography>=2.8.0,<=3.1.1 idna>=2.10 six>=1.12.0 From 19bc65ebbf98e601296b1cc7fa3a0022ccf65fb3 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 17:30:51 -0800 Subject: [PATCH 12/17] make dist focal as global --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c653837..1956b134 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ -language: python +dist: focal +language: python python: # - "2.7" # - "3.4" @@ -72,16 +73,12 @@ jobs: before_install: - pip install "cryptography>=1.3.4,<=3.1.1" - stage: 'Test' - dist: focal python: "3.7" - stage: 'Test' - dist: focal python: "3.8" - stage: 'Test' - dist: focal python: "3.9" - stage: 'Test' - dist: focal python: "3.10" - stage: 'Source Clear' From f03a89c7ac780e68253865cf84257d6d2c229c29 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 17:43:26 -0800 Subject: [PATCH 13/17] add zero to py 3.10 version --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1956b134..4c5625e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ jobs: - stage: 'Linting' language: python - python: "3.9" + python: "3.9.0" # flake8 version should be same as the version in requirements/test.txt # to avoid lint errors on CI install: "pip install flake8>=3.6.0" @@ -79,7 +79,7 @@ jobs: - stage: 'Test' python: "3.9" - stage: 'Test' - python: "3.10" + python: "3.10.0" - stage: 'Source Clear' if: type = cron From fbfe083948fbb346b779e4e276b876aec1bdf64c Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 6 Jan 2022 18:01:33 -0800 Subject: [PATCH 14/17] update --- .travis.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c5625e3..f7d3ecac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,11 @@ dist: focal language: python python: -# - "2.7" -# - "3.4" -# - "3.5.5" -# - "3.6" -# - "3.7" is handled in 'Test' job using xenial as Python 3.7 is not available for trusty. -# - "3.8" is handled in 'Test' job using xenial as Python 3.8 is not available for trusty. -# - "pypy" -# - "pypy3" - "pypy3" - "3.7" - "3.8" - "3.9" - - "3.10" + - "3.10.0" before_install: "python -m pip install --upgrade pip" install: "pip install -r requirements/core.txt;pip install -r requirements/test.txt" script: "pytest --cov=optimizely" @@ -42,7 +34,7 @@ jobs: - stage: 'Linting' language: python - python: "3.9.0" + python: "3.9" # flake8 version should be same as the version in requirements/test.txt # to avoid lint errors on CI install: "pip install flake8>=3.6.0" From a6f2b3d2597f41745f904e5e3c25a80ecb717a30 Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Fri, 7 Jan 2022 09:59:20 -0800 Subject: [PATCH 15/17] update pypy3 version to the latest possible by Travis - pypy3.7-7.3.5 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7d3ecac..340c4402 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ dist: focal language: python python: - - "pypy3" + - "pypy3.7-7.3.5" - "3.7" - "3.8" - "3.9" @@ -61,7 +61,7 @@ jobs: SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH FULLSTACK_TEST_REPO=ProdTesting - stage: 'Test' - python: "pypy3" + python: "pypy3.7-7.3.5" before_install: - pip install "cryptography>=1.3.4,<=3.1.1" - stage: 'Test' From 94e8a1e3415513636a2acfc52ab668c99162e3ec Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Fri, 7 Jan 2022 10:14:24 -0800 Subject: [PATCH 16/17] remove less than for cryptography version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 340c4402..0c62f3dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ jobs: - stage: 'Test' python: "pypy3.7-7.3.5" before_install: - - pip install "cryptography>=1.3.4,<=3.1.1" + - pip install "cryptography>=1.3.4" - stage: 'Test' python: "3.7" - stage: 'Test' From df3d79c3867a37f507841903750aab3b1acb513f Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Fri, 7 Jan 2022 13:25:25 -0800 Subject: [PATCH 17/17] fix lib versions, requirements, setup --- .travis.yml | 6 +++--- requirements/core.txt | 2 +- requirements/test.txt | 6 +++--- setup.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c62f3dc..dc008188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ jobs: python: "3.9" # flake8 version should be same as the version in requirements/test.txt # to avoid lint errors on CI - install: "pip install flake8>=3.6.0" + install: "pip install flake8>=4.1.0" script: "flake8" after_success: travis_terminate 0 @@ -62,8 +62,8 @@ jobs: FULLSTACK_TEST_REPO=ProdTesting - stage: 'Test' python: "pypy3.7-7.3.5" - before_install: - - pip install "cryptography>=1.3.4" +# before_install: +# - pip install "cryptography>=1.3.4" - stage: 'Test' python: "3.7" - stage: 'Test' diff --git a/requirements/core.txt b/requirements/core.txt index a60ed954..f5362041 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -2,6 +2,6 @@ jsonschema>=3.2.0 pyrsistent>=0.16.0 requests>=2.21 pyOpenSSL>=19.1.0 -cryptography>=2.8.0,<=3.1.1 +cryptography>=2.8.0 idna>=2.10 six>=1.12.0 diff --git a/requirements/test.txt b/requirements/test.txt index 7a628ad5..069b65b7 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,7 +1,7 @@ coverage -flake8 >= 3.6.0 +flake8 >= 4.0.1 funcsigs >= 0.4 -mock >= 1.3.0 -pytest >= 4.6.0 +mock >= 4.0.0 +pytest >= 6.2.0 pytest-cov python-coveralls \ No newline at end of file diff --git a/setup.py b/setup.py index 1c99c91e..e66ce1fe 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ 'Optimizely X Full Stack is A/B testing and feature management for product development teams. ' 'Experiment in any application. Make every feature on your roadmap an opportunity to learn. ' 'Learn more at https://www.optimizely.com/products/full-stack/ or see our documentation at ' - 'https://docs.developers.optimizely.com/full-stack/docs.' + 'https://docs.developers.optimizely.com/full-stack/docs. ' ) setup(