Browse Source

Merge release branch updates except for C modules.

Stefano Cossu 5 years ago
parent
commit
0f3335e76b

+ 0 - 5
lakesuperior/model/rdf/graph.pxd

@@ -2,8 +2,6 @@ from libc.stdint cimport uint32_t, uint64_t
 
 from cymem.cymem cimport Pool
 
-cimport lakesuperior.cy_include.collections as cc
-
 from lakesuperior.model.base cimport Key, TripleKey
 from lakesuperior.model.rdf.triple cimport BufferTriple
 from lakesuperior.model.structures.keyset cimport Keyset
@@ -20,9 +18,6 @@ cdef class Graph:
         public Keyset keys
         public object uri
 
-        cc.key_compare_ft term_cmp_fn
-        cc.key_compare_ft trp_cmp_fn
-
         void _match_ptn_callback(
             self, pattern, Graph gr, lookup_callback_fn_t callback_fn,
             bint callback_cond=*, void* ctx=*

+ 0 - 1
lakesuperior/model/rdf/graph.pyx

@@ -8,7 +8,6 @@ from cpython.object cimport Py_LT, Py_EQ, Py_GT, Py_LE, Py_NE, Py_GE
 from libc.string cimport memcpy
 from libc.stdlib cimport free
 
-cimport lakesuperior.cy_include.collections as cc
 cimport lakesuperior.model.callbacks as cb
 cimport lakesuperior.model.structures.keyset as kset
 

+ 0 - 5
lakesuperior/model/rdf/triple.pxd

@@ -1,4 +1,3 @@
-#from lakesuperior.cy_include cimport cytpl as tpl
 from lakesuperior.model.base cimport Buffer
 from lakesuperior.model.rdf.term cimport Term
 
@@ -13,7 +12,3 @@ ctypedef struct BufferTriple:
     Buffer *s
     Buffer *p
     Buffer *o
-
-#cdef:
-#    int serialize(tuple trp, tpl.tpl_bin *data) except -1
-#    tuple deserialize(tpl.tpl_bin data)

+ 0 - 43
lakesuperior/model/rdf/triple.pyx

@@ -1,5 +1,3 @@
-#from lakesuperior.store.ldp_rs cimport term
-
 __doc__ = """
 Triple model.
 
@@ -9,44 +7,3 @@ pointers to :py:model:`lakesuperior.model.rdf.term` objects, and
 ``BufferTriple``, with pointers to byte buffers of serialized terms.
 
 """
-
-
-#cdef int serialize(tuple trp, tpl.tpl_bin *data) except -1:
-#    """
-#    Serialize a triple expressed as a tuple of RDFlib terms.
-#
-#    :param tuple trp: 3-tuple of RDFlib terms.
-#
-#    :rtype: Triple
-#    """
-#    cdef:
-#        Triple strp
-#        Term *s
-#        Term *p
-#        Term *o
-#
-#    strp.s = s
-#    strp.p = p
-#    strp.o = o
-#
-##    term.serialize(s)
-##    term.serialize(p)
-##    term.serialize(o)
-#
-#    return strp
-#
-#
-#cdef tuple deserialize(Triple strp):
-#    """
-#    Deserialize a ``Triple`` structure into a tuple of terms.
-#
-#    :rtype: tuple
-#    """
-#    pass
-##    s = term.deserialize(strp.s.addr, strp.s.sz)
-##    p = term.deserialize(strp.p.addr, strp.p.sz)
-##    o = term.deserialize(strp.o.addr, strp.o.sz)
-##
-##    return s, p, o
-#
-#

+ 54 - 35
setup.py

@@ -82,8 +82,8 @@ extensions = [
             path.join('lakesuperior', 'model', f'base.{ext}'),
         ],
         include_dirs=include_dirs,
-        extra_compile_args=['-fopenmp', '-g'],
-        extra_link_args=['-fopenmp', '-g']
+        #extra_compile_args=['-fopenmp', '-g'],
+        #extra_link_args=['-fopenmp', '-g']
     ),
     Extension(
         'lakesuperior.model.callbacks',
@@ -91,57 +91,69 @@ extensions = [
             path.join('lakesuperior', 'model', f'callbacks.{ext}'),
         ],
         include_dirs=include_dirs,
-        extra_compile_args=['-g'],
-        extra_link_args=['-g'],
-        #extra_compile_args=['-fopenmp'],
-        #extra_link_args=['-fopenmp']
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g'],
     ),
     Extension(
-        'lakesuperior.model.structures.*',
+        'lakesuperior.model.structures.hash',
         [
+            #path.join(spookyhash_src_dir, 'context.c'),
+            #path.join(spookyhash_src_dir, 'globals.c'),
             path.join(spookyhash_src_dir, 'spookyhash.c'),
-            path.join(coll_src_dir, 'common.c'),
-            path.join(coll_src_dir, 'array.c'),
-            path.join(coll_src_dir, 'hashtable.c'),
-            path.join(coll_src_dir, 'hashset.c'),
-            path.join('lakesuperior', 'model', 'structures', f'*.{ext}'),
+            path.join('lakesuperior', 'model', 'structures', f'hash.{ext}'),
         ],
         include_dirs=include_dirs,
-        extra_compile_args=['-fopenmp', '-g'],
-        extra_link_args=['-fopenmp', '-g']
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g']
+    ),
+    Extension(
+        'lakesuperior.model.structures.keyset',
+        [
+            path.join('lakesuperior', 'model', 'structures', f'keyset.{ext}'),
+        ],
+        include_dirs=include_dirs,
+        #extra_compile_args=['-fopenmp', '-g'],
+        #extra_link_args=['-fopenmp', '-g']
     ),
     Extension(
         'lakesuperior.store.base_lmdb_store',
         [
-            path.join(coll_src_dir, 'common.c'),
-            path.join(coll_src_dir, 'array.c'),
-            path.join(coll_src_dir, 'hashtable.c'),
-            path.join(coll_src_dir, 'hashset.c'),
             path.join(tpl_src_dir, 'tpl.c'),
             path.join(lmdb_src_dir, 'mdb.c'),
             path.join(lmdb_src_dir, 'midl.c'),
             path.join('lakesuperior', 'store', f'base_lmdb_store.{ext}'),
         ],
         include_dirs=include_dirs,
-        extra_compile_args=['-g'],
-        extra_link_args=['-g'],
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g'],
     ),
     Extension(
-        'lakesuperior.model.rdf.*',
+        'lakesuperior.model.rdf.term',
         [
             path.join(tpl_src_dir, 'tpl.c'),
-            path.join(spookyhash_src_dir, 'context.c'),
-            path.join(spookyhash_src_dir, 'globals.c'),
-            path.join(spookyhash_src_dir, 'spookyhash.c'),
-            path.join(coll_src_dir, 'common.c'),
-            path.join(coll_src_dir, 'array.c'),
-            path.join(coll_src_dir, 'hashtable.c'),
-            path.join(coll_src_dir, 'hashset.c'),
-            path.join('lakesuperior', 'model', 'rdf', f'*.{ext}'),
+            path.join('lakesuperior', 'model', 'rdf', f'term.{ext}'),
+        ],
+        include_dirs=include_dirs,
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g'],
+    ),
+    Extension(
+        'lakesuperior.model.rdf.triple',
+        [
+            path.join('lakesuperior', 'model', 'rdf', f'triple.{ext}'),
         ],
         include_dirs=include_dirs,
-        #extra_compile_args=['-fopenmp'],
-        #extra_link_args=['-fopenmp']
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g'],
+    ),
+    Extension(
+        'lakesuperior.model.rdf.graph',
+        [
+            path.join('lakesuperior', 'model', 'rdf', f'graph.{ext}'),
+        ],
+        include_dirs=include_dirs,
+        #extra_compile_args=['-g'],
+        #extra_link_args=['-g'],
     ),
     Extension(
         'lakesuperior.store.ldp_rs.lmdb_triplestore',
@@ -156,8 +168,8 @@ extensions = [
                 'lakesuperior', 'store', 'ldp_rs', f'lmdb_triplestore.{ext}'),
         ],
         include_dirs=include_dirs,
