Commit 2d33fbf9 authored by Romain Casati's avatar Romain Casati
Browse files

Main setup.py: better ressource lookup.

parent 31e278e6
......@@ -29,9 +29,9 @@ command = sys.argv[1]
if command == "sdist":
# use version number for cache busting
src_dest = ((root_dir / "src" / "basthon-js", '.'),
(root_dir / "src" / "basthon-py" / "build", Path(BASTHON_KERNEL_VERSION) / "basthon-py"),
(root_dir / "src" / "modules", Path(BASTHON_KERNEL_VERSION) / "modules"))
src_dest = ((root_dir / "src" / "basthon-js", ('*.js', '*.js.map'), '.'),
(root_dir / "src" / "basthon-py" / "build", ('*.js', '*.data'), Path(BASTHON_KERNEL_VERSION) / "basthon-py"),
(root_dir / "src" / "modules", ('*.whl', 'extern/*'), Path(BASTHON_KERNEL_VERSION) / "modules"))
# before creating the distribution, copy files from other locations in
# the repository
......@@ -42,13 +42,13 @@ if command == "sdist":
# copy files from basthon into data_dir
content = []
for src, dest in src_dest:
for path in src.rglob("*"):
exts = ('.js', '.map', '.data') if path.parent == src else ('.whl',)
if path.is_file() and path.suffix in exts:
dst = data_dir / dest / path.name
dst.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(path, dst)
for src, globs, dest in src_dest:
for glob in globs:
for path in src.rglob(glob):
if path.is_file():
dst = data_dir / dest / path.name
dst.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(path, dst)
setup(
name='basthon-kernel',
......
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