CLImage icon indicating copy to clipboard operation
CLImage copied to clipboard

climage does not work on python 3.12

Open aleivag opened this issue 1 year ago • 3 comments

climage cant run on python 3.12 becausevit imports pkg_resources in

https://github.com/pnappa/CLImage/blob/master/climage/init.py#L4

so if you do:

➜  /tmp python3.12 -m 'venv' /tmp/venv
➜  /tmp /tmp/venv/bin/pip install climage
Collecting climage
  Using cached climage-0.2.0-py3-none-any.whl.metadata (2.7 kB)
Collecting Pillow (from climage)
  Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.2 kB)
Collecting kdtree (from climage)
  Using cached kdtree-0.16-py2.py3-none-any.whl.metadata (1.3 kB)
Using cached climage-0.2.0-py3-none-any.whl (21 kB)
Using cached kdtree-0.16-py2.py3-none-any.whl (7.7 kB)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.5 MB)
Installing collected packages: kdtree, Pillow, climage
Successfully installed Pillow-10.4.0 climage-0.2.0 kdtree-0.16

[notice] A new release of pip is available: 23.3.2 -> 24.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
➜  /tmp /tmp/venv/bin/python -c 'import climage'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/venv/lib64/python3.12/site-packages/climage/__init__.py", line 4, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

off course climage could specify setuptools as part of the dependecies, but that would be an overkill to be honest. specially because this is just to fill the version field.

I volunteer to fix this issue, I propose the following solutions

  1. Lets turn this project around, and lets create a version.py file, thats the file we manipulate to increase versions.
  2. we either read that from setup.py, or better yet, we remove setup.py and just make it a pyproject.toml with a dynamic = ["version"] field to read the version from source
  3. if the mantainer wants it, i can also make this project hatch friendly, so taht bumping version is easy.
  4. and i can do, or provide gidance on how to cut a release though github actions every time a comit bumps the version.py file

let me know what you think... i'll play with a PR and attach it 6.

aleivag avatar Sep 27 '24 14:09 aleivag

did https://github.com/pnappa/CLImage/pull/11

aleivag avatar Sep 27 '24 15:09 aleivag

I've published version 0.2.1. Let me know if that fixes things.

pnappa avatar Sep 29 '24 05:09 pnappa

And even better, I've released 0.2.2 which fixes all the broken README images on PyPI 😉. There's no other functional changes in this version. https://pypi.org/project/climage/

Please update using pip3 install --upgrade climage.

pnappa avatar Sep 29 '24 06:09 pnappa