Add pyproject.toml instead of requirements and setup files #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
setup.pyandrequirements-*.txtfiles with a singlepyproject.tomlbuildpackage to build wheels instead ofpython setup.py ...pyproject.tomltest_ohe_min_max_transformed_query_instance. From pytest8.4.0onwards this is no longerTrue:[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.pyand multiplerequirementsfiles to a centralizedpyproject.tomlconfiguration. Additionally, it updates GitHub workflows to use theuvtool for dependency installation and modernizes package build commands.Build System Refactor:
setup.pyand individualrequirementsfiles (requirements-deeplearning.txt,requirements-linting.txt,requirements-test.txt) with a consolidatedpyproject.tomlfile 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:
.github/workflows/notebook-tests.yml,.github/workflows/python-linting.yml,.github/workflows/python-package.yml, and.github/workflows/python-publish.ymlto useuvfor 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)).github/workflows/python-package.ymland.github/workflows/python-publish.ymlby replacingsetup.pycommands withpython -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))