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

Add CI workflow for running doctests #11

Merged
merged 19 commits into from
Oct 19, 2022
Merged

Conversation

elliotwutingfeng
Copy link
Contributor

@elliotwutingfeng elliotwutingfeng commented Oct 18, 2022

Addresses #9

  • Added CI workflow for testing on windows, macos and ubuntu

I found that all tests were passing except on Ubuntu due to mismatched outputs, you can check the GitHub Actions logs for more details.

Copy link
Owner

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Thanks for this! Just a couple of minor comments.

Do you want to address the ANTIALIAS warning issue from #9 as well?

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
dhash.py Outdated Show resolved Hide resolved
@benhoyt
Copy link
Owner

benhoyt commented Oct 18, 2022

Do you have any suggestions for how to fix the test failures on Linux? It's odd that the numbers are off by one in some cases, given that it's the same architecture and Pillow/Wand versions. My guess is floating point rounding issues?

@elliotwutingfeng
Copy link
Contributor Author

Thanks for this! Just a couple of minor comments.

Do you want to address the ANTIALIAS warning issue from #9 as well?

I've replaced it with PIL.Image.Resampling.LANCZOS. Test results are the same as before.

@elliotwutingfeng
Copy link
Contributor Author

Do you have any suggestions for how to fix the test failures on Linux? It's odd that the numbers are off by one in some cases, given that it's the same architecture and Pillow/Wand versions. My guess is floating point rounding issues?

Strangely, the tests pass locally on my Ubuntu x64 and Manjaro x64 virtual machines, on both Python 2 and 3 (3.10.6).

elliotwutingfeng and others added 5 commits October 19, 2022 05:47
Also fall back to PIL.Image.ANTIALIAS for older PIL versions
ERROR: Could not find a version that satisfies the requirement Pillow==9.2.0 (from versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.8.0, 2.8.1, 2.8.2, 2.9.0, 3.0.0, 3.1.0rc1, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.4.0, 3.4.1, 3.4.2, 4.0.0, 4.1.0, 4.1.1, 4.2.0, 4.2.1, 4.3.0, 5.0.0, 5.1.0, 5.2.0, 5.3.0, 5.4.0, 5.4.1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.2.2)
ERROR: No matching distribution found for Pillow==9.2.0
@benhoyt
Copy link
Owner

benhoyt commented Oct 19, 2022

Thanks, @elliotwutingfeng. I added a few more changes to allow older and new versions of Pillow, and "fixed" the tests.

@benhoyt benhoyt merged commit 730ce50 into benhoyt:master Oct 19, 2022
@elliotwutingfeng
Copy link
Contributor Author

I re-ran the old tests with this workflow (https://github.com/elliotwutingfeng/dhash/actions/runs/3280926289).

ubuntu-latest (ubuntu-20.04 as of today) uses an older version of libmagickwand-dev than ubuntu-22.04, that may be causing the output differences. See below.

https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#installed-apt-packages
https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#installed-apt-packages

The old tests are successful on 22.04 just like windows and macos. Python 2 had to be manually installed using apt-get on ubuntu-22.04 as it is deprecated. I think the delta workaround is not necessary.

ubuntu-latest will be bumped to ubuntu-22.04 by around December 2022.

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

2 participants