Changeset View
Changeset View
Standalone View
Standalone View
setup.py
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | def run(self): | ||||
# starts running | # starts running | ||||
from tree_sitter import Language | from tree_sitter import Language | ||||
Language.build_library(os.path.join(static_dir, "swh_ql.so"), [ql_dir]) | Language.build_library(os.path.join(static_dir, "swh_ql.so"), [ql_dir]) | ||||
print("swh_ql.so file generated") | print("swh_ql.so file generated") | ||||
class TSBuildCommand(TSCommand): | class TSBuildCommand(TSCommand): | ||||
description = "Builds swh_ql.so and swh_ql.wasm" | description = "Builds swh_ql.so" | ||||
def run(self): | def run(self): | ||||
self.run_command("ts_build_so") | self.run_command("ts_build_so") | ||||
class custom_build(build): | class custom_build(build): | ||||
def run(self): | def run(self): | ||||
super().run() | super().run() | ||||
Show All 13 Lines | def make_release_tree(self, base_dir, files): | ||||
copy_ql_tree(dist_ql_path) | copy_ql_tree(dist_ql_path) | ||||
generate_parser(dist_ql_path) | generate_parser(dist_ql_path) | ||||
class custom_develop(develop): | class custom_develop(develop): | ||||
def run(self): | def run(self): | ||||
super().run() | super().run() | ||||
if not self.dry_run: | if not self.dry_run: | ||||
self.run_command("ts_install") | |||||
generate_parser("swh/search/query_language") | generate_parser("swh/search/query_language") | ||||
def copy_ql_tree(dest_path): | def copy_ql_tree(dest_path): | ||||
# FIXME: setuptools should copy this itself... | # FIXME: setuptools should copy this itself... | ||||
print("Copying parser files") | print("Copying parser files") | ||||
if os.path.exists(dest_path): | if os.path.exists(dest_path): | ||||
shutil.rmtree(dest_path) | shutil.rmtree(dest_path) | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |