pypa / pypa/setuptools

Module with __init__.pyx is not recognized by setuptools.find_packages()

Open
#1,509 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Needs Investigation
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

A module with a Cythonized init.pyx (but other files being a *.py file) is not recognized by setuptools.find_packages():

$ mkdir mymodule
$ touch mymodule/__init__.pyx mymodule/__init__.cpython-36m-x86_64-linux-gnu.so mymodule/__init__.c
$ python3 -c "import setuptools; print(setuptools.find_packages('.'))"
[]
$ touch mymodule/__init__.py
$ python3 -c "import setuptools; print(setuptools.find_packages('.'))"
['mymodule']

However, if I put an __init__.py in there as well, I don't think I can properly import the Cython .so module anymore. Is this a bug of sorts? I don't know what to do about this...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown mymodule layout and inspect setuptools.find_packages() and its package-discovery entry point. Determine how a directory with only a Cythonized init.pyx should be recognized, then add coverage showing the package is found without requiring an init.py file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.