albermax / innvestigate

A toolbox to iNNvestigate neural networks' predictions!
Other
1.25k stars 234 forks source link

Switch setup to Poetry #254

Closed adrhill closed 3 years ago

adrhill commented 3 years ago

This PR updates the packaging tools, dev dependencies and CI. The source code remains untouched.

Relevant requirements


Changes

Project structure

Breaking changes

Currently, I've tagged this as 1.10.0 in the pyproject.toml for the next release, however you might want to use version number 2.0.0 according to the Semantic Versioning convention, as this makes incompatible API changes by removing DeepLIFT.

Reasoning

Poetry

Poetry is a dependency manager and packaging tool that uses PEP 518's pyproject.toml to define dependencies, settings and build systems in a single file.

Poetry automatically resolves dependency conflicts within the specified version constraints and makes it trivial to set up venvs using poetry install. Poetry's poetry.lock ensures everyone working on the package uses consistent package versions.

Building and publishing to PyPI is as easy as

poetry build
poetry publish

Command line dev dependencies like pytest, black and tox can be run using poetry run pytest.

GitHub Actions instead of Travis CI

Travis CI is not free of charge anymore, only giving a limited amount of credits to OSS projects.

Project structure

Using a separate tests folders is considered best pratice in the pytest docs. It is "strongly suggested" to use a src layout so that tools like tox test installed versions of the package instead of local code from the repository.

More discussion can be found here and here.

Dependencies

This PR temporarily uses Keras 2.3 as it is the first and last multi-backend Keras release that supports both TF2 as well as TF1.

albermax commented 3 years ago

What is the reason to remove deeplift?

Mind that there are merge conflicts that need to fixed first (see beow).

adrhill commented 3 years ago

Sorry, that rebase didn't work quite as I imagined it... Let me reopen the PR to get a clean Git commit history.