Skip to content

Commit

Permalink
Add bash script to compile requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Jan 30, 2025
1 parent 4156b25 commit a0df7fa
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 627 deletions.
50 changes: 50 additions & 0 deletions skore/ci/pip-compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

CWD="$PWD"
TMPDIR=$(mktemp -d); trap 'rm -rf ${TMPDIR}' 0

declare -a COMBINATIONS

COMBINATIONS[0]='3.9;1.6'
COMBINATIONS[1]='3.10;1.6'
COMBINATIONS[2]='3.11;1.6'
COMBINATIONS[3]='3.12;1.4'
COMBINATIONS[4]='3.12;1.5'
COMBINATIONS[5]='3.12;1.6'

set -eu

(
cp -r .. "${TMPDIR}/skore"
cp ../../LICENSE "${TMPDIR}/LICENSE"
cp ../../README.md "${TMPDIR}/README.md"

cd "${TMPDIR}"

for combination in "${COMBINATIONS[@]}"
do
IFS=";" read -r -a combination <<< "${combination}"

python="${combination[0]}"
scikit_learn="${combination[1]}"
filepath="${CWD}/requirements/python-${python}-scikit-learn-${scikit_learn}-test-requirements.txt"

sed -i "s/scikit-learn.*/scikit-learn==${scikit_learn}.*/g" skore/test-requirements.in

pyenv local "${python}"
python -m venv "python-${python}"
source "python-${python}/bin/activate"

echo "Generating requirements: python ==${python} | scikit-learn ==${scikit_learn}"

python -m pip install --upgrade pip pip-tools --quiet
python -m piptools compile \
--quiet \
--no-strip-extras \
--no-header \
--extra=test \
--output-file="${filepath}" \
"${@:2}" \
skore/pyproject.toml
done
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --extra=test --output-file=ci/requirements/python-3.12/scikit-learn-1.6-test-requirements.txt pyproject.toml
#
altair==5.5.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
annotated-types==0.7.0
# via pydantic
anyio==4.8.0
Expand Down Expand Up @@ -34,18 +28,18 @@ coverage[toml]==7.6.10
cycler==0.12.1
# via matplotlib
diskcache==5.6.3
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
distlib==0.3.9
# via virtualenv
execnet==2.1.1
# via pytest-xdist
fastapi==0.115.7
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
filelock==3.17.0
# via
# huggingface-hub
# virtualenv
fonttools==4.55.6
fonttools==4.55.8
# via matplotlib
fsspec==2024.12.0
# via huggingface-hub
Expand All @@ -56,8 +50,8 @@ h11==0.14.0
httpcore==1.0.7
# via httpx
httpx==0.28.1
# via skore (pyproject.toml)
huggingface-hub==0.27.1
# via skore (skore/pyproject.toml)
huggingface-hub==0.28.0
# via skops
identify==2.6.6
# via pre-commit
Expand All @@ -75,7 +69,7 @@ jinja2==3.1.5
joblib==1.4.2
# via
# scikit-learn
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
jsonschema==4.23.0
# via altair
jsonschema-specifications==2024.10.1
Expand All @@ -88,11 +82,11 @@ markupsafe==3.0.2
# via jinja2
matplotlib==3.10.0
# via
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
# skrub
mdurl==0.1.2
# via markdown-it-py
narwhals==1.24.0
narwhals==1.24.1
# via altair
nodeenv==1.9.1
# via pre-commit
Expand All @@ -103,10 +97,10 @@ numpy==2.2.2
# pandas
# scikit-learn
# scipy
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
# skrub
orjson==3.10.15
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
packaging==24.2
# via
# altair
Expand All @@ -118,24 +112,24 @@ packaging==24.2
# skrub
pandas==2.2.3
# via
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
# skrub
pillow==11.1.0
# via
# matplotlib
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
platformdirs==4.3.6
# via virtualenv
plotly==5.24.1
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pluggy==1.5.0
# via pytest
polars==1.21.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pre-commit==4.1.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pyarrow==19.0.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pydantic==2.10.6
# via fastapi
pydantic-core==2.27.2
Expand All @@ -150,15 +144,15 @@ pytest==8.3.4
# pytest-order
# pytest-randomly
# pytest-xdist
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
pytest-cov==6.0.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pytest-order==1.3.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pytest-randomly==3.16.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
pytest-xdist==3.6.1
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
python-dateutil==2.9.0.post0
# via
# matplotlib
Expand All @@ -178,17 +172,17 @@ requests==2.32.3
# huggingface-hub
# skrub
rich==13.9.4
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
rpds-py==0.22.3
# via
# jsonschema
# referencing
ruff==0.9.3
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
scikit-learn==1.6.1
# via
# skops
# skore (pyproject.toml)
# skore (skore/pyproject.toml)
# skrub
scipy==1.15.1
# via
Expand All @@ -197,9 +191,9 @@ scipy==1.15.1
six==1.17.0
# via python-dateutil
skops==0.11.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
skrub==0.5.1
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
sniffio==1.3.1
# via anyio
starlette==0.45.3
Expand All @@ -226,6 +220,6 @@ tzdata==2025.1
urllib3==2.3.0
# via requests
uvicorn==0.34.0
# via skore (pyproject.toml)
# via skore (skore/pyproject.toml)
virtualenv==20.29.1
# via pre-commit
Loading

0 comments on commit a0df7fa

Please sign in to comment.