Skip to content

Conversation

@CloseChoice
Copy link
Contributor

@CloseChoice CloseChoice commented Jun 3, 2025

closes #458

Note before merging: we should probably test whether the wheels are still built correctly, just building and pushing to test pypi should work. I couldn't do that due to lack of permissions.

Brief Summary

  • replace setup.py and requirements-*.txt files with a single pyproject.toml
  • use build package to build wheels instead of python setup.py ...
  • update github workflows to use the new setup by installing dependency groups from pyproject.toml
  • use uv in the github actions process. I first added this since I thought there is an incompatibility with versions if they aren't installed in the order that was previously lined out be the different files. Turned out, that wasn't the case, so we can revert back to normal pip if desired.
  • pin pytest to 8.3.5 since otherwise we run into an error in test_ohe_min_max_transformed_query_instance. From pytest 8.4.0 onwards this is no longer True: [int(np.True_)] == pytest.approx([1], abs=1e-3)

AI Summary

This pull request refactors the project's build and dependency management by transitioning from setup.py and multiple requirements files to a centralized pyproject.toml configuration. Additionally, it updates GitHub workflows to use the uv tool for dependency installation and modernizes package build commands.

Build System Refactor:

  • Replaced setup.py and individual requirements files (requirements-deeplearning.txt, requirements-linting.txt, requirements-test.txt) with a consolidated pyproject.toml file for build configuration and dependency management. This includes specifying optional dependencies for development, testing, linting, and deep learning. ([[1]](https://github.com/interpretml/DiCE/pull/459/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R1-R95), [[2]](https://github.com/interpretml/DiCE/pull/459/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7L1-L53), [[3]](https://github.com/interpretml/DiCE/pull/459/files#diff-f528bb97f2fdc6edbef234dab83cb0acfcbf00442e3ed2b5f9d23cc85f9496efL1-L2), [[4]](https://github.com/interpretml/DiCE/pull/459/files#diff-7c2b0f0a7902a76888d9a10f7e4347665b8fa4ce1cfd46fcdc0fb9c89eff4e71L1-L10), [[5]](https://github.com/interpretml/DiCE/pull/459/files#diff-685da804fbcac569d75387e475e57d1de687a54c6c41b3aa4057694cfb5abc4bL1-L7))

Workflow Updates:

  • Updated .github/workflows/notebook-tests.yml, .github/workflows/python-linting.yml, .github/workflows/python-package.yml, and .github/workflows/python-publish.yml to use uv for installing dependencies and to simplify installation commands. This improves consistency and reduces redundancy. ([[1]](https://github.com/interpretml/DiCE/pull/459/files#diff-240f8fe912df83ff70a46fa58fcd877ccdca8098c4276f644fa6efa43c3ae48aL29-R34), [[2]](https://github.com/interpretml/DiCE/pull/459/files#diff-c5f0c99d6c1fd471eda875eb1338b6882a20f7ffddbe39489c195a8a3c76ff30R24-R29), [[3]](https://github.com/interpretml/DiCE/pull/459/files#diff-ee49282f461b4c8ad179f79dd5bcdf93124561074c64a771366caf93e99b9320L29-R34), [[4]](https://github.com/interpretml/DiCE/pull/459/files#diff-87c8be2ac3b248aef84cc474af838d7cc461b7f8fb7f5444ac75f4d8fc02e377R21-R29))
  • Modernized package build commands in .github/workflows/python-package.yml and .github/workflows/python-publish.yml by replacing setup.py commands with python -m build. ([[1]](https://github.com/interpretml/DiCE/pull/459/files#diff-ee49282f461b4c8ad179f79dd5bcdf93124561074c64a771366caf93e99b9320L65-R60), [[2]](https://github.com/interpretml/DiCE/pull/459/files#diff-87c8be2ac3b248aef84cc474af838d7cc461b7f8fb7f5444ac75f4d8fc02e377R21-R29))

Signed-off-by: Tobias Pitters <[email protected]>
Signed-off-by: Tobias Pitters <[email protected]>
Signed-off-by: Tobias Pitters <[email protected]>
Signed-off-by: Tobias Pitters <[email protected]>
Signed-off-by: Tobias Pitters <[email protected]>
Signed-off-by: Tobias Pitters <[email protected]>
@CloseChoice CloseChoice force-pushed the pyproject-toml-instead-of-setup branch from 8b8c620 to 769b459 Compare June 3, 2025 13:43
@CloseChoice CloseChoice marked this pull request as ready for review June 3, 2025 13:45
Signed-off-by: Tobias Pitters <[email protected]>
@CloseChoice CloseChoice changed the title WIP: add pyproject.toml instead of requirements and setup files Add pyproject.toml instead of requirements and setup files Jun 3, 2025
@CloseChoice
Copy link
Contributor Author

@amit-sharma would be great if you could take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Moving to pyproject.toml?

1 participant