From b2a9e3ac896bad6f5e8faaaf19ff3d8a95984bd5 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas.kluyver@xfel.eu>
Date: Fri, 8 Nov 2024 15:22:23 +0000
Subject: [PATCH] Specify index to get packages from for repeating calibration

---
 setup.py                     | 2 +-
 src/xfel_calibrate/repeat.py | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 69705f2e2..65fda681b 100644
--- a/setup.py
+++ b/setup.py
@@ -62,7 +62,7 @@ install_requires = [
         "docutils==0.20.1",
         "dynaconf==3.2.4",
         "dynflatfield==1.1.0",
-        "env_cache==0.1",
+        "env_cache @ git+https://github.com/European-XFEL/env-cache.git@69e2117025b3a729d06d7c7f70d6c10a571353dc",  # TODO: release
         "extra_data==1.16.0",
         "extra_geom==1.11.0",
         "gitpython==3.1.42",
diff --git a/src/xfel_calibrate/repeat.py b/src/xfel_calibrate/repeat.py
index e9939b5d3..4f31f3b58 100644
--- a/src/xfel_calibrate/repeat.py
+++ b/src/xfel_calibrate/repeat.py
@@ -14,6 +14,10 @@ from .calibrate import (
     JobChain, SlurmOptions, run_finalize, get_pycalib_version,
 )
 
+# Python package index, including our internal packages
+INDEX_URL = "https://git.xfel.eu/api/v4/groups/501/-/packages/pypi/simple"
+
+
 # This function is copied and modified from Python 3.8.10
 # Copyright © 2001-2022 Python Software Foundation; All Rights Reserved
 # Used under the PSF license - https://docs.python.org/3/license.html
@@ -74,7 +78,7 @@ def get_python(args, py_version):
         reqs = (args.from_dir / 'requirements.txt').read_text('utf-8')
         reqs = munge_requirements(reqs)
         env_mgr = EnvsManager(
-            Path(args.env_cache), PyenvEnvMaker()
+            Path(args.env_cache), PyenvEnvMaker(), index_url=INDEX_URL,
         )
         return env_mgr.get_env(py_version, reqs).resolve() / 'bin' / 'python'
     elif args.python:
-- 
GitLab