-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch setup to Poetry #257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #257 +/- ##
===========================================
- Coverage 82.12% 21.41% -60.71%
===========================================
Files 48 46 -2
Lines 4661 4300 -361
Branches 0 659 +659
===========================================
- Hits 3828 921 -2907
- Misses 833 3357 +2524
- Partials 0 22 +22
Continue to review full report at Codecov.
|
I think codecov has been a bit buggy recently. Running pytest locally, the percentage is now at 72%, not 25%: ---------- coverage: platform darwin, python 3.7.10-final-0 ----------
Name Stmts Miss Branch BrPart Cover
---------------------------------------------------------------------------------------------------
src/innvestigate/__init__.py 6 0 0 0 100%
src/innvestigate/analyzer/__init__.py 21 0 0 0 100%
src/innvestigate/analyzer/base.py 312 48 112 14 82%
src/innvestigate/analyzer/deeptaylor.py 47 2 20 0 97%
src/innvestigate/analyzer/gradient_based.py 113 13 34 5 88%
src/innvestigate/analyzer/misc.py 26 0 8 0 100%
src/innvestigate/analyzer/pattern_based.py 98 6 28 7 90%
src/innvestigate/analyzer/relevance_based/__init__.py 1 0 0 0 100%
src/innvestigate/analyzer/relevance_based/relevance_analyzer.py 289 45 87 10 77%
src/innvestigate/analyzer/relevance_based/relevance_rule.py 242 66 148 5 67%
src/innvestigate/analyzer/relevance_based/utils.py 34 17 18 6 48%
src/innvestigate/analyzer/wrapper.py 161 10 54 12 89%
src/innvestigate/applications/__init__.py 0 0 0 0 100%
src/innvestigate/applications/imagenet.py 74 46 14 0 32%
src/innvestigate/applications/mnist.py 36 36 6 0 0%
src/innvestigate/layers.py 324 60 69 10 79%
src/innvestigate/tools/__init__.py 5 0 0 0 100%
src/innvestigate/tools/pattern.py 218 33 87 16 78%
src/innvestigate/tools/perturbate.py 208 48 85 30 68%
src/innvestigate/utils/__init__.py 71 30 32 3 49%
src/innvestigate/utils/keras/__init__.py 24 5 12 1 72%
src/innvestigate/utils/keras/backend.py 57 31 24 6 40%
src/innvestigate/utils/keras/checks.py 94 19 30 3 76%
src/innvestigate/utils/keras/graph.py 498 182 325 37 64%
src/innvestigate/utils/visualizations.py 60 7 16 7 79%
---------------------------------------------------------------------------------------------------
TOTAL 3019 704 1209 172 72% |
This PR updates the packaging tools, dev dependencies and CI.
The source code remains untouched. Reopened from #254.
Relevant requirements
Changes
Project structure
todo_before_release.md
tests
foldersrc
layoutpyproject.toml
pyproject.toml
.flake8
.pylintrc
tox.ini
Breaking changes
Currently, I've tagged this as
1.10.0
in thepyproject.toml
for the next release, however you might want to use version number2.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'spoetry.lock
ensures everyone working on the package uses consistent package versions.Building and publishing to PyPI is as easy as
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 asrc
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.
Removing DeepLift
As this PR is working towards a release of iNNvestigate for TF2, DeepLift was removed to lighten the workload. The original repo also still only provides TF1 support