From c001e02a363aa3ab3e7270947b604e65346d30f4 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Tue, 16 Mar 2021 08:06:59 -0500 Subject: [PATCH 1/3] replace use of apptools sweetpickle --- codetools/contexts/data_context.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codetools/contexts/data_context.py b/codetools/contexts/data_context.py index 740982d..98a38c5 100644 --- a/codetools/contexts/data_context.py +++ b/codetools/contexts/data_context.py @@ -14,8 +14,10 @@ from collections import MutableMapping as DictMixin from contextlib import contextmanager +import pickle from apptools import sweet_pickle +from apptools.persistence.versioned_unpickler import VersionedUnpickler from traits.adaptation.api import ( AdaptationOffer, get_global_adaptation_manager) from traits.api import ( @@ -191,7 +193,7 @@ def load(file_or_path): file_object = open(file_or_path, 'rb') try: - data_context = sweet_pickle.load(file_object) + data_context = VersionedUnpickler(file_object).load() finally: if should_close: file_object.close() @@ -224,7 +226,7 @@ def save(self, file_or_path): for item in self.keys(): if isinstance(self[item], tuple(NonPickleable)): del self[item] - sweet_pickle.dump(self, file_object, 1) + pickle.dump(self, file_object, 1) finally: if should_close: file_object.close() From eb0cc3bf29c0833d26fa5e8ddf1c7c9dee3e9fce Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Tue, 16 Mar 2021 08:09:47 -0500 Subject: [PATCH 2/3] remove sweetpickle import --- codetools/contexts/data_context.py | 1 - 1 file changed, 1 deletion(-) diff --git a/codetools/contexts/data_context.py b/codetools/contexts/data_context.py index 98a38c5..e53b9c2 100644 --- a/codetools/contexts/data_context.py +++ b/codetools/contexts/data_context.py @@ -16,7 +16,6 @@ from contextlib import contextmanager import pickle -from apptools import sweet_pickle from apptools.persistence.versioned_unpickler import VersionedUnpickler from traits.adaptation.api import ( AdaptationOffer, get_global_adaptation_manager) From de278e52fb82017d2330d88751cdb81fc56b442f Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Tue, 16 Mar 2021 08:35:21 -0500 Subject: [PATCH 3/3] dont run CI on python < 3.6 --- .travis.yml | 2 -- appveyor.yml | 2 -- etstool.py | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 68ec3b9..9417884 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,6 @@ env: matrix: include: - - env: RUNTIME=2.7 - - env: RUNTIME=3.5 - env: RUNTIME=3.6 fast_finish: true diff --git a/appveyor.yml b/appveyor.yml index 3d239ce..b9f0fc6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,8 +7,6 @@ environment: matrix: - - RUNTIME: '2.7' - - RUNTIME: '3.5' - RUNTIME: '3.6' matrix: diff --git a/etstool.py b/etstool.py index c33bfe4..101b197 100644 --- a/etstool.py +++ b/etstool.py @@ -103,7 +103,7 @@ "mock", } -supported_runtimes = ["2.7.13", "3.5.2", "3.6.0"] +supported_runtimes = ["3.6"] @click.group() def cli():