-        extra_compile_args=['-g', '-fopenmp'],
-        extra_link_args=['-g', '-fopenmp']
+        #extra_compile_args=['-g', '-fopenmp'],
+        #extra_link_args=['-g', '-fopenmp']
     ),
 ]
 
@@ -192,7 +204,9 @@ if USE_CYTHON:
             'boundscheck': False,
             'wraparound': False,
             'profile': True,
-            'embedsignature': True
+            'embedsignature': True,
+            'linetrace': True,
+            'binding': True,
         }
     )
 
@@ -212,6 +226,8 @@ setup(
 
     ext_modules=extensions,
 
+    zip_safe=False,
+
     # https://pypi.python.org/pypi?%3Aaction=list_classifiers
     classifiers=[
         'Development Status :: 3 - Alpha',
@@ -233,16 +249,19 @@ setup(
         'Operating System :: Microsoft :: Windows',
         'Operating System :: POSIX :: Linux',
 
+        'Programming Language :: Cython',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
 
         'Topic :: Database :: Database Engines/Servers',
+        'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
+        'Topic :: Software Development :: Libraries :: Application Frameworks',
     ],
 
     keywords='repository linked-data',
 
-    python_requires='~=3.6',
+    python_requires='>=3.6',
 
     packages=find_packages(exclude=['contrib', 'docs', 'tests']),