Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
dataprocessing
Commits
d327cb7d3702
Commit
a52efa3f
authored
Oct 19, 2021
by
François Ferry
Browse files
feat(2to3): remove six dependencie
parent
40d0a4586fb2
Changes
5
Hide whitespace changes
Inline
Side-by-side
cubicweb_dataprocessing/__pkginfo__.py
View file @
d327cb7d
...
...
@@ -15,7 +15,6 @@ description = "Data validation and transformation process"
web
=
"http://www.cubicweb.org/project/%s"
%
distname
__depends__
=
{
"six"
:
">= 1.4.0"
,
"cubicweb"
:
">= 3.24.0.dev0"
,
"cubicweb-file"
:
None
,
}
...
...
cubicweb_dataprocessing/entities.py
View file @
d327cb7d
...
...
@@ -15,9 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-dataprocessing entity's classes"""
from
six
import
text_type
import
json
from
subprocess
import
Popen
,
PIPE
,
list2cmdline
import
sys
...
...
@@ -78,7 +75,7 @@ class DataProcessAdapter(EntityAdapter):
if
parameters
:
params
=
json
.
loads
(
parameters
)
for
pname
,
pvalue
in
list
(
params
.
items
()):
if
not
isinstance
(
pvalue
,
text_type
):
if
not
isinstance
(
pvalue
,
str
):
raise
ValueError
(
'invalid parameter value for "{0}": {1}, '
"must be a string"
.
format
(
pname
,
pvalue
)
...
...
test/__init__.py
View file @
d327cb7d
"""cubicweb-dataprocessing tests"""
from
six
import
text_type
from
cubicweb
import
Binary
import
codecs
...
...
@@ -25,7 +23,7 @@ def script_from_code(cnx, kind, code, name, **kwargs):
def
script_from_file
(
cnx
,
kind
,
fpath
,
**
kwargs
):
"""Build a Script entity from the content of file at `fpath`."""
name
=
text_type
(
fpath
)
name
=
str
(
fpath
)
with
codecs
.
open
(
fpath
)
as
f
:
return
script_from_code
(
cnx
,
kind
,
f
.
read
(),
name
)
...
...
test/unittest_entities.py
View file @
d327cb7d
...
...
@@ -4,8 +4,6 @@
import
json
import
unittest
from
six
import
text_type
from
cubicweb.devtools.testlib
import
CubicWebTC
from
cubicweb_dataprocessing.entities
import
process_type_from_etype
...
...
@@ -81,7 +79,7 @@ class DataProcessAdapterTC(CubicWebTC):
with
self
.
admin_access
.
repo_cnx
()
as
cnx
:
script
=
script_from_file
(
cnx
,
"transformation"
,
self
.
datapath
(
"iconv.py"
))
parameters
=
json
.
dumps
(
params
)
if
not
isinstance
(
parameters
,
text_type
):
if
not
isinstance
(
parameters
,
str
):
parameters
=
parameters
.
decode
(
"utf-8"
)
proc
=
create_process
(
cnx
,
"DataTransformationProcess"
,
script
,
parameters
=
parameters
...
...
test/unittest_schema.py
View file @
d327cb7d
"""cubicweb-dataprocessing unit tests for schema"""
from
six
import
text_type
from
cubicweb
import
ValidationError
from
cubicweb.devtools
import
testlib
...
...
@@ -44,11 +39,11 @@ class TransformationSequenceTC(testlib.CubicWebTC):
cnx
.
commit
()
cnx
.
rollback
()
self
.
assertIn
(
"index is part of violated unicity constraint"
,
text_type
(
cm
.
exception
)
"index is part of violated unicity constraint"
,
str
(
cm
.
exception
)
)
self
.
assertIn
(
"in_sequence is part of violated unicity constraint"
,
text_type
(
cm
.
exception
),
str
(
cm
.
exception
),
)
# Distinct indices: OK.
cnx
.
create_entity
(
...
...
@@ -81,11 +76,11 @@ class TransformationSequenceTC(testlib.CubicWebTC):
cnx
.
rollback
()
self
.
assertIn
(
"step_script is part of violated unicity constraint"
,
text_type
(
cm
.
exception
),
str
(
cm
.
exception
),
)
self
.
assertIn
(
"in_sequence is part of violated unicity constraint"
,
text_type
(
cm
.
exception
),
str
(
cm
.
exception
),
)
# Distinct indices: OK.
cnx
.
create_entity
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment