diff --git a/docker/ejsonschema/Dockerfile b/docker/ejsonschema/Dockerfile index d82179b..1af09a7 100644 --- a/docker/ejsonschema/Dockerfile +++ b/docker/ejsonschema/Dockerfile @@ -2,12 +2,12 @@ FROM oar-metadata/jqfromsrc:latest RUN apt-get update && apt-get install -y unzip uwsgi uwsgi-src \ uuid-dev libcap-dev libpcre3-dev python3-distutils -RUN PYTHON=python3.8 uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python38" && \ - mv python38_plugin.so /usr/lib/uwsgi/plugins/python38_plugin.so && \ - chmod 644 /usr/lib/uwsgi/plugins/python38_plugin.so +RUN PYTHON=python3 uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python3" && \ + mv python3_plugin.so /usr/lib/uwsgi/plugins/python3_plugin.so && \ + chmod 644 /usr/lib/uwsgi/plugins/python3_plugin.so -RUN update-alternatives --install /usr/lib/uwsgi/plugins/python3_plugin.so \ - python_plugin.so /usr/lib/uwsgi/plugins/python38_plugin.so 1 +RUN update-alternatives --install /usr/lib/uwsgi/plugins/python_plugin.so \ + python_plugin.so /usr/lib/uwsgi/plugins/python3_plugin.so 1 RUN python -m pip install "setuptools<66.0.0" RUN python -m pip install json-spec jsonschema==2.4.0 requests \ @@ -17,16 +17,16 @@ RUN python -m pip install --no-dependencies jsonmerge==1.3.0 WORKDIR /root RUN curl -L -o ejsonschema.zip \ - https://github.com/usnistgov/ejsonschema/archive/master.zip && \ + https://github.com/usnistgov/ejsonschema/archive/1.0rc4.zip && \ unzip ejsonschema.zip && \ - cd ejsonschema-master && \ - python setup.py install --install-purelib=/usr/local/lib/python3.8/dist-packages + cd ejsonschema-1.0rc4 && \ + python setup.py install --install-purelib=/usr/local/lib/python3.10/dist-packages RUN curl -L -o pynoid.zip \ https://github.com/RayPlante/pynoid/archive/master.zip && \ unzip pynoid.zip && \ cd pynoid-master && \ - python setup.py install --install-purelib=/usr/local/lib/python3.8/dist-packages + python setup.py install --install-purelib=/usr/local/lib/python3.10/dist-packages CMD ["bash"] diff --git a/docker/pymongo/Dockerfile b/docker/pymongo/Dockerfile index 55d269a..4809aab 100644 --- a/docker/pymongo/Dockerfile +++ b/docker/pymongo/Dockerfile @@ -1,14 +1,15 @@ -# This provides the base support for Python 3.8 and MongoDB 4.4 +# This provides the base support for Python 3.10 and MongoDB 7.0 -FROM mongo:4.4 +FROM mongo:7.0-jammy # VOLUME /data MAINTAINER Ray Plante COPY mongod.conf /etc/mongod.conf COPY mongod_ctl.sh /usr/local/bin -RUN apt-get update && apt-get install -y ca-certificates locales python3.8 python3-pip python3.8-dev -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1; \ - update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1; \ +RUN apt-get update && apt-get install -y ca-certificates locales \ + python3 python3-pip python3-dev python-is-python3 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1; \ + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3 1; \ update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 RUN locale-gen en_US.UTF-8 diff --git a/python/nistoar/doi/datacite.py b/python/nistoar/doi/datacite.py index 358cb51..3048079 100644 --- a/python/nistoar/doi/datacite.py +++ b/python/nistoar/doi/datacite.py @@ -7,7 +7,8 @@ DataCite services. """ import re -from collections import OrderedDict, Mapping +from collections import OrderedDict +from collections.abc import Mapping from copy import deepcopy from io import StringIO import requests diff --git a/python/nistoar/id/persist.py b/python/nistoar/id/persist.py index 5544797..d10e614 100644 --- a/python/nistoar/id/persist.py +++ b/python/nistoar/id/persist.py @@ -4,7 +4,8 @@ locking to prevent two processes from acquiring the same ID. """ import os, logging, json -from collections import Mapping +from collections import OrderedDict +from collections.abc import Mapping from copy import deepcopy from .minter import IDRegistry, IDMinter, NoidMinter, NIST_ARK_NAAN import pynoid as noid, filelock diff --git a/python/nistoar/nerdm/convert/latest.py b/python/nistoar/nerdm/convert/latest.py index 45558fb..07a2d97 100644 --- a/python/nistoar/nerdm/convert/latest.py +++ b/python/nistoar/nerdm/convert/latest.py @@ -2,7 +2,8 @@ Module for converting a NERDm record to the latest schema versions. """ import re -from collections import OrderedDict, Mapping +from collections import OrderedDict +from collections.abc import Mapping from copy import deepcopy from urllib.parse import urlparse diff --git a/python/nistoar/nerdm/convert/pod.py b/python/nistoar/nerdm/convert/pod.py index 4bb779b..f6378e8 100644 --- a/python/nistoar/nerdm/convert/pod.py +++ b/python/nistoar/nerdm/convert/pod.py @@ -2,7 +2,8 @@ Classes and functions for converting from and to the NERDm schema """ import os, json, re -from collections import OrderedDict, Mapping +from collections import OrderedDict +from collections.abc import Mapping from ... import jq from ...doi import resolve, is_DOI diff --git a/python/nistoar/nerdm/convert/rmm.py b/python/nistoar/nerdm/convert/rmm.py index 78e6dd1..4c92958 100644 --- a/python/nistoar/nerdm/convert/rmm.py +++ b/python/nistoar/nerdm/convert/rmm.py @@ -17,7 +17,8 @@ as a version-specific ID. """ import re -from collections import OrderedDict, Mapping +from collections import OrderedDict +from collections.abc import Mapping from urllib.parse import urljoin from copy import deepcopy diff --git a/python/nistoar/nerdm/validate.py b/python/nistoar/nerdm/validate.py index aa029a9..a1139db 100644 --- a/python/nistoar/nerdm/validate.py +++ b/python/nistoar/nerdm/validate.py @@ -1,7 +1,8 @@ """ tools for validating NERDm metadata """ -from collections import Mapping +from collections import OrderedDict +from collections.abc import Mapping import ejsonschema as ejs from ejsonschema import ValidationError, RefResolutionError diff --git a/python/nistoar/rmm/mongo/nerdm.py b/python/nistoar/rmm/mongo/nerdm.py index c6d6f99..199795e 100644 --- a/python/nistoar/rmm/mongo/nerdm.py +++ b/python/nistoar/rmm/mongo/nerdm.py @@ -3,7 +3,8 @@ """ # import pandas as pd import json, os, sys, warnings -from collections import Mapping +from collections import OrderedDict +from collections.abc import Mapping from .loader import (Loader, RecordIngestError, JSONEncodingError, UpdateWarning, LoadLog) diff --git a/python/tests/nistoar/doi/resolving/test_crossref.py b/python/tests/nistoar/doi/resolving/test_crossref.py index b71d4fa..130ae7e 100644 --- a/python/tests/nistoar/doi/resolving/test_crossref.py +++ b/python/tests/nistoar/doi/resolving/test_crossref.py @@ -1,6 +1,6 @@ import os, sys, pdb, shutil, logging, json import unittest as test -from collections import Mapping +from collections.abc import Mapping # from nistoar.tests import * import nistoar.doi.resolving.crossref as res diff --git a/python/tests/nistoar/doi/resolving/test_datacite.py b/python/tests/nistoar/doi/resolving/test_datacite.py index 51e593f..9e4f1e0 100644 --- a/python/tests/nistoar/doi/resolving/test_datacite.py +++ b/python/tests/nistoar/doi/resolving/test_datacite.py @@ -1,6 +1,6 @@ import os, sys, pdb, shutil, logging, json import unittest as test -from collections import Mapping +from collections.abc import Mapping # from nistoar.tests import * import nistoar.doi.resolving.datacite as res diff --git a/python/tests/nistoar/doi/sim_datacite_srv.py b/python/tests/nistoar/doi/sim_datacite_srv.py index b03a2d7..285f27a 100644 --- a/python/tests/nistoar/doi/sim_datacite_srv.py +++ b/python/tests/nistoar/doi/sim_datacite_srv.py @@ -1,7 +1,8 @@ import json, os, sys, re, hashlib, json, logging, random from datetime import datetime from wsgiref.headers import Headers -from collections import OrderedDict, Mapping +from collections import OrderedDict +from collections.abc import Mapping from copy import deepcopy from urllib.parse import parse_qs diff --git a/python/tests/nistoar/nerdm/test_validate.py b/python/tests/nistoar/nerdm/test_validate.py index 479e67f..9c015f4 100644 --- a/python/tests/nistoar/nerdm/test_validate.py +++ b/python/tests/nistoar/nerdm/test_validate.py @@ -1,5 +1,5 @@ import unittest, pdb, os, json -from collections import Mapping +from collections.abc import Mapping import ejsonschema as ejs