Skip to content
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

Toml + Tox Migration #270

Merged
merged 37 commits into from
Jun 23, 2023
Merged

Toml + Tox Migration #270

merged 37 commits into from
Jun 23, 2023

Conversation

aaarrti
Copy link
Collaborator

@aaarrti aaarrti commented Jun 7, 2023

Description

  • Migrate from deprecated setup.pyinstall to recommended by pypa (the team behind pipy) pyproject.toml, build and filt-core as build backend.
  • Centralize all testing, linting, etc., configuration in tox.ini. Tox has nothing to do with packaging, it is used for test automation. At this point, the benefit is minimal, but this is a prerequisite for "integration testing". Tox will allow us to create different isolated environments with or without TensorFlow, which will help us ensure Quantus is usable in all of it's
    different installation variants.
  • To ensure the packaging still works, and it won't affect users, I will add an action to do a pre-release (often called nightly release, dev release, snapshot release), and first verify it there. However, to run the action, it must be present in the main branch.

Implemented changes

  • Insert a description of the changes implemented in the pull request.
    • replace setup.py with pyproject.toml
    • add tox.ini, add testing, linting, coverage configurations to it.
    • update GitHub actions to use tox environments.
    • update readme describing how to use tox for testing locally.
    • add action to do a pre-release.

Minimum acceptance criteria

  • Nothing got broken
  • @annahedstroem I have published in-development version to Test PyPi https://test.pypi.org/project/quantus/. Please share your username, so I can add you to the project. As for the public release process, I have added a script for it, so just run ./scripts/github_release.sh.

@aaarrti aaarrti marked this pull request as ready for review June 7, 2023 16:51
@aaarrti aaarrti marked this pull request as draft June 7, 2023 16:52
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2023

Codecov Report

Merging #270 (6055bf6) into main (f94853b) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #270   +/-   ##
=======================================
  Coverage   92.87%   92.87%           
=======================================
  Files          60       60           
  Lines        3200     3200           
=======================================
  Hits         2972     2972           
  Misses        228      228           

@aaarrti aaarrti changed the title wip Toml + Tox Migration Jun 15, 2023
@aaarrti aaarrti marked this pull request as ready for review June 15, 2023 12:47
Copy link
Member

@annahedstroem annahedstroem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor comments. Once resolved I will go about testing the installations.

CONTRIBUTING.md Outdated
pytest
# To list all test environments, run:
python3 -m tox list
# To execute all test environments run:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment on different commands

CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@@ -0,0 +1,35 @@
#!/usr/bin/env zsh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a source to this file to how this file was developed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear to me how this file is used, how is the tag chosen by the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd choose tag, e.g., v.4.0.2 and run ./scripts/github_release v.4.0.2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, can you add that running instructions ./scripts/github_release v.4.0.2 including all the build step, as a subsection in https://quantus.readthedocs.io/en/latest/docs_dev/CONTRIBUTING.html?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this gitub_release.sh can you provide a source to this file as a comment (to how this file was developed)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh, I am not a big fan of this script either. Let's try to catch up in the following days, and talk about how would you want to organize the release process.

scripts/github_release.sh Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
README.md Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@@ -0,0 +1,35 @@
#!/usr/bin/env zsh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this gitub_release.sh can you provide a source to this file as a comment (to how this file was developed)?

@annahedstroem
Copy link
Member

annahedstroem commented Jun 23, 2023

There is a discrepancy betwee CONTRIBUTING.md under root and under docs/. Under docs/ it is still outdated.

git clone https://github.com/understandable-machine-intelligence-lab/Quantus.git
cd quantus
pip install -r requirements_test.txt
pip install -e .

@annahedstroem
Copy link
Member

There is a discrepancy betwee CONTRIBUTING.md under root and under docs/. Under docs/ it is still outdated.

git clone https://github.com/understandable-machine-intelligence-lab/Quantus.git
cd quantus
pip install -r requirements_test.txt
pip install -e .

I'll update this and push it.

@annahedstroem annahedstroem merged commit 2af6a70 into main Jun 23, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants