diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74dbffa31..6c20bf801 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ jobs: runs-on: ubuntu-20.04 env: # We use these variables to convert between tox and GHA version literals - py27: 2.7 py35: 3.5 py36: 3.6 py37: 3.7 @@ -23,7 +22,7 @@ jobs: # ensures the entire test matrix is run, even if one permutation fails fail-fast: false matrix: - python-version: [py27, py35, py36, py37, py38, py39] + python-version: [py35, py36, py37, py38, py39] steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/contrib/opencensus-ext-azure/opencensus/ext/azure/common/__init__.py b/contrib/opencensus-ext-azure/opencensus/ext/azure/common/__init__.py index 96aa54ed3..85255e597 100644 --- a/contrib/opencensus-ext-azure/opencensus/ext/azure/common/__init__.py +++ b/contrib/opencensus-ext-azure/opencensus/ext/azure/common/__init__.py @@ -66,7 +66,7 @@ def process_options(options): ) # storage path - if options.storage_path is None: + if options.enable_local_storage and options.storage_path is None: TEMPDIR_SUFFIX = options.instrumentation_key or "" options.storage_path = os.path.join( tempfile.gettempdir(), diff --git a/contrib/opencensus-ext-azure/setup.py b/contrib/opencensus-ext-azure/setup.py index 28d8c450a..afe8e4082 100644 --- a/contrib/opencensus-ext-azure/setup.py +++ b/contrib/opencensus-ext-azure/setup.py @@ -27,8 +27,6 @@ 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', diff --git a/contrib/opencensus-ext-azure/tests/test_options.py b/contrib/opencensus-ext-azure/tests/test_options.py index 9ab130fb5..8b7b256a6 100644 --- a/contrib/opencensus-ext-azure/tests/test_options.py +++ b/contrib/opencensus-ext-azure/tests/test_options.py @@ -15,6 +15,8 @@ import os import unittest +import mock + from opencensus.ext.azure import common @@ -108,6 +110,22 @@ def test_process_options_proxies_set_proxies(self): '{"https": "https://test-proxy.com"}' ) + @mock.patch("opencensus.ext.azure.common.tempfile") + def test_process_options_enable_local_storage(self, mock_tempfile): + options = common.Options() + + self.assertTrue(options.enable_local_storage) + self.assertIsNotNone(options.storage_path) + mock_tempfile.gettempdir.assert_called_once() + + @mock.patch("opencensus.ext.azure.common.tempfile") + def test_process_options_disable_local_storage(self, mock_tempfile): + options = common.Options(enable_local_storage = False) + + self.assertFalse(options.enable_local_storage, False) + self.assertIsNone(options.storage_path) + mock_tempfile.gettempdir.assert_not_called() + def test_parse_connection_string_none(self): cs = None result = common.parse_connection_string(cs) diff --git a/noxfile.py b/noxfile.py index aa9d3dba6..2cd2f2dc2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -61,7 +61,7 @@ def _install_test_dependencies(session): session.install('unittest2') -@nox.session(python=['2.7', '3.5', '3.6']) +@nox.session(python=['3.5', '3.6', '3.7', '3.8', '3.9', '3.10']) def unit(session): """Run the unit test suite.""" diff --git a/setup.py b/setup.py index de949d8f6..b2b946ede 100644 --- a/setup.py +++ b/setup.py @@ -28,8 +28,6 @@ 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', diff --git a/tox.ini b/tox.ini index 9802276e5..f326b1fe2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{27,35,36,37,38,39}-unit + py{35,36,37,38,39}-unit py39-bandit py39-lint py39-setup @@ -18,7 +18,6 @@ deps = unit,lint: pytest-cov unit,lint: retrying unit,lint: unittest2 - py27-unit: markupsafe==1.1.1 py35-unit: markupsafe==1.1.1 py3{6,7,8,9}-unit: markupsafe==2.0.1 # https://github.com/pallets/markupsafe/issues/282 bandit: bandit @@ -60,7 +59,7 @@ deps = docs: sphinx >= 1.6.3 commands = - py{27,34,35}-unit: {[constants]unit-base-command} --ignore=contrib/opencensus-ext-stackdriver --ignore=contrib/opencensus-ext-flask --ignore=contrib/opencensus-ext-httpx --ignore=contrib/opencensus-ext-fastapi + py{34,35}-unit: {[constants]unit-base-command} --ignore=contrib/opencensus-ext-stackdriver --ignore=contrib/opencensus-ext-flask --ignore=contrib/opencensus-ext-httpx --ignore=contrib/opencensus-ext-fastapi py36-unit: {[constants]unit-base-command} --ignore=contrib/opencensus-ext-httpx py3{7,8,9}-unit: {[constants]unit-base-command}