[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
jsonschema.compat removal && IRC
From: |
Marco Pessotto |
Subject: |
jsonschema.compat removal && IRC |
Date: |
Mon, 24 May 2021 08:52:21 +0200 |
User-agent: |
mu4e 1.4.15; emacs 27.1 |
Hi all,
today I was trying to upgrade mediagoblin, but I found gmg broken by
this:
Traceback (most recent call last):
File "bin/gmg", line 33, in <module>
sys.exit(load_entry_point('mediagoblin', 'console_scripts', 'gmg')())
File
"/srv/mediagoblin.amusewiki.org/mediagoblin/mediagoblin/gmg_commands/__init__.py",
line 109, in main_cli
setup_func = import_component(command_struct['setup'])
File
"/srv/mediagoblin.amusewiki.org/mediagoblin/mediagoblin/tools/common.py", line
34, in import_component
__import__(module_name)
File
"/srv/mediagoblin.amusewiki.org/mediagoblin/mediagoblin/gmg_commands/batchaddmedia.py",
line 30, in <module>
from mediagoblin.tools.metadata import compact_and_validate
File
"/srv/mediagoblin.amusewiki.org/mediagoblin/mediagoblin/tools/metadata.py",
line 27, in <module>
from jsonschema.compat import str_types
ModuleNotFoundError: No module named 'jsonschema.compat'
jsonschema.compat was removed here:
https://github.com/Julian/jsonschema/commit/1d7711702f8b5f5396f4317d2a409fcf901ab8d3
This patch seems to address it for me:
diff --git a/mediagoblin/tools/metadata.py b/mediagoblin/tools/metadata.py
index 5e5ad9fd..0f0a5225 100644
--- a/mediagoblin/tools/metadata.py
+++ b/mediagoblin/tools/metadata.py
@@ -24,7 +24,6 @@ from pkg_resources import resource_filename
import dateutil.parser
from pyld import jsonld
from jsonschema import validate, FormatChecker, draft4_format_checker
-from jsonschema.compat import str_types
from mediagoblin.tools.pluginapi import hook_handle
@@ -42,7 +41,7 @@ def is_uri(instance):
"""
jsonschema uri validator
"""
- if not isinstance(instance, str_types):
+ if not isinstance(instance, str):
return True
return URL_REGEX.match(instance)
@@ -51,7 +50,7 @@ def is_datetime(instance):
"""
Is a date or datetime readable string.
"""
- if not isinstance(instance, str_types):
+ if not isinstance(instance, str):
return True
return dateutil.parser.parse(instance)
Also, I wanted to ask about the IRC channel. I'm now sitting on both
libera and freenode, and I'm not sure where the maintainers are going to
hang.
Thanks
--
Marco
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- jsonschema.compat removal && IRC,
Marco Pessotto <=