Skip to content

Commit

Permalink
feat: Adapt skore to be compliant on python >=3.9, <3.13 (#471)
Browse files Browse the repository at this point in the history
- Remove requirements files
- Remove use of requirements in Makefile and CI
- Add support of python 3.9 and 3.10
- Fix code and tests
  • Loading branch information
thomass-dev authored Oct 10, 2024
1 parent 1b7562f commit 4fe2b30
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 459 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/skore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ['3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -62,8 +62,7 @@ jobs:
python -m build
# Install
python -m pip install dist/*.whl --no-dependencies
python -m pip install -r requirements.txt -r requirements-test.txt
wheel=(dist/*.whl); python -m pip install "${wheel}[test]"
# Test
python -m pytest src/ tests/
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
11 changes: 3 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Bug reports are welcome, especially those reported with [short, self-contained,

### Quick start

You'll need Python>=3.12 to build the backend and Node>=20 to build the skore-ui. Then, you can install dependencies and run the UI with:
You'll need `python >=3.9, <3.13` to build the backend and Node>=20 to build the skore-ui. Then, you can install dependencies and run the UI with:
```sh
make install
make install-skore
make build-skore-ui
make serve-ui
```
Expand All @@ -24,19 +24,14 @@ If you want to contribute, please continue with the three other sections.

Install backend dependencies with
```sh
make install
make install-skore
```

You can run the API server with
```sh
make serve-api
```

When dependencies are changed in `pyproject.toml` the lockfiles should be updated via [`pip-compile`](https://github.com/jazzband/pip-tools):
```sh
make pip-compile
```

### skore-ui

Install skore-ui dependencies with
Expand Down
16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
SKORE_ROOT ?= ".datamander"

pip-compile:
python -m piptools compile --output-file=skore/requirements.txt skore/pyproject.toml
python -m piptools compile --extra=test --output-file=skore/requirements-test.txt skore/pyproject.toml
python -m piptools compile --extra=tools --output-file=skore/requirements-tools.txt skore/pyproject.toml

install-skore:
python -m pip install \
-e skore/ \
-r skore/requirements.txt \
-r skore/requirements-test.txt \
-r skore/requirements-tools.txt

python -m pip install -e './skore[test]'
pre-commit install

build-skore-ui:
Expand All @@ -29,7 +17,7 @@ build-skore-ui:
mv skore-ui/dist/ skore/src/skore/ui/static

serve-skore-ui:
SKORE_ROOT=$(SKORE_ROOT) python -m uvicorn \
python -m uvicorn \
--factory skore.ui.app:create_app \
--reload --reload-dir skore/src \
--host 0.0.0.0 \
Expand Down
14 changes: 5 additions & 9 deletions skore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ dynamic = [
"readme",
"version"
]
requires-python = ">=3.11"
maintainers = [
{name = "skore developers", email="skore@signal.probabl.ai"},
]
requires-python = ">=3.9, <3.13"
maintainers = [{name = "skore developers", email="skore@signal.probabl.ai"}]
dependencies = [
"diskcache",
"fastapi",
Expand All @@ -30,8 +28,10 @@ classifiers=[
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
"Programming Language :: Python :: 3.12",
]

[project.urls]
Expand Down Expand Up @@ -76,10 +76,6 @@ test = [
"scikit-learn",
]

tools = [
"pip-tools",
]

[tool.pytest.ini_options]
addopts = [
"--doctest-modules",
Expand Down
202 changes: 0 additions & 202 deletions skore/requirements-test.txt

This file was deleted.

Loading

0 comments on commit 4fe2b30

Please sign in to comment.