question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setuptools version

61.0.0

Python version

3.9

OS

Debian Unstable

Additional environment information

No response

Description

kiwisolver 1.4.0 (I haven’t checked earlier versions, but kiwisolver 1.4.0 did modernise their build, so issues with earlier versions will likely be to different code) can no build from source. I filed https://github.com/nucleic/kiwi/issues/130 with the kiwisolver developers, but it appears that setuptools 60.10.0 does work. Based on looking at https://github.com/pypa/setuptools/compare/v60.10.0...v61.0.0 and the error message that appears (see output), I think this is related to the new(?) package discovery mechanism. I’m not a kiwisolver developer, so I can’t answer questions about their build system (other than link you to the repository), but I’m filing this as it appears to be a regression (give setuptools 61 came out 10 hours ago when I wrote this).

Expected behavior

I expect pip install kiwisolver would build a wheel and install it.

How to Reproduce

  1. Run pip install kiwisolver (given kiwisolver has wheels, you may need to disable using wheels to not download a pre-built wheel).

Output

      /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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:40 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
abravalhericommented, Mar 25, 2022

Thank you very much for reporting this.

My understanding is that unfortunately there is a clash of 2 behaviours:

To make these changes as backwards compatible as possible, I added a condition that only works for packages not using pyproject.toml that will check if ext_modules is given and then skip auto-discovery.

But, going forward my assumption was that it is very common for packages to mix both regular Python code with extensions. So if a project is using pyproject.toml for metadata, auto-discovery is always on.

I did not foresee that kiwisolver was providing metadata in both pyproject.toml and setup.py already before the latest change. Sorry for that.

@MatthieuDartiailh, one way to disable auto discovery is to explicitly set py_modules=[] in setup.py or py-modules = [] in pyproject.toml [tool.setuptools]. Would that work for you?

If that is a viable alternative, it would help a lot! I was hopping to keep the auto-discovery always on for packages using pyproject.toml

2reactions
david-fortinicommented, Mar 28, 2022

As a quick fix, in setup.py

setuptools.setup(..,packages=[],..)

or

setuptools.setup(..,py_modules=[],..)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug (2006) - IMDb
An unhinged war veteran holes up with a lonely woman in a spooky Oklahoma motel room. The line between reality and delusion is...
Read more >
Bug Definition & Meaning - Merriam-Webster
The meaning of BUG is any of an order (Hemiptera and especially its suborder Heteroptera) of insects (such as an assassin bug or...
Read more >
bug - Wiktionary
(entomology) An insect of the order Hemiptera (the “true bugs”). Any of various species of marine or freshwater crustaceans; e.g. a Moreton Bay...
Read more >
Bug - Wikipedia
A terrestrial arthropod animal (with at least six legs). Insect, a six-legged arthropod · Covert listening device, used in surveillance, espionage and policing ......
Read more >
Bug Definition & Meaning - Dictionary.com
Bug definition, a hemipterous insect. See more. ... verb (used with object), bugged, bug·ging. ... bug out, Slang. to flee in panic; show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found