JohannesBuchner / imagehash

A Python Perceptual Image Hashing Module
BSD 2-Clause "Simplified" License
3.19k stars 329 forks source link

Fixed deprecation notice (numpy) & Added Github action #137

Closed qathom closed 3 years ago

qathom commented 3 years ago

Supress warning with numpy >= v1.20 Related issue: #136

JohannesBuchner commented 3 years ago

Please check that numpy.bool does not occur in other places.

Are there any other deprecations from the numpy page https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations popping up when running the tests (python3 setup.py test)?

There is currently an issue with the CI, as free travis is not available anymore. I haven't had the time yet, but it should be fairly straightforward to set up with Github actions with the same commands as in https://github.com/JohannesBuchner/imagehash/blob/master/.travis.yml#L48 .

qathom commented 3 years ago

Hi @JohannesBuchner

  1. Numpy deprecation notice: no, I think it's all good.

  2. Github action: I'm pretty familiar with Github actions. I tested on my fork and it is working well! I let you review the file (already committed). Note that I'm running the tests with "pytest" command after installing the dependencies with setup.py.

image

qathom commented 3 years ago

Now using conda for the full Github action. Changes are not breaking the steps.

image

JohannesBuchner commented 3 years ago

Is Python 2.7 still feasible? It was in Travis, as was 3.5.

The three conda install steps can be pulled together into one, which avoids delays from dependency resolution.

Please delete travis.yml then as well.

Are you familiar with pyproject.toml also? Would it be worthwhile to switch to that?

qathom commented 3 years ago

Hi @JohannesBuchner

Python compatibility I would recommend to drop Python 2+ compatibility since it is discontinued (2020). But still... I added Python 2.7 in the Github action and it is working :-)

The End Of Life date (EOL, sunset date) for Python 2.7 has been moved five years into the future, to 2020. This decision was made to clarify the status of Python 2.7 and relieve worries for those users who cannot yet migrate to Python 3. See also PEP 466.

Conda steps I updated the steps - it should be good now?

Project dependencies

pyproject.toml

I'm not familiar with pyproject.toml, but I read more about it. I added the minimum required dependencies in the file.

JohannesBuchner commented 3 years ago

OK, since we are both unfamiliar, please remove pyproject.toml for now. We can handle this in another PR.

qathom commented 3 years ago

Hi @JohannesBuchner Yes sure, I just deleted the file. Should we move forward?

JohannesBuchner commented 3 years ago

Thank you, I merged this. CI seems to work. I still need to make it submit to coveralls and update the README file badge.

qathom commented 3 years ago

Ah yes, there is this plugin for example: https://github.com/marketplace/actions/coveralls-github-action Are you planning to create a release as well? Looking forward :-)

JohannesBuchner commented 3 years ago

Yes, I just added a release, and coveralls works now. I could not get pytest to complete in 3.5 -- if you can look into that?

qathom commented 3 years ago

Hi @JohannesBuchner Yes! I also had an error with Python 3.5. I could fix it by adding packaging in the Github action. I open another PR accordingly.