DiCE icon indicating copy to clipboard operation
DiCE copied to clipboard

Add pyproject.toml instead of requirements and setup files

Open CloseChoice opened this issue 7 months ago • 1 comments

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]](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R1-R95), [[2]](diffhunk://#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7L1-L53), [[3]](diffhunk://#diff-f528bb97f2fdc6edbef234dab83cb0acfcbf00442e3ed2b5f9d23cc85f9496efL1-L2), [[4]](diffhunk://#diff-7c2b0f0a7902a76888d9a10f7e4347665b8fa4ce1cfd46fcdc0fb9c89eff4e71L1-L10), [[5]](diffhunk://#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]](diffhunk://#diff-240f8fe912df83ff70a46fa58fcd877ccdca8098c4276f644fa6efa43c3ae48aL29-R34), [[2]](diffhunk://#diff-c5f0c99d6c1fd471eda875eb1338b6882a20f7ffddbe39489c195a8a3c76ff30R24-R29), [[3]](diffhunk://#diff-ee49282f461b4c8ad179f79dd5bcdf93124561074c64a771366caf93e99b9320L29-R34), [[4]](diffhunk://#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]](diffhunk://#diff-ee49282f461b4c8ad179f79dd5bcdf93124561074c64a771366caf93e99b9320L65-R60), [[2]](diffhunk://#diff-87c8be2ac3b248aef84cc474af838d7cc461b7f8fb7f5444ac75f4d8fc02e377R21-R29))

CloseChoice avatar Jun 03 '25 09:06 CloseChoice

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

CloseChoice avatar Jun 14 '25 11:06 CloseChoice