Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use lockfiles to control cached venv #1238

Merged
merged 17 commits into from
Feb 3, 2025
Merged

Conversation

thomass-dev
Copy link
Collaborator

@thomass-dev thomass-dev commented Jan 27, 2025

Closes #1146 .

This PR intends to fix all the dependencies used in the CI in multiple test-requirements.txt files, in a fully automated way.
It ensures that between two runs, the CI can't break because of a dependency update.
It bases the pipelines cache on these files.

On the other hand, it makes it easier to update the versions of the dependencies used in the CI.
Currently, the versions are updated only if someone updates the pyproject.toml file, or if the CI cache is purged by hand.
It will be now automatically updated each week by dependabot, in a pull-request.

This PR updates the dependabot configuration, but I can't be sure it works before the merge. If not, we can easily create a cron pipeline calling the new pip-compile.sh script.


This PR adds a new backend test ensuring that test-requirements.txt files are regenerated when requirements.in or test-requirements.in is modified.

image

@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from bba7e76 to 0e93fd2 Compare January 30, 2025 10:11
Copy link
Contributor

github-actions bot commented Jan 30, 2025

Coverage

Coverage Report for backend
FileStmtsMissCoverMissing
venv/lib/python3.12/site-packages/skore
   __init__.py140100% 
   __main__.py880%3–19
   exceptions.py440%4–23
venv/lib/python3.12/site-packages/skore/cli
   __init__.py550%3–8
   cli.py22220%3–70
   color_format.py49490%3–116
venv/lib/python3.12/site-packages/skore/persistence
   __init__.py00100% 
venv/lib/python3.12/site-packages/skore/persistence/item
   __init__.py56393%96–99
   altair_chart_item.py24193%15
   item.py24196%86
   matplotlib_figure_item.py42196%19
   media_item.py240100% 
   numpy_array_item.py29194%16
   pandas_dataframe_item.py31194%14
   pandas_series_item.py31194%14
   pickle_item.py330100% 
   pillow_image_item.py32194%16
   plotly_figure_item.py25193%15
   polars_dataframe_item.py29194%14
   polars_series_item.py24193%14
   primitive_item.py25291%13–15
   sklearn_base_estimator_item.py31194%15
   skrub_table_report_item.py10186%11
venv/lib/python3.12/site-packages/skore/persistence/repository
   __init__.py30100% 
   item_repository.py59591%15–16, 202–203, 226
   view_repository.py19286%9–10
venv/lib/python3.12/site-packages/skore/persistence/storage
   __init__.py40100% 
   abstract_storage.py220100% 
   disk_cache_storage.py33195%44
   in_memory_storage.py200100% 
venv/lib/python3.12/site-packages/skore/persistence/view
   __init__.py20100% 
   view.py50100% 
venv/lib/python3.12/site-packages/skore/project
   __init__.py30100% 
   _launch.py150199%278
   _open.py90100% 
   project.py71199%250
venv/lib/python3.12/site-packages/skore/sklearn
   __init__.py40100% 
   _base.py140497%91, 94, 168–>173, 183–184
   find_ml_task.py45391%71–>87, 84–86
   types.py20100% 
venv/lib/python3.12/site-packages/skore/sklearn/_cross_validation
   __init__.py60100% 
   metrics_accessor.py1630100% 
   report.py870100% 
venv/lib/python3.12/site-packages/skore/sklearn/_estimator
   __init__.py60100% 
   metrics_accessor.py265497%149–158, 183–>236, 191, 434–>437, 783–>786
   report.py120099%213–>219, 221–>223
   utils.py11110%1–19
venv/lib/python3.12/site-packages/skore/sklearn/_plot
   __init__.py40100% 
   precision_recall_curve.py121198%229–>246, 317
   prediction_error.py970100% 
   roc_curve.py1280100% 
   utils.py880100% 
venv/lib/python3.12/site-packages/skore/sklearn/train_test_split
   __init__.py00100% 
   train_test_split.py36294%16–17
