From 6e31dc49a67173f55c84f0a934ce2ab5313fe334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Wed, 12 May 2021 17:42:43 -0300 Subject: [PATCH] better handling of pickle5 backport (#1566) * better handling of pickle5 backport * blackify * move pickle5 to I/O section * remove duplicated dep --- tardis/__init__.py | 7 +++++-- tardis_env3.yml | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tardis/__init__.py b/tardis/__init__.py index 25b9da6a904..757f47cf236 100644 --- a/tardis/__init__.py +++ b/tardis/__init__.py @@ -34,6 +34,9 @@ logging.getLogger("py.warnings").addHandler(console_handler) # ---------------------------------------------------------------------------- -import pickle5 +# pyne holds Python 3.7 on macOS, but refdata is pickled with protocol 5 (3.8) -sys.modules["pickle"] = pickle5 +if sys.version_info < (3, 8): + import pickle5 + + sys.modules["pickle"] = pickle5 diff --git a/tardis_env3.yml b/tardis_env3.yml index a7457bc80a9..a10de0ac238 100644 --- a/tardis_env3.yml +++ b/tardis_env3.yml @@ -26,6 +26,7 @@ dependencies: - tqdm - beautifulsoup4 - lxml + - pickle5 # Analysis - jupyter @@ -44,7 +45,7 @@ dependencies: - sphinx - nbconvert - numpydoc - - docutils>=0.16,<0.17 + - docutils=0.16 - nbformat - nbsphinx - sphinx_bootstrap_theme @@ -59,7 +60,6 @@ dependencies: - pytest-html - pytest-cov - coverage - - requests - docopt # Code quality @@ -75,4 +75,3 @@ dependencies: - dot2tex - sphinx-jsonschema - git+https://github.com/Naereen/dot2tex.git - - pickle5