From ef129f665a71bc2d28fdb1401b59b720ea7dde6d Mon Sep 17 00:00:00 2001 From: Pierre Schnizer Date: Wed, 10 Jul 2024 17:50:48 +0200 Subject: [PATCH 1/2] [TASK] use simplified installation pip does the job ... just list the names --- .github/workflows/python-package.yml | 22 ++-------- ...opment_install.py => list_package_names.py | 42 ++++--------------- 2 files changed, 11 insertions(+), 53 deletions(-) rename development_install.py => list_package_names.py (61%) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d85f622..31ff8c6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -30,27 +30,13 @@ jobs: cache-dependency-path: | **/setup.cfg **/requirements*.txt - - name: Install dependencies + - name: Install dependencies and packages run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip wheel setuptools python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + python -m pip install `python list_package_names.py` - # deliberatly not installing core/archiver - # needs some extra steps. should be loaded from pypi - # mls bluesky not yet a package - for tdir in core/math-utils core/device-models core/analysis \ - custom/bact-bessyii-mls-ophyd \ - custom/mls/ophyd \ - custom/bessyii/ophyd custom/bessyii/bluesky \ - custom/bessyii/analysis custom/bessyii/bessyii-dashboard - do - pushd $tdir - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip3 install . - popd - done - - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/development_install.py b/list_package_names.py similarity index 61% rename from development_install.py rename to list_package_names.py index fd80160..d9a1b66 100644 --- a/development_install.py +++ b/list_package_names.py @@ -20,34 +20,11 @@ def find_package_dirs(t_dir: str): return list(package_dirs) -def build_wheel(directory, wheel_directory): - subprocess.run(["pip3", "wheel", "-v", "-w", wheel_directory, directory], check=True) - - -def run_command(directory): - "Run the installation command in the specified directory" - requirements = os.path.join(directory, "requirements.txt") - has_requirements = False - try: - os.stat(requirements) - has_requirements = True - except FileNotFoundError: - pass - - if has_requirements: - try: - subprocess.run(["pip3", "install", "-r", requirements], check=True) - - except subprocess.CalledProcessError as e: - print(f"Error occurred while installing package requirements {requirements}: {e}") - - try: - subprocess.run(["pip3", "install", "-e", directory], check=True) - except subprocess.CalledProcessError as e: - print(f"Error occurred while installing package in {directory}: {e}") - - class PackageKey: + """Priorise base packages + + Hand coded what dependencies we have along the line + """ def __init__(self): self.counter = count() self.core_custom_values = dict(core=1000, custom=5000) @@ -81,15 +58,10 @@ def __call__(self, package_dirs: str): def main(): """Traverse directories executing install for appropriate ones""" package_dirs = list(find_package_dirs("core/") + find_package_dirs("custom/")) - package_dirs.sort(key=PackageKey()) - - print(package_dirs) - # for t_dir in package_dirs: - # print(t_dir) - # build_wheel(t_dir, "wheels/") + package_dirs.sort() + # package_dirs.sort(key=PackageKey()) - for t_dir in package_dirs: - run_command(t_dir) + print(" ".join([f"{t_dir}/" for t_dir in package_dirs])) if __name__ == "__main__": From 0741bdf764d0f2d1e9d9034d470c65f4a2a88f22 Mon Sep 17 00:00:00 2001 From: Pierre Schnizer Date: Wed, 10 Jul 2024 17:52:46 +0200 Subject: [PATCH 2/2] [TASK] removed local archiver linked a second time add proper one --- custom/mls/archiver | 1 - 1 file changed, 1 deletion(-) delete mode 160000 custom/mls/archiver diff --git a/custom/mls/archiver b/custom/mls/archiver deleted file mode 160000 index 9becfb0..0000000 --- a/custom/mls/archiver +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9becfb0b094e9c4978d60f9682f0a415af41a6df