venv/lib/python3.12/site-packages/skore/sklearn/train_test_split/warning
   __init__.py80100% 
   high_class_imbalance_too_few_examples_warning.py17378%16–18, 80
   high_class_imbalance_warning.py18288%16–18
   random_state_unset_warning.py11187%15
   shuffle_true_warning.py9091%44–>exit
   stratify_is_set_warning.py11187%15
   time_based_column_warning.py22189%17, 69–>exit
   train_test_split_warning.py5180%21
venv/lib/python3.12/site-packages/skore/ui
   __init__.py00100% 
   app.py32320%3–83
   dependencies.py440%3–10
   project_routes.py62620%3–145
   server.py17170%3–40
venv/lib/python3.12/site-packages/skore/utils
   __init__.py60100% 
   _accessor.py70100% 
   _environment.py26097%29–>34
   _logger.py21484%14–18
   _patch.py11546%19–35
   _progress_bar.py300100% 
   _show_versions.py310100% 
TOTAL264327390% 

Tests Skipped Failures Errors Time
547 3 💤 0 ❌ 0 🔥 53.764s ⏱️

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Documentation preview @ aac6dab

@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch 2 times, most recently from d7889ba to a0df7fa Compare January 30, 2025 12:21
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from a0df7fa to 2ae655c Compare January 30, 2025 13:29
@thomass-dev thomass-dev changed the title ci: Use lockfiles to ensure cached venv are always up-to-date ci: Use lockfiles to control cached venv Jan 30, 2025
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch 3 times, most recently from 5fca264 to 20ea33d Compare January 30, 2025 13:49
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from 20ea33d to 9b851f3 Compare January 30, 2025 13:51
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch 2 times, most recently from 311472a to 7d92c37 Compare January 30, 2025 15:05
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch 4 times, most recently from 62e8daf to 7369182 Compare January 30, 2025 15:49
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from 7369182 to e09c65e Compare January 30, 2025 15:53
@thomass-dev thomass-dev marked this pull request as ready for review January 30, 2025 16:10
@thomass-dev thomass-dev requested a review from rouk1 as a code owner January 30, 2025 16:10
@thomass-dev thomass-dev requested a review from glemaitre January 30, 2025 16:10
@thomass-dev thomass-dev marked this pull request as draft January 31, 2025 09:56
@rouk1
Copy link
Contributor

rouk1 commented Jan 31, 2025

To be honest I do not fully understand what is going on here. This definitely needs an ADR, hence enlarging the scope of #1066.

@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch 7 times, most recently from 0f46574 to c61f0ca Compare January 31, 2025 14:02
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from c61f0ca to fa59a38 Compare January 31, 2025 14:04
@thomass-dev thomass-dev force-pushed the ci-use-requirements-txt branch from a1d0aa4 to 6ef9293 Compare January 31, 2025 15:54
@thomass-dev thomass-dev marked this pull request as ready for review January 31, 2025 16:28
@thomass-dev
Copy link
Collaborator Author

To be honest I do not fully understand what is going on here. This definitely needs an ADR, hence enlarging the scope of #1066.

I have written two ADRs. Hope it helps you to understand the context of this PR.

Copy link
Contributor

@rouk1 rouk1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me thanks @thomass-dev for the documentation.
LGTM !

We may need another ADR to globally explain all the CI actions and workflows but this should be done in another PR obviously.

@auguste-probabl auguste-probabl merged commit b6a2e75 into main Feb 3, 2025
20 checks passed
@auguste-probabl auguste-probabl deleted the ci-use-requirements-txt branch February 3, 2025 09:43
auguste-probabl pushed a commit that referenced this pull request Feb 3, 2025
Following #1238.

Currently, any change on `skore/hatch/`, `skore/ci/` or `skore/*.*`
doesn't trigger the backend worflow.
This can lead to undetected bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ci: Reset the python dependencies cache weekly
3 participants