mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-21 18:20:01 +02:00
refactor: improved setup.py
This commit is contained in:
parent
b1bbee16ed
commit
45b6a937b7
@ -12,8 +12,6 @@ bec_lib = f"{current_path}/../bec_lib/"
|
|||||||
__version__ = "0.42.3"
|
__version__ = "0.42.3"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run_install(setup_args: dict, bec_deps: list, editable=False):
|
def run_install(setup_args: dict, bec_deps: list, editable=False):
|
||||||
"""
|
"""
|
||||||
Run the setup function with the given arguments.
|
Run the setup function with the given arguments.
|
||||||
@ -42,17 +40,17 @@ def run_install(setup_args: dict, bec_deps: list, editable=False):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
setup_args = {
|
setup_args_in = {
|
||||||
"entry_points": {"console_scripts": ["bec-scan-server = scan_server:main"]},
|
"entry_points": {"console_scripts": ["bec-scan-server = scan_server:main"]},
|
||||||
"install_requires": ["numpy", "msgpack", "pyyaml", "cytoolz", "rich"],
|
"install_requires": ["numpy", "msgpack", "pyyaml", "cytoolz", "rich"],
|
||||||
"version": __version__,
|
"version": __version__,
|
||||||
"extras_require": {"dev": ["pytest", "pytest-random-order", "coverage", "black", "pylint"]},
|
"extras_require": {"dev": ["pytest", "pytest-random-order", "coverage", "black", "pylint"]},
|
||||||
}
|
}
|
||||||
bec_deps = [
|
bec_deps_in = [
|
||||||
("bec_lib", "bec_lib", bec_lib),
|
("bec_lib", "bec_lib", bec_lib),
|
||||||
]
|
]
|
||||||
is_local = os.path.dirname(os.path.abspath(__file__)).split("/")[-1] == "scan_server"
|
is_local = os.path.dirname(os.path.abspath(__file__)).split("/")[-1] == "scan_server"
|
||||||
is_build = "bdist_wheel" in sys.argv
|
is_build = "bdist_wheel" in sys.argv
|
||||||
|
|
||||||
editable = is_local and not is_build
|
editable_in = is_local and not is_build
|
||||||
run_install(setup_args, bec_deps, editable=editable)
|
run_install(setup_args_in, bec_deps_in, editable=editable_in)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user