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.0 fails to build from source #130

Closed
aragilar opened this issue Mar 25, 2022 · 22 comments
Closed

1.4.0 fails to build from source #130

aragilar opened this issue Mar 25, 2022 · 22 comments

Comments

@aragilar
Copy link

It appears there's something wrong with either setup.py or pyproject.toml for 1.4.0, as trying to build from source gives the following:

      /tmp/pip-build-env-nwrt4o9m/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py:100: _ExperimentalProjectMetadata: Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.
        warnings.warn(msg, _ExperimentalProjectMetadata)
      Install ``trove-classifiers`` to ensure proper validation. Meanwhile a list of classifiers will be downloaded from PyPI.
      error: Multiple top-level packages discovered in a flat-layout: ['py', 'kiwi'].
      
      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.
      
      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:
      
      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names
      
      To find more information, look for "package discovery" on setuptools docs.

This is in a clean Python 3.9 virtualenv with

pip==22.0.2
setuptools==61.0.0
wheel==0.37.1
@MatthieuDartiailh
Copy link
Member

Thanks for the report. It may be related to the latest setuptools release. Can you post the exact comment you invoked ?

@aragilar
Copy link
Author

pip install kiwisolver is how I tried to install it.

@aragilar
Copy link
Author

I'm not sure it's a setuptools issue, setuptools 49.6.0 also gives the same error (I tried some other setuptools releases, and I did upgrade setuptools initially when the install failed).

@aragilar
Copy link
Author

Ah, it does look like a setuptools issue (partially), as if I use --no-build-isolation with setuptools 60.10.0, then I do get a different error.

  WARNING: Requested kiwisolver==1.4.0 from http://localhost:3141/root/pypi/%2Bf/750/8b01e211178a8/kiwisolver-1.4.0.tar.gz#sha256=7508b01e211178a85d21f1f87029846b77b2404a4c68cbd14748d4d4142fa3b8, but installing version 0.0.0
Discarding http://localhost:3141/root/pypi/%2Bf/750/8b01e211178a8/kiwisolver-1.4.0.tar.gz#sha256=7508b01e211178a85d21f1f87029846b77b2404a4c68cbd14748d4d4142fa3b8 (from http://localhost:3141/aragilar/dev/+simple/kiwisolver/) (requires-python:>=3.7): Requested kiwisolver==1.4.0 from http://localhost:3141/root/pypi/%2Bf/750/8b01e211178a8/kiwisolver-1.4.0.tar.gz#sha256=7508b01e211178a85d21f1f87029846b77b2404a4c68cbd14748d4d4142fa3b8 has inconsistent version: filename has '1.4.0', but metadata has '0.0.0'
ERROR: Could not find a version that satisfies the requirement kiwisolver==1.4.0 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.4.0)
ERROR: No matching distribution found for kiwisolver==1.4.0

@aragilar
Copy link
Author

Ah, and that's fixed by installing setuptools_scm[toml]>=3.4.3. So I think this is a setuptools regression.

@aragilar
Copy link
Author

I've filed pypa/setuptools#3197 with the setuptools developers.

@MatthieuDartiailh
Copy link
Member

Based on your first error message setuptools may be confused by the fact that kiwi does not have any source to include since it is a single C extension. If you want to experiment you could try specifying it explicitly in setup.py .

@aragilar
Copy link
Author

I suspect there's some underlying assumption in setuptools that there will be some python files to package (as far as I can see kiwisolver has none, as the tests aren't included). I wonder if having a dummy __init__.py which imports everything from the shared library might make setuptools happy (and the tests could be installed also, if so desired).

@MatthieuDartiailh
Copy link
Member

Actually it may take some extra work since I apparently messed up and the type annotations are not installed properly currently. So I will indeed need a package to hold both the extension and the annotations. It will take me some time to get to it. If this is something you would be interested in working into let me know.

@Haiz14
Copy link

Haiz14 commented Mar 25, 2022

Is there something i can do to install kiwi ? Since kiwi required to install matplotlib

@MatthieuDartiailh
Copy link
Member

Wheels should install just fine. I believe the issue only affects building from source.

@Haiz14
Copy link

Haiz14 commented Mar 25, 2022

Yeah I am using termux an android emulator of bash. So there's no wheel for it. Seems like i gotta wait for it to be solved.

@MatthieuDartiailh
Copy link
Member

You can clone the repo and put a bound setuptools<=60 in pyproject.toml. Only the latest version of setuptools broke things.

@TimoRoth
Copy link

This is breaking our entire CI environment. And thanks to build isolation, which always pulls in the latest setuptools version, I can't even fix it with a pin.
Is this an issue with setuptools, or with kiwisolver?

@MatthieuDartiailh
Copy link
Member

Setuptools broke kiwi. However it also helped discover some issues related to the distribution of type hints. #131 will fix both. I will do my best to make a 1.4.1 release shortly.

@MatthieuDartiailh
Copy link
Member

#131 is in so you should be able to build from the repo at least.

@Haiz14
Copy link

Haiz14 commented Mar 27, 2022

You can clone the repo and put a bound setuptools<=60 in pyproject.toml. Only the latest version of setuptools broke things.

I installed an older version of setuptools. But I am still getting the error aragilar posted in the first post.

~/app $ pip list | grep setup
setuptools 59.8.0
~/app $ pip install --no-cache-dir kiwisolver

Error : https://pastebin.com/tJv40qAe

@MatthieuDartiailh
Copy link
Member

Due to how pip manage isolated build environment you are still getting the latest setuptools (hence my recommandation to edit pyproject.toml).

#131 has been merged so main should now build cleanly. I will do a new release ASAP.

@TimoRoth
Copy link

setuptools also in the meantime released bugfix versions that should restore the ability to build 1.4.0.
But apparently it didn't work for kiwisolver?

@MatthieuDartiailh
Copy link
Member

Setuptools bug fixes does not disable auto discovery which causes the issue in kiwisolver. I will do my best to cut 1.4.1 today

@MatthieuDartiailh
Copy link
Member

Should be fixed by 1.4.1

@Haiz14
Copy link

Haiz14 commented Mar 27, 2022

Should be fixed by 1.4.1

It works now thks a lot.

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

4 participants