Skip to content

Commit

Permalink
Merge pull request #27 from eea/develop
Browse files Browse the repository at this point in the history
Develop #111217
  • Loading branch information
Petchesi-Iulian committed Aug 3, 2020
2 parents 9ace689 + a881819 commit d791405
Show file tree
Hide file tree
Showing 14 changed files with 428 additions and 201 deletions.
14 changes: 5 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,35 +107,31 @@ pipeline {

"KGS": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-kgs" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/kgs-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
sh '''docker pull eeacms/kgs-devel;docker run -i --rm --name="$BUILD_TAG-kgs" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/kgs-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
}
},

"Plone4": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-plone4" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:4 -v -vv -s $GIT_NAME'''
sh '''docker pull eeacms/plone-test:4;docker run -i --rm --name="$BUILD_TAG-plone4" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:4 -v -vv -s $GIT_NAME'''
}
},

"Plone5 & Python2": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-plone5py2" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5 -v -vv -s $GIT_NAME'''
sh '''docker pull eeacms/plone-test:5;docker run -i --rm --name="$BUILD_TAG-plone5py2" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5 -v -vv -s $GIT_NAME'''
}
},

"Plone5 & Python3": {
node(label: 'docker') {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
sh '''docker run -i --rm --name="$BUILD_TAG-plone5py3" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
}
sh '''docker pull eeacms/plone-test:5-python3;docker run -i --rm --name="$BUILD_TAG-plone5py3" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
}
},

"PloneSaaS": {
node(label: 'docker') {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
sh '''docker run -i --rm --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
}
sh '''docker pull eeacms/plonesaas-devel;docker run -i --rm --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME'''
}
}

Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Literals. These can take a data type or a language code.
Blank node. Similar to IRI but lacks a stable identifier.

Query utilities
===============

``class sparql.Service(endpoint, qs_encoding='utf-8')``

Expand Down
1 change: 0 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

9 changes: 8 additions & 1 deletion docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
Changelog
=========

3.8 - (2020-06-17)
---------------------------
* Bug fix: fixed Python3 query execution
[alecghica refs #111217]
* Feature: PEP8 and linting
[alecghica refs #111217]

3.7 - (2020-06-17)
---------------------------
* Feature: added the documentation originally found under eionet.euripa.eu
* Feature: added the documentation originally found under eionet.europa.eu
[alecghica refs #111217]

3.6 - (2020-03-03)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from sparql import __version__ as version

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']

Expand All @@ -9,7 +10,6 @@
project = u'sparql-client'
copyright = u'2011, European Environment Agency'

from sparql import __version__ as version
release = version

exclude_patterns = ['_build']
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
setup(name=NAME,
version=VERSION,
description='Python API to query a SPARQL endpoint',
long_description = open('README.rst').read() + "\n\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
long_description=open('README.rst').read() + "\n\n" + \
open(os.path.join("docs", "HISTORY.txt")).read(),
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 2.7",
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand All @@ -26,9 +28,11 @@
long_description_content_type='text/x-rst',
url='https://github.com/eea/sparql-client',
license="MPL",
py_modules =['sparql'],
py_modules=['sparql'],
install_requires=[
'eventlet', 'six'
'eventlet',
'six',
'dnspython < 2.0.0',
],
extras_require={
'test': [
Expand Down
25 changes: 17 additions & 8 deletions sparql-client/tests/genquery.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error,six.moves.urllib.request,six.moves.urllib.error,six.moves.urllib.parse
import six.moves.urllib.request
import six.moves.urllib.parse
import six.moves.urllib.error
import six.moves.urllib.request
import six.moves.urllib.error
import six.moves.urllib.parse

statement = open("code.rq").read()
query = { 'query': statement,
'format':'xml' }
statement = open('code.rq').read()
query = {'query': statement, 'format': 'xml'}

qs = six.moves.urllib.parse.urlencode(query)
print(qs)
url = "http://dbpedia.org/sparql?" + six.moves.urllib.parse.urlencode(query)
url = 'http://dbpedia.org/sparql?' \
+ six.moves.urllib.parse.urlencode(query)

opener = six.moves.urllib.request.build_opener(six.moves.urllib.request.HTTPHandler)
opener = \
six.moves.urllib.request.build_opener(six.moves.urllib.request.HTTPHandler)
six.moves.urllib.request.install_opener(opener)
req = six.moves.urllib.request.Request(url)
#req.add_header("Accept", "application/xml")

# req.add_header("Accept", "application/xml")

try:
conn = six.moves.urllib.request.urlopen(req, timeout=10)
except Exception:
conn = None

if not conn:
raise IOError("Failure in open")
raise IOError('Failure in open')

data = conn.read()
conn.close()
Expand Down
2 changes: 1 addition & 1 deletion sparql-client/tests/testconversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import unittest
from datetime import datetime, date, time
import sparql
import os.path
import sparql
from mock import Mock, patch
from six.moves import map

Expand Down
Loading

0 comments on commit d791405

Please sign in to comment.