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
28 stars 8 forks source link

Migrate setup to pyproject #38

Closed jiaqima closed 4 months ago

jiaqima commented 4 months ago

Description

This PR migrates package metadata from setup.py to pyproject.toml and fix pytest.yml.

1. Motivation and Context

setup.py is a bit messy.

In addition, since we now use self-hosted runners, the installed packages will not be automatically deleted from the sandbox, making pytest sometimes fail due to the leftover of previous GitHub action runs.

This PR mainly changes the package installation process.

2. Summary of the change

This PR migrates to using pyproject.toml. pytest.yml is changed accordingly for package installation.

This PR also changes the dattri installation in pytest.yml to pip install -e .[test,full], and clean up the installed dattri package after pytest.

3. What tests have been added/updated for the change?

Tested locally on my laptop by running the following:

pip install -e .[test, full]
pytest -v

and all tests passed.