From 035335303e4eff4b2ba834229234a64c9a018d62 Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:27:12 +0100 Subject: [PATCH 1/7] Update to khiops 11 --- .github/workflows/docs.yaml | 2 +- .github/workflows/tests.yaml | 2 +- README.md | 6 ++---- docs/index.md | 2 +- docs/quickstart.ipynb | 16 ++++++++++++++++ docs/quickstart.py | 4 ++++ pyproject.toml | 6 ++---- uv.lock | 28 +++++++++++++--------------- 8 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 1988923..c940807 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,7 +29,7 @@ jobs: sudo apt-get update -y && sudo apt-get install wget lsb-release -y CODENAME=$(lsb_release -cs) TEMP_DEB="$(mktemp)" - wget -O "$TEMP_DEB" "https://github.com/KhiopsML/khiops/releases/download/11.0.0-b.0/khiops-core-openmpi_11.0.0-b.0-1-${CODENAME}.amd64.deb" + wget -O "$TEMP_DEB" "https://github.com/KhiopsML/khiops/releases/download/11.0.0/khiops-core-openmpi_11.0.0-1-${CODENAME}.amd64.deb" sudo dpkg -i "$TEMP_DEB" || sudo apt-get -f -y install - name: Build docs run: | diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b0767d..bfea13f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -33,6 +33,6 @@ jobs: miniforge-version: latest conda-remove-defaults: true - name: Install khiops - run: conda install --quiet --yes --name test khiops-core=11.0.0b.0 + run: conda install --quiet --yes --name test khiops-core=11.0.0 - name: Run tests run: conda run --name test uv run pytest src/tests diff --git a/README.md b/README.md index c059400..1663b0f 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,8 @@ See the [documentation][khalib-docs] for more information. ## Installation -*Note: We'll improve this installation procedure soon!* - -- Make sure you have installed [Khiops 11 Beta][khiops11-setup] -- Execute +- [Install Khiops][khiops-setup] +- Install the `khalib` python library: ```bash pip install https://github.com/KhiopsLab/khalib/archive/refs/tags/0.1.zip diff --git a/docs/index.md b/docs/index.md index 4e6cd9c..0bb608f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,7 +19,7 @@ estimated. These histograms have the following properties: [khiops-org]: https://khiops.org -[khiops11-setup]: https://khiops.org/11.0.0-b.0/setup/ +[khiops-setup]: https://khiops.org/setup/ [sk-calclf]: https://scikit-learn.org/stable/modules/generated/sklearn.calibration.CalibratedClassifierCV.html [khalib-docs]: https://khiopsml.github.io/khalib diff --git a/docs/quickstart.ipynb b/docs/quickstart.ipynb index 8316f2d..9742b72 100644 --- a/docs/quickstart.ipynb +++ b/docs/quickstart.ipynb @@ -178,6 +178,22 @@ "print(\"Reduction :\", (ece_test - calib_ece_test) / ece_test)\n", "_ = khalib.build_reliability_diagram(calib_hist_y_test_scores, y_test)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0370a02f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "edf18fbe", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/docs/quickstart.py b/docs/quickstart.py index f5e6c23..06c3fc7 100644 --- a/docs/quickstart.py +++ b/docs/quickstart.py @@ -112,3 +112,7 @@ print("CALIB HIST ECE:", calib_hist_ece_test) print("Reduction :", (ece_test - calib_ece_test) / ece_test) _ = khalib.build_reliability_diagram(calib_hist_y_test_scores, y_test) + +# %% + +# %% diff --git a/pyproject.toml b/pyproject.toml index d516eae..a0c2110 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "Classifier Calibration with Khiops" authors = [{ name = "Felipe Olmos", email = "luisfelipe.olmosmarchant@orange.com" }] requires-python = ">=3.11" dependencies = [ - "khiops>=11.0.0.0b0", + "khiops>=11.0.0.0", "numpy>=2.0.0", "scikit-learn>=1.5.0", "matplotlib>=3.9.0", @@ -56,13 +56,11 @@ ignore = [ "PLW0120", # useless-else-on-loop "PLW0406", # import-self "PLW0603", # global-statement + "PD901", # Avoid 'df' name for dataframes ] # To fix by default isort fixes extend-safe-fixes = ["I"] -[tool.uv.sources] -khiops = { url = "https://github.com/KhiopsML/khiops-python/releases/download/11.0.0.0-b.0/khiops-11.0.0.0b0.tar.gz" } - [dependency-groups] dev = [ "furo>=2025.7.19", diff --git a/uv.lock b/uv.lock index 10028df..7fe981a 100644 --- a/uv.lock +++ b/uv.lock @@ -631,6 +631,8 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1f/8e/abdd3f14d735b2929290a018ecf133c901be4874b858dd1c604b9319f064/greenlet-3.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2523e5246274f54fdadbce8494458a2ebdcdbc7b802318466ac5606d3cded1f8", size = 587684, upload-time = "2025-08-07T13:18:25.164Z" }, { url = "https://files.pythonhosted.org/packages/5d/65/deb2a69c3e5996439b0176f6651e0052542bb6c8f8ec2e3fba97c9768805/greenlet-3.2.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1987de92fec508535687fb807a5cea1560f6196285a4cde35c100b8cd632cc52", size = 1116647, upload-time = "2025-08-07T13:42:38.655Z" }, { url = "https://files.pythonhosted.org/packages/3f/cc/b07000438a29ac5cfb2194bfc128151d52f333cee74dd7dfe3fb733fc16c/greenlet-3.2.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:55e9c5affaa6775e2c6b67659f3a71684de4c549b3dd9afca3bc773533d284fa", size = 1142073, upload-time = "2025-08-07T13:18:21.737Z" }, + { url = "https://files.pythonhosted.org/packages/67/24/28a5b2fa42d12b3d7e5614145f0bd89714c34c08be6aabe39c14dd52db34/greenlet-3.2.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c9c6de1940a7d828635fbd254d69db79e54619f165ee7ce32fda763a9cb6a58c", size = 1548385, upload-time = "2025-11-04T12:42:11.067Z" }, + { url = "https://files.pythonhosted.org/packages/6a/05/03f2f0bdd0b0ff9a4f7b99333d57b53a7709c27723ec8123056b084e69cd/greenlet-3.2.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03c5136e7be905045160b1b9fdca93dd6727b180feeafda6818e6496434ed8c5", size = 1613329, upload-time = "2025-11-04T12:42:12.928Z" }, { url = "https://files.pythonhosted.org/packages/d8/0f/30aef242fcab550b0b3520b8e3561156857c94288f0332a79928c31a52cf/greenlet-3.2.4-cp311-cp311-win_amd64.whl", hash = "sha256:9c40adce87eaa9ddb593ccb0fa6a07caf34015a29bf8d344811665b573138db9", size = 299100, upload-time = "2025-08-07T13:44:12.287Z" }, { url = "https://files.pythonhosted.org/packages/44/69/9b804adb5fd0671f367781560eb5eb586c4d495277c93bde4307b9e28068/greenlet-3.2.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3b67ca49f54cede0186854a008109d6ee71f66bd57bb36abd6d0a0267b540cdd", size = 274079, upload-time = "2025-08-07T13:15:45.033Z" }, { url = "https://files.pythonhosted.org/packages/46/e9/d2a80c99f19a153eff70bc451ab78615583b8dac0754cfb942223d2c1a0d/greenlet-3.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ddf9164e7a5b08e9d22511526865780a576f19ddd00d62f8a665949327fde8bb", size = 640997, upload-time = "2025-08-07T13:42:56.234Z" }, @@ -640,6 +642,8 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/19/0d/6660d55f7373b2ff8152401a83e02084956da23ae58cddbfb0b330978fe9/greenlet-3.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b3812d8d0c9579967815af437d96623f45c0f2ae5f04e366de62a12d83a8fb0", size = 607586, upload-time = "2025-08-07T13:18:28.544Z" }, { url = "https://files.pythonhosted.org/packages/8e/1a/c953fdedd22d81ee4629afbb38d2f9d71e37d23caace44775a3a969147d4/greenlet-3.2.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:abbf57b5a870d30c4675928c37278493044d7c14378350b3aa5d484fa65575f0", size = 1123281, upload-time = "2025-08-07T13:42:39.858Z" }, { url = "https://files.pythonhosted.org/packages/3f/c7/12381b18e21aef2c6bd3a636da1088b888b97b7a0362fac2e4de92405f97/greenlet-3.2.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:20fb936b4652b6e307b8f347665e2c615540d4b42b3b4c8a321d8286da7e520f", size = 1151142, upload-time = "2025-08-07T13:18:22.981Z" }, + { url = "https://files.pythonhosted.org/packages/27/45/80935968b53cfd3f33cf99ea5f08227f2646e044568c9b1555b58ffd61c2/greenlet-3.2.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ee7a6ec486883397d70eec05059353b8e83eca9168b9f3f9a361971e77e0bcd0", size = 1564846, upload-time = "2025-11-04T12:42:15.191Z" }, + { url = "https://files.pythonhosted.org/packages/69/02/b7c30e5e04752cb4db6202a3858b149c0710e5453b71a3b2aec5d78a1aab/greenlet-3.2.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:326d234cbf337c9c3def0676412eb7040a35a768efc92504b947b3e9cfc7543d", size = 1633814, upload-time = "2025-11-04T12:42:17.175Z" }, { url = "https://files.pythonhosted.org/packages/e9/08/b0814846b79399e585f974bbeebf5580fbe59e258ea7be64d9dfb253c84f/greenlet-3.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:a7d4e128405eea3814a12cc2605e0e6aedb4035bf32697f72deca74de4105e02", size = 299899, upload-time = "2025-08-07T13:38:53.448Z" }, { url = "https://files.pythonhosted.org/packages/49/e8/58c7f85958bda41dafea50497cbd59738c5c43dbbea5ee83d651234398f4/greenlet-3.2.4-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:1a921e542453fe531144e91e1feedf12e07351b1cf6c9e8a3325ea600a715a31", size = 272814, upload-time = "2025-08-07T13:15:50.011Z" }, { url = "https://files.pythonhosted.org/packages/62/dd/b9f59862e9e257a16e4e610480cfffd29e3fae018a68c2332090b53aac3d/greenlet-3.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd3c8e693bff0fff6ba55f140bf390fa92c994083f838fece0f63be121334945", size = 641073, upload-time = "2025-08-07T13:42:57.23Z" }, @@ -649,6 +653,8 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ee/43/3cecdc0349359e1a527cbf2e3e28e5f8f06d3343aaf82ca13437a9aa290f/greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23768528f2911bcd7e475210822ffb5254ed10d71f4028387e5a99b4c6699671", size = 610497, upload-time = "2025-08-07T13:18:31.636Z" }, { url = "https://files.pythonhosted.org/packages/b8/19/06b6cf5d604e2c382a6f31cafafd6f33d5dea706f4db7bdab184bad2b21d/greenlet-3.2.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:00fadb3fedccc447f517ee0d3fd8fe49eae949e1cd0f6a611818f4f6fb7dc83b", size = 1121662, upload-time = "2025-08-07T13:42:41.117Z" }, { url = "https://files.pythonhosted.org/packages/a2/15/0d5e4e1a66fab130d98168fe984c509249c833c1a3c16806b90f253ce7b9/greenlet-3.2.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:d25c5091190f2dc0eaa3f950252122edbbadbb682aa7b1ef2f8af0f8c0afefae", size = 1149210, upload-time = "2025-08-07T13:18:24.072Z" }, + { url = "https://files.pythonhosted.org/packages/1c/53/f9c440463b3057485b8594d7a638bed53ba531165ef0ca0e6c364b5cc807/greenlet-3.2.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6e343822feb58ac4d0a1211bd9399de2b3a04963ddeec21530fc426cc121f19b", size = 1564759, upload-time = "2025-11-04T12:42:19.395Z" }, + { url = "https://files.pythonhosted.org/packages/47/e4/3bb4240abdd0a8d23f4f88adec746a3099f0d86bfedb623f063b2e3b4df0/greenlet-3.2.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ca7f6f1f2649b89ce02f6f229d7c19f680a6238af656f61e0115b24857917929", size = 1634288, upload-time = "2025-11-04T12:42:21.174Z" }, { url = "https://files.pythonhosted.org/packages/0b/55/2321e43595e6801e105fcfdee02b34c0f996eb71e6ddffca6b10b7e1d771/greenlet-3.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:554b03b6e73aaabec3745364d6239e9e012d64c68ccd0b8430c64ccc14939a8b", size = 299685, upload-time = "2025-08-07T13:24:38.824Z" }, { url = "https://files.pythonhosted.org/packages/22/5c/85273fd7cc388285632b0498dbbab97596e04b154933dfe0f3e68156c68c/greenlet-3.2.4-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:49a30d5fda2507ae77be16479bdb62a660fa51b1eb4928b524975b3bde77b3c0", size = 273586, upload-time = "2025-08-07T13:16:08.004Z" }, { url = "https://files.pythonhosted.org/packages/d1/75/10aeeaa3da9332c2e761e4c50d4c3556c21113ee3f0afa2cf5769946f7a3/greenlet-3.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:299fd615cd8fc86267b47597123e3f43ad79c9d8a22bebdce535e53550763e2f", size = 686346, upload-time = "2025-08-07T13:42:59.944Z" }, @@ -656,6 +662,8 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/dc/8b/29aae55436521f1d6f8ff4e12fb676f3400de7fcf27fccd1d4d17fd8fecd/greenlet-3.2.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b4a1870c51720687af7fa3e7cda6d08d801dae660f75a76f3845b642b4da6ee1", size = 694659, upload-time = "2025-08-07T13:53:17.759Z" }, { url = "https://files.pythonhosted.org/packages/92/2e/ea25914b1ebfde93b6fc4ff46d6864564fba59024e928bdc7de475affc25/greenlet-3.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:061dc4cf2c34852b052a8620d40f36324554bc192be474b9e9770e8c042fd735", size = 695355, upload-time = "2025-08-07T13:18:34.517Z" }, { url = "https://files.pythonhosted.org/packages/72/60/fc56c62046ec17f6b0d3060564562c64c862948c9d4bc8aa807cf5bd74f4/greenlet-3.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:44358b9bf66c8576a9f57a590d5f5d6e72fa4228b763d0e43fee6d3b06d3a337", size = 657512, upload-time = "2025-08-07T13:18:33.969Z" }, + { url = "https://files.pythonhosted.org/packages/23/6e/74407aed965a4ab6ddd93a7ded3180b730d281c77b765788419484cdfeef/greenlet-3.2.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2917bdf657f5859fbf3386b12d68ede4cf1f04c90c3a6bc1f013dd68a22e2269", size = 1612508, upload-time = "2025-11-04T12:42:23.427Z" }, + { url = "https://files.pythonhosted.org/packages/0d/da/343cd760ab2f92bac1845ca07ee3faea9fe52bee65f7bcb19f16ad7de08b/greenlet-3.2.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:015d48959d4add5d6c9f6c5210ee3803a830dce46356e3bc326d6776bde54681", size = 1680760, upload-time = "2025-11-04T12:42:25.341Z" }, { url = "https://files.pythonhosted.org/packages/e3/a5/6ddab2b4c112be95601c13428db1d8b6608a8b6039816f2ba09c346c08fc/greenlet-3.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01", size = 303425, upload-time = "2025-08-07T13:32:27.59Z" }, ] @@ -1108,7 +1116,7 @@ wheels = [ [[package]] name = "khalib" -version = "0.1b0" +version = "0.1" source = { editable = "." } dependencies = [ { name = "khiops" }, @@ -1137,7 +1145,7 @@ dev = [ [package.metadata] requires-dist = [ - { name = "khiops", url = "https://github.com/KhiopsML/khiops-python/releases/download/11.0.0.0-b.0/khiops-11.0.0.0b0.tar.gz" }, + { name = "khiops", specifier = ">=11.0.0.0" }, { name = "matplotlib", specifier = ">=3.9.0" }, { name = "numpy", specifier = ">=2.0.0" }, { name = "scikit-learn", specifier = ">=1.5.0" }, @@ -1163,23 +1171,13 @@ dev = [ [[package]] name = "khiops" -version = "11.0.0.0b0" -source = { url = "https://github.com/KhiopsML/khiops-python/releases/download/11.0.0.0-b.0/khiops-11.0.0.0b0.tar.gz" } +version = "11.0.0.0" +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pandas" }, { name = "scikit-learn" }, ] -sdist = { hash = "sha256:db8380d4eeec4341f52459d4d2533b48c95e79e6faea020a19fcbdc8ff33fe92" } - -[package.metadata] -requires-dist = [ - { name = "boto3", marker = "extra == 's3'", specifier = ">=1.17.39,<=1.35.69" }, - { name = "google-cloud-storage", marker = "extra == 'gcs'", specifier = ">=1.37.0" }, - { name = "pandas", specifier = ">=0.25.3" }, - { name = "pyopenssl", marker = "extra == 's3'", specifier = ">=24.0.0,<25.0.0" }, - { name = "scikit-learn", specifier = ">=0.22.2" }, -] -provides-extras = ["s3", "gcs"] +sdist = { url = "https://files.pythonhosted.org/packages/1f/bd/5e1d1a6f1bc5ef3746a905346b3f5990120c01a1396beec04181e2a9b342/khiops-11.0.0.0.tar.gz", hash = "sha256:35b03439b515e528a87bf0d42c93f047a1bf7e3fe95f9fb1aa8d0e8f360337de", size = 179523, upload-time = "2025-12-19T14:18:41.255Z" } [[package]] name = "kiwisolver" From f7f11d56d9fcd4563ee7ab25335084580dc96500 Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Wed, 24 Dec 2025 12:03:51 +0100 Subject: [PATCH 2/7] Update CI --- .github/workflows/checks.yaml | 6 +++--- .github/workflows/docs.yaml | 11 +++++------ .github/workflows/tests.yaml | 13 ++++++++----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 6d4971e..a1d2302 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv uses: astral-sh/setup-uv@v6 - - name: Setup Just - uses: extractions/setup-just@v3 + with: + enable-cache: true - name: Run pre-commit - run: just pre-commit + run: uvx pre-commit run --all-files --verbose diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index c940807..53a4da8 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -20,17 +20,16 @@ jobs: - uses: actions/checkout@v4 - name: Setup uv uses: astral-sh/setup-uv@v6 - - name: Setup Python - run: uv python install + with: + python-version: '3.14' + enable-cache: true - name: Setup just uses: extractions/setup-just@v3 - name: Setup Khiops run: | sudo apt-get update -y && sudo apt-get install wget lsb-release -y - CODENAME=$(lsb_release -cs) - TEMP_DEB="$(mktemp)" - wget -O "$TEMP_DEB" "https://github.com/KhiopsML/khiops/releases/download/11.0.0/khiops-core-openmpi_11.0.0-1-${CODENAME}.amd64.deb" - sudo dpkg -i "$TEMP_DEB" || sudo apt-get -f -y install + wget -O "./khiops.deb" "https://github.com/KhiopsML/khiops/releases/download/11.0.0/khiops-core-openmpi_11.0.0-1-$(lsb_release -cs).amd64.deb" + sudo dpkg -i "./khiops.deb" || sudo apt-get -f -y install - name: Build docs run: | mkdir docs/_static diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bfea13f..eae7f76 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,6 +4,7 @@ on: pull_request: paths: - 'src/**' + - .github/workflows/tests.yaml # Cancel any ongoing run of this workflow on the same PR or ref concurrency: @@ -24,15 +25,17 @@ jobs: uses: astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} - - name: Set up Python - run: uv python install + enable-cache: true + - name: Setup just + uses: extractions/setup-just@v3 - name: Install Miniforge uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true miniforge-version: latest conda-remove-defaults: true - - name: Install khiops - run: conda install --quiet --yes --name test khiops-core=11.0.0 + - name: Install Khiops + run: conda install --quiet --yes --name test khiops-core>=11.0.0 - name: Run tests - run: conda run --name test uv run pytest src/tests + # We run with `conda` so we find the khiops executables installed in the conda env + run: conda run --name test just test From ff86841be4db7edd592a0b41c048c77b797d2038 Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Fri, 26 Dec 2025 10:23:26 +0100 Subject: [PATCH 3/7] Fix setuptools package find settings --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a0c2110..ebbd141 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,8 +18,8 @@ license = "BSD-3-Clause" license-files = ["LICENSE.md"] -[tools.setuptools] -packages = ["khcalib"] +[tool.setuptools.packages.find] +where = ["src"] [tool.pytest.ini_options] markers = [ From c6e7c5e082cac78e342b021cde6eaf50d3733c4e Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Fri, 26 Dec 2025 11:27:38 +0100 Subject: [PATCH 4/7] Add package and release workflow --- .github/workflows/package.yaml | 71 ++++++++++++++++++++++++++++++++++ pyproject.toml | 25 +++++++++++- uv.lock | 2 +- 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/package.yaml diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 0000000..f1ceb1d --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,71 @@ +name: Package +on: + workflow_dispatch: + inputs: + pypi-target: + type: choice + default: no-op + options: [no-op, testpypi, pypi] + description: PyPI Target + pull_request: + +# Cancel any ongoing run of this workflow on the same PR or ref +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Setup uv + uses: astral-sh/setup-uv@v6 + with: + python-version: '3.14' + enable-cache: true + - name: Build Package + run: | + uv build --sdist + - name: Upload package artifact + uses: actions/upload-artifact@v6 + with: + name: pip-package + path: dist/ + publish-pypi: + if: inputs.pypi-target == 'pypi' && github.ref_type == 'tag' && github.repository_owner == 'KhiopsLab' + needs: [build] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/khalib + permissions: + id-token: write + steps: + - name: Download package artifact + uses: actions/download-artifact@v6 + with: + name: pip-package + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + publish-testpypi: + if: inputs.pypi-target == 'testpypi' && github.ref_type == 'tag' && github.repository_owner == 'KhiopsLab' + needs: [build] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/khalib + permissions: + id-token: write + steps: + - name: Download package artifact + uses: actions/download-artifact@v6 + with: + name: pip-package + path: dist/ + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index ebbd141..5938a9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "khalib" -version = "0.1" +version = "0.2rc2" description = "Classifier Calibration with Khiops" authors = [{ name = "Felipe Olmos", email = "luisfelipe.olmosmarchant@orange.com" }] requires-python = ">=3.11" @@ -14,8 +14,31 @@ dependencies = [ "scikit-learn>=1.5.0", "matplotlib>=3.9.0", ] +readme = "README.md" license = "BSD-3-Clause" license-files = ["LICENSE.md"] +classifiers=[ + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Programming Language :: Python", + "Topic :: Software Development", + "Topic :: Scientific/Engineering", + "Development Status :: 5 - Production/Stable", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +[project.urls] +homepage = "https://khiopslab.github.io/khalib" +source = "https://github.com/KhiopsLab/khalib" +tracker = "https://github.com/KhiopsLab/khalib/issues" +changelog = "https://github.com/KhiopsLab/khalib/blob/main/CHANGELOG.md" [tool.setuptools.packages.find] diff --git a/uv.lock b/uv.lock index 7fe981a..a525c34 100644 --- a/uv.lock +++ b/uv.lock @@ -1116,7 +1116,7 @@ wheels = [ [[package]] name = "khalib" -version = "0.1" +version = "0.2rc1" source = { editable = "." } dependencies = [ { name = "khiops" }, From cbcc0ebaa6799cb92e581796d87f65c96765929e Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Fri, 26 Dec 2025 15:45:14 +0100 Subject: [PATCH 5/7] Get the version show in docs from pyproject.toml --- docs/conf.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f44651a..7c3760c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,17 @@ +# This script must be executed in its directory +import importlib +import sys + +# Obtain the project's version +sys.path.append("../") +khalib_version = importlib.metadata.version("khalib") + +# Basic Information project = "khalib" author = "Felipe Olmos" -release = "0.1" +release = khalib_version +# Sphinx extensions extensions = [ "myst_nb", # activates myst_parser as well "numpydoc", @@ -11,13 +21,13 @@ "sphinx.ext.intersphinx", ] +# Basic Sphinx config +default_role = "obj" templates_path = ["_templates"] exclude_patterns = [] - html_theme = "furo" html_static_path = ["_static"] html_title = f"