Skip to content

Commit

Permalink
no build deps for packages that need numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
R7L208 committed Apr 28, 2024
1 parent e4e8f6a commit 59171a5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 18 deletions.
1 change: 0 additions & 1 deletion python/requirements/dbr104/.gitignore

This file was deleted.

4 changes: 4 additions & 0 deletions python/requirements/dbr104/dbr104_arm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy~=1.20.1
delta-spark~=1.1.0
ipython~=7.22.0
pyspark~=3.2.1
36 changes: 36 additions & 0 deletions python/requirements/dbr104/install_non_dev_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -e # Exit on error
[ -n "$DEBUG" ] && set -x # Enable debugging if DEBUG environment variable is set

# This runs from the root of the repository
ARM_REQ_FILE="$(pwd)/requirements/dbr104/dbr104_arm.txt"
GENERIC_REQ_FILE="$(pwd)/requirements/dbr104/dbr104.txt"

# Check necessary commands and files
command -v pip >/dev/null 2>&1 || { echo >&2 "pip is required but it's not installed. Aborting."; exit 1; }
[ -f "$ARM_REQ_FILE" ] || { echo >&2 "Required file $ARM_REQ_FILE not found. Aborting."; exit 1; }
[ -f "$GENERIC_REQ_FILE" ] || { echo >&2 "Required file $GENERIC_REQ_FILE not found. Aborting."; exit 1; }

# Get the architecture of the system
sys_arch=$(uname -m)
echo "System Architecture: $sys_arch"

echo "Upgrading pip..."
pip install --upgrade pip

case "$sys_arch" in
arm*)
echo "ARM Architecture detected. Specific model: $sys_arch"
echo "Installing ARM-specific dependencies..."
pip install -r "$ARM_REQ_FILE"
pip install --no-deps pandas~=1.2.4
pip install --no-deps pyarrow~=4.0.0
pip install --no-deps scipy~=1.6.2
;;
*)
echo "Non-ARM Architecture: $sys_arch"
echo "Installing generic dependencies..."
pip install -r "$GENERIC_REQ_FILE"
;;
esac
10 changes: 0 additions & 10 deletions python/requirements/dbr104/set_install_command.sh

This file was deleted.

10 changes: 3 additions & 7 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ commands =
coverage run -m unittest discover -s tests -p '*_tests.py'

[testenv:dbr104]
allowlist_externals = bash
commands_pre =
bash -c "./requirements/{envname}/set_install_command.sh"
install_command =
bash -c "cat requirements/{envname}/install_cmd.txt"
allowlist_externals = chmod, bash, source
deps =
-rrequirements/dev.txt
;NB: dependency order matters for this env
-rrequirements/{envname}/{envname}.txt
commands =
chmod +x ./requirements/dbr104/install_non_dev_dependencies.sh
source ./requirements/dbr104/install_non_dev_dependencies.sh
coverage erase
coverage run -m unittest discover -s tests -p '*_tests.py'

Expand Down

0 comments on commit 59171a5

Please sign in to comment.