Skip to content

Commit 4aaac8d

Browse files
lorenzo-cavazzijsam
authored andcommitted
feat: python 3.8 compatibility (#861)
* chore: update library and ci config for python 3.8 compatibility * fix: python3.8 deps update and rdflib patch * chore: set pipenv default to version 3.7
1 parent b357ee7 commit 4aaac8d

File tree

8 files changed

+266
-269
lines changed

8 files changed

+266
-269
lines changed

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
max-parallel: 4
1313
matrix:
14-
python-version: [3.6, 3.7]
14+
python-version: [3.6, 3.7, 3.8]
1515
steps:
1616
- uses: actions/checkout@master
1717
- name: Set up Python ${{ matrix.python-version }}
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
max-parallel: 4
3434
matrix:
35-
python-version: [3.6, 3.7]
35+
python-version: [3.6, 3.7, 3.8]
3636
steps:
3737
- uses: actions/checkout@master
3838
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: [3.6, 3.7]
11+
python-version: [3.6, 3.7, 3.8]
1212
steps:
1313
- uses: actions/checkout@master
1414
- name: Set up Python ${{ matrix.python-version }}
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
max-parallel: 4
3030
matrix:
31-
python-version: [3.6, 3.7]
31+
python-version: [3.6, 3.7, 3.8]
3232
steps:
3333
- uses: actions/checkout@master
3434
- name: Set up Python ${{ matrix.python-version }}
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
max-parallel: 4
5151
matrix:
52-
python-version: [3.6, 3.7]
52+
python-version: [3.6, 3.7, 3.8]
5353
steps:
5454
- uses: actions/checkout@master
5555
- name: Set up Python ${{ matrix.python-version }}

Pipfile.lock

Lines changed: 238 additions & 254 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renku/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
option_use_external_storage
9292
from renku.core.commands.version import check_version, print_version
9393
from renku.core.management.client import LocalClient
94-
from renku.core.management.config import ConfigManagerMixin, RENKU_HOME
94+
from renku.core.management.config import RENKU_HOME, ConfigManagerMixin
9595
from renku.core.management.repository import default_path
9696

9797
#: Monkeypatch Click application.

renku/core/commands/checks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .githooks import check_git_hooks_installed
2121
from .migration import check_dataset_metadata, check_missing_files
2222
from .references import check_missing_references
23-
from .validate_shacl import check_project_structure, check_datasets_structure
23+
from .validate_shacl import check_datasets_structure, check_project_structure
2424

2525
# Checks will be executed in the order as they are listed in __all__.
2626
# They are mostly used in ``doctor`` command to inspect broken things.

renku/core/commands/format/graph.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ def _rdf2dot_reduced(g, stream):
199199
Adapted from original source:
200200
https://rdflib.readthedocs.io/en/stable/_modules/rdflib/tools/rdf2dot.html
201201
"""
202-
import cgi
202+
import html
203203
import collections
204-
205204
import rdflib
206205

207206
from rdflib.tools.rdf2dot import LABEL_PROPERTIES, NODECOLOR
@@ -228,7 +227,7 @@ def label(x, g):
228227

229228
def formatliteral(l, g):
230229
"""Format and escape literal."""
231-
v = cgi.escape(l)
230+
v = html.escape(l)
232231
if l.datatype:
233232
return '"%s"^^%s' % (v, qname(l.datatype, g))
234233
elif l.language:
@@ -268,11 +267,11 @@ def color(p):
268267
continue
269268
# inject the type predicate into the node itself
270269
if p == rdflib.RDF.type:
271-
types[sn].add((qname(p, g), cgi.escape(o)))
270+
types[sn].add((qname(p, g), html.escape(o)))
272271
continue
273272
# add the project membership to the node
274273
if p == rdflib.term.URIRef('schema:isPartOf'):
275-
fields[sn].add((qname(p, g), cgi.escape(o)))
274+
fields[sn].add((qname(p, g), html.escape(o)))
276275
continue
277276

278277
if isinstance(o, (rdflib.URIRef, rdflib.BNode)):

renku/core/compat.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
# limitations under the License.
1818
"""Compatibility layer for different Python versions."""
1919

20+
import cgi
2021
import contextlib
22+
import html
2123
import json
2224
import os
2325
import sys
@@ -87,4 +89,12 @@ def set(self, active_ctx, local_ctx, result):
8789

8890
pyld.jsonld._cache = {'activeCtx': PatchedActiveContextCache()}
8991

90-
__all__ = ('FileNotFoundError', 'Path', 'contextlib', 'pyld')
92+
cgi.escape = html.escape
93+
94+
__all__ = (
95+
'FileNotFoundError',
96+
'Path',
97+
'contextlib',
98+
'pyld',
99+
'cgi',
100+
)

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
'click-completion>=0.5.0',
7878
'click>=7.0',
7979
'cryptography>=2.7',
80-
'cwltool==1.0.20181012180214',
80+
'cwltool==1.0.20191206125148',
8181
'environ_config>=18.2.0',
8282
'filelock>=3.0.0',
8383
'gitpython==3.0.3',
@@ -90,6 +90,7 @@
9090
'pyshacl>=0.11.3.post1',
9191
'python-dateutil>=2.6.1',
9292
'python-editor>=1.0.4',
93+
'rdflib==4.2.2',
9394
'rdflib-jsonld>=0.4.0',
9495
'requests>=2.21.0',
9596
'ndg-httpsclient>=0.5.1',
@@ -172,6 +173,7 @@ def _get_disribution_url():
172173
classifiers=[
173174
'Environment :: Web Environment',
174175
'Intended Audience :: Developers',
176+
'Intended Audience :: Science/Research',
175177
'License :: OSI Approved :: Apache Software License',
176178
'Operating System :: OS Independent',
177179
'Programming Language :: Python',
@@ -180,6 +182,8 @@ def _get_disribution_url():
180182
'Programming Language :: Python :: 3',
181183
'Programming Language :: Python :: 3.5',
182184
'Programming Language :: Python :: 3.6',
183-
'Development Status :: 1 - Planning',
185+
'Programming Language :: Python :: 3.7',
186+
'Programming Language :: Python :: 3.8',
187+
'Development Status :: 4 - Beta',
184188
],
185189
)

0 commit comments

Comments
 (0)