Skip to content

Commit 105dd8c

Browse files
committed
Plone upgrade, conversion from alpine, and resolve #18
1 parent 8f80467 commit 105dd8c

18 files changed

+237
-51
lines changed

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@
33
#
44
# Defines the image for the CancerDataExpo
55

6-
FROM plone:5.2.2-alpine
6+
FROM plone:5.2.9
77

8-
ENV numpy=1.19.3
8+
ENV numpy=1.23.4
99

1010
COPY site.cfg /plone/instance/
1111
COPY src/ /plone/instance/src/
1212
COPY etc/ /plone/instance/etc/
1313

1414
RUN : &&\
15-
build_deps="gcc musl-dev" &&\
16-
apk update --quiet &&\
17-
apk add --quiet --virtual /build $build_deps &&\
1815
pip --quiet install numpy==${numpy} &&\
1916
buildout -c site.cfg &&\
2017
find /plone -not -user plone -exec chown plone:plone {} \+ &&\
21-
apk del --quiet /build &&\
22-
rm -rf /var/cache/apk/* &&\
2318
:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ The answer will then be in the result element of the response element of the env
5454

5555
## 🔧 Developing
5656

57-
**👉 Note:** Plone 5.2.2 (used here) is not compatible with any Python newer than 3.8. Stick with 3.8.
57+
**👉 Note:** Plone 5.2.9 (used here) is not compatible with any Python newer than 3.8. Stick with 3.8.
5858

5959
Do the following:
6060
```console
6161
python3.8 -m venv venv
62-
venv/bin/pip install --upgrade pip build wheel zc.buildout setuptools==42.0.2 numpy==1.19.3
62+
venv/bin/pip install --upgrade pip build wheel zc.buildout setuptools==42.0.2 numpy==1.23.4
6363
venv/bin/buildout -c dev.cfg
6464
```
6565

etc/versions/dists.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# That's it (for now).
1616
[buildout]
17-
extends = https://dist.plone.org/release/5.2.2/versions.cfg
17+
extends = https://dist.plone.org/release/5.2.9/versions.cfg
1818

1919

2020
# Software Distributions to Compile/Make/Install

etc/versions/known-good-versions.cfg

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,192 @@ suds2 = 0.7.1
223223
# Required by:
224224
# unittest2==1.1.0
225225
traceback2 = 1.4.0
226+
227+
# Added by buildout at 2022-12-05 16:58:47.176461
228+
biothings-client = 0.2.6
229+
collective.recipe.backup = 4.2.0
230+
isort = 5.10.1
231+
modernize = 0.8.0
232+
mr.scripty = 1.0
233+
234+
# Required by:
235+
# edrn.summarizer==0.0.8
236+
biopython = 1.80
237+
238+
# Required by:
239+
# edrn.rdf==1.3.8
240+
# edrn.summarizer==0.0.8
241+
collective.autopermission = 1.0b2
242+
243+
# Required by:
244+
# modernize==0.8.0
245+
fissix = 21.11.13
246+
247+
# Required by:
248+
# rdflib==4.2.2
249+
isodate = 0.6.1
250+
251+
# Required by:
252+
# edrn.summarizer==0.0.8
253+
mygene = 3.2.2
254+
255+
# Required by:
256+
# edrn.rdf==1.3.8
257+
pysolr = 3.9.0
258+
259+
# Required by:
260+
# edrn.rdf==1.3.8
261+
# edrn.summarizer==0.0.8
262+
suds2 = 0.7.1
263+
264+
# Required by:
265+
# python-dotenv==0.15.0
266+
typing = 3.10.0.0
267+
268+
# Added by buildout at 2022-12-05 17:12:03.918426
269+
biothings-client = 0.2.6
270+
collective.recipe.backup = 4.2.0
271+
isort = 5.10.1
272+
modernize = 0.8.0
273+
mr.scripty = 1.0
274+
275+
# Required by:
276+
# edrn.summarizer==0.0.8
277+
biopython = 1.80
278+
279+
# Required by:
280+
# edrn.rdf==1.3.8
281+
# edrn.summarizer==0.0.8
282+
collective.autopermission = 1.0b2
283+
284+
# Required by:
285+
# modernize==0.8.0
286+
fissix = 21.11.13
287+
288+
# Required by:
289+
# rdflib==4.2.2
290+
isodate = 0.6.1
291+
292+
# Required by:
293+
# edrn.summarizer==0.0.8
294+
mygene = 3.2.2
295+
296+
# Required by:
297+
# edrn.rdf==1.3.8
298+
pysolr = 3.9.0
299+
300+
# Required by:
301+
# edrn.rdf==1.3.8
302+
# edrn.summarizer==0.0.8
303+
suds2 = 0.7.1
304+
305+
# Added by buildout at 2022-12-06 09:35:44.943510
306+
biothings-client = 0.2.6
307+
collective.recipe.backup = 4.2.0
308+
isort = 5.10.1
309+
modernize = 0.8.0
310+
mr.scripty = 1.0
311+
312+
# Required by:
313+
# edrn.summarizer==0.0.8
314+
biopython = 1.80
315+
316+
# Required by:
317+
# edrn.rdf==1.3.8
318+
# edrn.summarizer==0.0.8
319+
collective.autopermission = 1.0b2
320+
321+
# Required by:
322+
# modernize==0.8.0
323+
fissix = 21.11.13
324+
325+
# Required by:
326+
# rdflib==6.2.0
327+
isodate = 0.6.1
328+
329+
# Required by:
330+
# edrn.summarizer==0.0.8
331+
mygene = 3.2.2
332+
333+
# Required by:
334+
# edrn.rdf==1.3.8
335+
pysolr = 3.9.0
336+
337+
# Required by:
338+
# edrn.rdf==1.3.8
339+
# edrn.summarizer==0.0.8
340+
suds2 = 0.7.1
341+
342+
# Added by buildout at 2022-12-06 09:44:08.666120
343+
biothings-client = 0.2.6
344+
collective.recipe.backup = 4.2.0
345+
isort = 5.10.1
346+
modernize = 0.8.0
347+
mr.scripty = 1.0
348+
349+
# Required by:
350+
# edrn.summarizer==0.0.8
351+
biopython = 1.80
352+
353+
# Required by:
354+
# edrn.rdf==1.3.8
355+
# edrn.summarizer==0.0.8
356+
collective.autopermission = 1.0b2
357+
358+
# Required by:
359+
# modernize==0.8.0
360+
fissix = 21.11.13
361+
362+
# Required by:
363+
# rdflib==5.0.0
364+
isodate = 0.6.1
365+
366+
# Required by:
367+
# edrn.summarizer==0.0.8
368+
mygene = 3.2.2
369+
370+
# Required by:
371+
# edrn.rdf==1.3.8
372+
pysolr = 3.9.0
373+
374+
# Required by:
375+
# edrn.rdf==1.3.8
376+
# edrn.summarizer==0.0.8
377+
suds2 = 0.7.1
378+
379+
# Added by buildout at 2022-12-06 10:22:10.706859
380+
biothings-client = 0.2.6
381+
collective.recipe.backup = 4.2.0
382+
isort = 5.10.1
383+
modernize = 0.8.0
384+
mr.scripty = 1.0
385+
386+
# Required by:
387+
# edrn.summarizer==0.0.8
388+
biopython = 1.80
389+
390+
# Required by:
391+
# edrn.rdf==1.3.8
392+
# edrn.summarizer==0.0.8
393+
collective.autopermission = 1.0b2
394+
395+
# Required by:
396+
# modernize==0.8.0
397+
fissix = 21.11.13
398+
399+
# Required by:
400+
# rdflib==6.2.0
401+
isodate = 0.6.1
402+
403+
# Required by:
404+
# edrn.summarizer==0.0.8
405+
mygene = 3.2.2
406+
407+
# Required by:
408+
# edrn.rdf==1.3.8
409+
pysolr = 3.9.0
410+
411+
# Required by:
412+
# edrn.rdf==1.3.8
413+
# edrn.summarizer==0.0.8
414+
suds2 = 0.7.1

etc/zope.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ eggs =
9393
plone.testing
9494
plone.app.testing
9595
plone.app.robotframework
96-
unittest2
9796
plone.app.upgrade
9897
defaults = ['--auto-color', '--auto-progress', '--verbose']
9998

src/edrn.rdf/edrn/rdf/README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ And now::
311311
'application/rdf+xml'
312312
>>> import rdflib
313313
>>> graph = rdflib.Graph()
314-
>>> graph.parse(data=browser.contents)
314+
>>> graph.parse(data=browser.contents, format='xml')
315315
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
316316
>>> len(graph)
317317
68
@@ -431,7 +431,7 @@ And now::
431431

432432
>>> browser.open(portalURL + '/a-simple-source/@@rdf')
433433
>>> graph = rdflib.Graph()
434-
>>> graph.parse(data=browser.contents)
434+
>>> graph.parse(data=browser.contents, format='xml')
435435
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
436436
>>> len(graph)
437437
124
@@ -541,7 +541,7 @@ And now for the RDF::
541541

542542
>>> browser.open(portalURL + '/a-simple-source/@@rdf')
543543
>>> graph = rdflib.Graph()
544-
>>> graph.parse(data=browser.contents)
544+
>>> graph.parse(data=browser.contents, format='xml')
545545
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
546546
>>> len(graph)
547547
31809
@@ -672,7 +672,7 @@ And now for the RDF::
672672

673673
>>> browser.open(portalURL + '/a-committee-source/@@rdf')
674674
>>> graph = rdflib.Graph()
675-
>>> graph.parse(data=browser.contents)
675+
>>> graph.parse(data=browser.contents, format='xml')
676676
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
677677
>>> len(graph)
678678
298
@@ -804,7 +804,7 @@ And now for the RDF::
804804

805805
>>> browser.open(portalURL + '/a-protocol-source/@@rdf')
806806
>>> graph = rdflib.Graph()
807-
>>> graph.parse(data=browser.contents)
807+
>>> graph.parse(data=browser.contents, format='xml')
808808
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
809809
>>> len(graph) > 9422
810810
True
@@ -969,7 +969,7 @@ And now for the RDF::
969969

970970
>>> browser.open(portalURL + '/a-biomuta-source/@@rdf')
971971
>>> graph = rdflib.Graph()
972-
>>> graph.parse(data=browser.contents)
972+
>>> graph.parse(data=browser.contents, format='xml')
973973
<Graph identifier=...(<class 'rdflib.graph.Graph'>)>
974974
>>> len(graph)
975975
131187

src/edrn.rdf/edrn/rdf/labcascollectionrdfgenerator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ def generateGraph(self):
8686
context = aq_inner(self.context)
8787
graph = rdflib.Graph()
8888
solr = Solr(context.labcasSolrURL + '/datasets', auth=(context.username, context.password))
89-
numDatasets = solr.search(q='*:*', rows=0).hits
89+
numDatasets = solr.search(q='Consortium:EDRN', rows=0).hits
9090
solr = Solr(context.labcasSolrURL + '/files', auth=(context.username, context.password))
91-
numFiles = solr.search(q='*:*', rows=0).hits
91+
numFiles = solr.search(q='Consortium:EDRN', rows=0).hits
9292
solr = Solr(context.labcasSolrURL + '/collections', auth=(context.username, context.password))
93-
results = solr.search(q='*:*', rows=999999) # 😮 TODO This'll fail once we get to a million collections
93+
results = solr.search(q='Consortium:EDRN', rows=999999) # 😮 TODO This'll fail once we get to a million collections
9494
numCollections = results.hits
9595
for i in results:
9696
collectionID, name, consortia = i.get('id'), i.get('CollectionName', '«unknown»'), i.get('Consortium', [])

src/edrn.rdf/edrn/rdf/rdfupdater.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ def updateRDF(self):
4141
# Is there an active file?
4242
if context.approvedFile:
4343
# Is it identical to what we just generated?
44-
current = Graph().parse(data=context.approvedFile.to_object.file.data)
45-
if isomorphic(graph, current):
46-
raise NoUpdateRequired(context)
44+
try:
45+
current = Graph().parse(data=context.approvedFile.to_object.file.data, format='xml')
46+
if isomorphic(graph, current):
47+
raise NoUpdateRequired(context)
48+
except AttributeError:
49+
# File not found
50+
pass
4751

4852
# Create a new file and set it active
4953
# TODO: Add validation steps here

src/edrn.rdf/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'plone.app.relationfield',
3232
'plone.behavior',
3333
'Products.CMFPlone',
34-
'rdflib==4.2.2',
34+
'rdflib==6.2.0',
3535
'setuptools',
3636
'z3c.relationfield',
3737
'suds2',

src/edrn.summarizer/edrn/summarizer/biomarkersummarizergenerator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from zope import schema
1717
from zope.component import queryUtility
1818
from plone.i18n.normalizer.interfaces import IIDNormalizer
19-
import jsonlib
19+
import json
2020

2121
_typeURI = URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
2222
_bmOrganDataTypeURI = URIRef('http://edrn.nci.nih.gov/rdf/rdfs/bmdb-1.0.0#BiomarkerOrganData')
@@ -108,7 +108,7 @@ def generateJson(self):
108108
raise RDFIngestException(_('This generator folder lacks one or both of its RDF source URLs.'))
109109
normalizerFunction = queryUtility(IIDNormalizer).normalize
110110
graph = ConjunctiveGraph()
111-
graph.parse(URLInputSource(rdfDataSource))
111+
graph.parse(URLInputSource(rdfDataSource), format='xml')
112112
statements = self._parseRDF(graph)
113113

114114
biomarkerTypeFreq = {}
@@ -141,11 +141,11 @@ def generateJson(self):
141141

142142
# Add organ-specific information
143143
graph = ConjunctiveGraph()
144-
graph.parse(URLInputSource(bmoDataSource))
144+
graph.parse(URLInputSource(bmoDataSource), format='xml')
145145
organStatements = self._parseRDF(graph)
146146
self.addOrganSpecificInformation(allBiomarkers, organStatements, biomarkerOrganFreq)
147147

148148
jsondata = self.generateOrganTypeStats(biomarkerTypeFreq,biomarkerOrganFreq)
149149

150150
# C'est tout.
151-
return jsonlib.write(jsondata)
151+
return json.dumps(jsondata)

0 commit comments

Comments
 (0)