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

[pkg] Properly export data files in and adjust "newcube" test

With the new package layout (everything under "cubicweb" package), the custom
install_lib rule which makes use of include_dirs defined in did
not prepend the package name to source directories to be copied. Fixing this.

Also, in's export() function, the destination directories' path to be
created during source tree walk was wrong.

All this makes cubicweb/skeleton directory (which is not a package) properly
installed by

The test in cubicweb/devtools/test/ wasn't properly
implemented because it used an installation of cubicweb in "develop" mode
which shadows such packaging issues. Also it used "python -m cubicweb" instead
of directly "cubicweb-ctl" and the former appears to fall back to using the
cubicweb package *from sources* instead of the installed one.

Now that this test runs against the installed version of cubicweb, fix to include tox.ini files (cubicweb's and skeleton's) as this is
expected from the test.

Closes #14127941.

branch : 3.23
parent 06bcb7e7a69c
......@@ -2,6 +2,7 @@ include README
include COPYING
include pylintrc
include tox.ini
include bin/cubicweb-*
include man/cubicweb-ctl.1
......@@ -41,7 +42,7 @@ recursive-include cubicweb/etwist/test/data *.py
recursive-include cubicweb/web/test/jstests *.js *.html *.css *.json
recursive-include cubicweb/web/test/windmill *.py
recursive-include cubicweb/skeleton *.py *.css *.js *.po compat *.in *.tmpl rules
recursive-include cubicweb/skeleton *.py *.css *.js *.po compat *.in *.tmpl rules tox.ini
prune doc/book/en/.static
prune doc/book/fr/.static
......@@ -27,8 +27,7 @@ from unittest import TestCase
def newcube(directory, name):
cmd = [sys.executable, '-m' 'cubicweb', 'newcube',
'--directory', directory, name]
cmd = ['cubicweb-ctl', 'newcube', '--directory', directory, name]
proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT)
stdout, _ = proc.communicate(b'short_desc\n')
return proc.returncode, stdout
......@@ -131,7 +131,8 @@ def export(from_dir, to_dir,
if verbose:
print('not recursing in %s' % join(dirpath, norecurs))
for dirname in dirnames:
dest = join(to_dir, dirname)
src = join(dirpath, dirname)
dest = to_dir + src[len(from_dir):]
if not exists(dest):
if verbose:
print('creating %s directory' % dest)
......@@ -162,8 +163,9 @@ class MyInstallLib(install_lib.install_lib):
# manually install included directories if any
if include_dirs:
for directory in include_dirs:
dest = join(self.install_dir, modname, directory)
export(directory, dest, verbose=self.verbose)
src = join(modname, directory)
dest = join(self.install_dir, src)
export(src, dest, verbose=self.verbose)
# write required share/cubicweb/cubes/
class MyInstallData(install_data.install_data):
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