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

1.4.3 has no attribute __version__ #148

Closed
brobr opened this issue Jul 2, 2022 · 2 comments
Closed

1.4.3 has no attribute __version__ #148

brobr opened this issue Jul 2, 2022 · 2 comments

Comments

@brobr
Copy link

brobr commented Jul 2, 2022

Hi thanks for kiwi-solver; it has been working impeccably for years but today I've run into a problem after upgrading to version 1.4.3.

When running a program depending on matplotlib-3.5.2 (and therefore kiwi-solver), it stalls on not finding __version__:

File "/usr/lib64/python3.9/site-packages/matplotlib/init.py", line 203, in _check_versions
if parse_version(module.__version__) < parse_version(minver):
AttributeError: module 'kiwisolver' has no attribute '__version__'

or when directly asking for it in ipython:

In [1]: import kiwisolver
In [2]: kiwisolver.__version__
AttributeError Traceback (most recent call
last) Input In [2], in <cell line: 1>()
----> 1 kiwisolver.__version__

AttributeError: module 'kiwisolver' has no attribute '__version__'

Downgrading to 1.4.2 restores function. This is built with exactly the same script as used for 1.4.3.

This is on Slackware64-15.0+ (current) with python-3.9.13; python-setuptools-57.5; Cython-0.29.28

FYI, a python slackware package gets built via a script usually calling setup.py:

# Workaround - ensure egg.info folder is named kiwisolver-1.4.3-py3.9-egg.
sed -i "/setup(/a \ \ name='kiwisolver'," setup.py

python3 setup.py install --root $PKG

@brobr
Copy link
Author

brobr commented Jul 2, 2022

The maintainer of the slackbuild metioned this:

From kiwisolver 1.4.2 to 1.4.3, these 2 lines were removed from the upstream setup.py, under setup():
package_dir={"": "py"},
packages=["kiwisolver"],

The removal of these 2 lines caused the problem you mentioned.

It is solved at our end by

Therefore, please add the following line to kiwisolver.SlackBuild (just before python3 setup.py install --root $PKG):
sed -i "/name='$SRCNAM',/a \   \ package_dir={'': 'py'},\n    packages=['$SRCNAM']," setup.py

@MatthieuDartiailh
Copy link
Member

The central reason for the breakage is that kiwi moved fully to a PEP 517 based installation process meaning that setup.py should not be invoked directly anymore. It was kept to preserve editable installs even thought the are of little interest for kiwi.

Also as listed in pyproject the minimal setuptools version is 61.2.

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

No branches or pull requests

2 participants