TRAIS-Lab / dattri

`dattri` is a PyTorch library for developing, benchmarking, and deploying efficient data attribution algorithms.
https://trais-lab.github.io/dattri/
MIT License
27 stars 8 forks source link

Add import dependency in `setup.py` #15

Closed xingjian-zhang closed 4 months ago

xingjian-zhang commented 5 months ago

Currently, we do not have a place to specify dependency. So one needs to add them in different places ad hoc like: https://github.com/TRAIS-Lab/dattri/blob/43efc912bf51d265aa1e5e85e3149d696ebcd90e/.github/workflows/pytest.yml#L17-L22

We could consider specifying the import dependency in setup.py: https://github.com/TRAIS-Lab/dattri/blob/43efc912bf51d265aa1e5e85e3149d696ebcd90e/setup.py#L26

This will make the automated tests easier by simply running python setup.py install.

TheaperDeng commented 5 months ago

I think it may make sense to let users to install some of these by themselves.

For pytest and wheel we use them only for development, we can add some installation options like dattri[dev] later (not a priority now).

As for torch, our toolkit does based on torch, but according to previous experience, we could just let users to install any torch version they would like to use. (For most of the cases, users may already have a torch environment set up in their environment and install dattri afterwards.)

Users may not want to see their environment (may takes a long time to configure) be broken by us because pip install dattri reinstall their torch again.

TheaperDeng commented 5 months ago

But we may want to test multiple torch versions in our pytest (not in the "install_requires"). Good catch, that should be done later.

jiaqima commented 4 months ago

Closing this issue as we now have added dependencies in pyproject.toml in #38.