Commit b957c72d authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[pkg] Move to cube as package layout

Closes #17133722.
parent 448195d9bbf2
include tox.ini test-requirements.txt
include *.py
include */*.py
include test/data/*
recursive-include data *.gif *.png *.ico *.css *.js
recursive-include i18n *.po *.pot
recursive-include wdoc *
recursive-include cubicweb_skos *.py
recursive-include cubicweb_skos/i18n *.po *.pot
recursive-include test/data bootstrap_cubes *.py *.csv *.n3 *.rdf *.xml
include *.ini
include test-requirements.txt
prune cubicweb-skos.spec
prune debian
......@@ -35,14 +35,11 @@ find . -name '*.py' -type f -print0 | xargs -0 sed -i '1,3s;^#!.*python.*$;#! /
%endif
%install
NO_SETUPTOOLS=1 %{__python} setup.py --quiet install --no-compile --prefix=%{_prefix} --root="$RPM_BUILD_ROOT"
# remove generated .egg-info file
rm -rf $RPM_BUILD_ROOT/usr/lib/python*
%{__python} setup.py --quiet install --no-compile --prefix=%{_prefix} --root="$RPM_BUILD_ROOT"
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%{_prefix}/share/cubicweb/cubes/*
%{_python_sitelib}/*
# pylint: disable=W0622
"""cubicweb-skos application packaging information"""
modname = 'skos'
modname = 'cubicweb_skos'
distname = 'cubicweb-skos'
numversion = (1, 2, 2)
......@@ -13,8 +14,9 @@ author_email = 'contact@logilab.fr'
description = '"SKOS implementation for cubicweb"'
web = 'http://www.cubicweb.org/project/%s' % distname
__depends__ = {
__depends__ = {
'cubicweb': '>= 3.24.0',
'six': '>= 1.4.0',
}
__recommends__ = {
'rdflib': '>= 4.1',
......@@ -26,28 +28,4 @@ classifiers = [
'Framework :: CubicWeb',
'Programming Language :: Python',
'Programming Language :: JavaScript',
]
from os import listdir as _listdir
from os.path import join, isdir
from glob import glob
THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname)
def listdir(dirpath):
return [join(dirpath, fname) for fname in _listdir(dirpath)
if fname[0] != '.' and not fname.endswith('.pyc')
and not fname.endswith('~')
and not isdir(join(dirpath, fname))]
data_files = [
# common files
[THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
]
# check for possible extended cube layout
for dname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'wdoc', 'i18n', 'migration'):
if isdir(dname):
data_files.append([join(THIS_CUBE_DIR, dname), listdir(dname)])
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
]
......@@ -26,8 +26,12 @@ from cubicweb.cwctl import CWCTL
from cubicweb.utils import admincnx
from cubicweb.dataimport.importer import SimpleImportLog
from cubes.skos import rdfio
from cubes.skos.sobjects import graph_extentities, import_skos_extentities, lcsv_extentities
from cubicweb_skos import rdfio
from cubicweb_skos.sobjects import (
graph_extentities,
import_skos_extentities,
lcsv_extentities,
)
def _massive_store_factory(cnx, config, **kwargs):
......
......@@ -24,9 +24,9 @@ from cubicweb.view import EntityAdapter
from cubicweb.entities import AnyEntity, fetch_config
from cubicweb.entities.adapters import ITreeAdapter
from cubes import skos
from cubes.skos import rdfio
from cubes.skos.rdfio import unicode_with_language as ul
import cubicweb_skos as skos
from cubicweb_skos import rdfio
from cubicweb_skos.rdfio import unicode_with_language as ul
def _add_concept(scheme, label, language_code, kind=u'preferred', **kwargs):
......
......@@ -23,7 +23,7 @@ from cubicweb import _
from cubicweb.server import hook
from cubicweb.predicates import is_instance
from cubes.skos.dataimport import dump_relations
from cubicweb_skos.dataimport import dump_relations
class CreateRelationsOp(hook.DataOperationMixIn, hook.Operation):
......
......@@ -22,8 +22,8 @@ from six import text_type
from cubicweb import _
from cubicweb.dataimport import ucsvreader
from cubes.skos import rdfio
from cubes.skos.rdfio import unicode_with_language as ul
from cubicweb_skos import rdfio
from cubicweb_skos.rdfio import unicode_with_language as ul
class InvalidLCSVFile(RuntimeError):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment