diff --git a/script/test-user b/script/test-user index 04dfce62..fcc4ce09 100755 --- a/script/test-user +++ b/script/test-user @@ -65,11 +65,19 @@ test() { --requirements /tmp/requirements.txt \ --override /tmp/override.txt - read -r -d '' SCRIPT << EOF || : + if [ -z "$version" ]; then + # Packages with no __version__, skip version check + read -r -d '' SCRIPT << EOF || : +import $package +print('PASS: requirements $requirements') +EOF + else + read -r -d '' SCRIPT << EOF || : import $package assert $package.__version__ == '$version', f'$package.__version__ is not $version: {$package.__version__}' print('PASS: requirements $requirements') EOF + fi docker run --rm \ --volume "$PWD/src/monobase:/opt/r8/monobase:ro" \ @@ -106,9 +114,18 @@ test requests 2.28.1 'git+https://github.com/psf/requests@4d394574f5555a8ddcc38f # Local files rm -rf build/src/requests* + curl -fsSL 'https://github.com/psf/requests/releases/download/v2.28.1/requests-2.28.1-py3-none-any.whl' -o build/src/requests-2.28.1-py3-none-any.whl test requests 2.28.1 './requests-2.28.1-py3-none-any.whl' +test requests 2.28.1 '/src/requests-2.28.1-py3-none-any.whl' + curl -fsSL 'https://github.com/psf/requests/archive/4d394574f5555a8ddcc38f707e0c9f57f55d9a3b.zip' -o build/src/requests.zip test requests 2.28.1 './requests.zip' +test requests 2.28.1 '/src/requests.zip' + git clone --depth 1 --branch v2.28.1 https://github.com/psf/requests.git build/src/requests.git test requests 2.28.1 './requests.git' +test requests 2.28.1 '/src/requests.git' + +# youtokentome requires cython, has no __version__ +test youtokentome '' youtokentome==1.0.6 diff --git a/src/monobase/monogen.py b/src/monobase/monogen.py index 32f3ace8..9396435a 100644 --- a/src/monobase/monogen.py +++ b/src/monobase/monogen.py @@ -21,11 +21,16 @@ def otel_attributes(self): return {f'monogen_{k}': str(v) for k, v in self.__dict__.items()} -# uv venv --seed does not install deprecated setuptools or wheel for Python 3.12 -# Packaging is needed for flash-attn, etc. -# Explicitly declare them here -# Versions are not pinned and we will use whatever Torch index has -SEED_PKGS = ['pip', 'packaging', 'setuptools', 'wheel'] +# Common build dependencies when installing packages in user layer +# Base layer is exposed in PYTHONPATH so we don't need to install the same +# pacakges in user layer with --no-build-isolation +SEED_PKGS = [ + 'cython', + 'pip', + 'packaging', + 'setuptools', + 'wheel', +] TEST_MONOGENS: list[MonoGen] = [ MonoGen(