diff --git a/install_dev_deps.py b/install_dev_deps.py index 373b03e..2ff6834 100644 --- a/install_dev_deps.py +++ b/install_dev_deps.py @@ -7,45 +7,47 @@ # Define packages that should be installed via pip instead of conda PIP_PACKAGES = {'build', 'pip-tools'} -def install_dev_deps(): +def install_deps(): # Read pyproject.toml pyproject_path = Path("pyproject.toml") with open(pyproject_path) as f: pyproject = tomlkit.load(f) - # Get dev dependencies + # Get both main and dev dependencies + main_deps = pyproject["project"]["dependencies"] dev_deps = pyproject["project"]["optional-dependencies"]["dev"] + all_deps = main_deps + dev_deps # Split dependencies into conda and pip packages - conda_deps = [dep for dep in dev_deps if dep not in PIP_PACKAGES] - pip_deps = [dep for dep in dev_deps if dep in PIP_PACKAGES] + conda_deps = [dep for dep in all_deps if dep not in PIP_PACKAGES] + pip_deps = [dep for dep in all_deps if dep in PIP_PACKAGES] # Install conda packages if conda_deps: try: - print(f"Installing with mamba: {' '.join(conda_deps)}") + print("Installing with mamba:", ' '.join(conda_deps)) sh.mamba("install", "-y", "-c", "conda-forge", *conda_deps, _err=sys.stderr, _out=sys.stdout) print("Conda installation completed successfully!") except sh.ErrorReturnCode as e: print("Error installing conda packages!") - print(f"Exit code: {e.exit_code}") - print(f"Stdout: {e.stdout.decode() if e.stdout else 'No stdout'}") - print(f"Stderr: {e.stderr.decode() if e.stderr else 'No stderr'}") + print("Exit code:", e.exit_code) + print("Stdout:", e.stdout.decode() if e.stdout else 'No stdout') + print("Stderr:", e.stderr.decode() if e.stderr else 'No stderr') sys.exit(1) # Install pip packages if pip_deps: try: - print(f"\nInstalling with pip: {' '.join(pip_deps)}") + print("\nInstalling with pip:", ' '.join(pip_deps)) sh.pip("install", *pip_deps, _err=sys.stderr, _out=sys.stdout) print("Pip installation completed successfully!") except sh.ErrorReturnCode as e: print("Error installing pip packages!") - print(f"Exit code: {e.exit_code}") - print(f"Stdout: {e.stdout.decode() if e.stdout else 'No stdout'}") - print(f"Stderr: {e.stderr.decode() if e.stderr else 'No stderr'}") + print("Exit code:", e.exit_code) + print("Stdout:", e.stdout.decode() if e.stdout else 'No stdout') + print("Stderr:", e.stderr.decode() if e.stderr else 'No stderr') sys.exit(1) if __name__ == "__main__": - install_dev_deps() \ No newline at end of file + install_deps() \ No newline at end of file