cython / cython/cython

[BUG] cython can't find *.h/pxd files for a package, which is installed as editable

Open
#5,232 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cython
Stars
10.8k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
39

Description

I would expect there should be no difference for pip install -e . wrt pip install .. But see the example below.

Code to reproduce the behaviour:
  1. Clone https://github.com/aleaxit/gmpy/
  2. Create & enable venv (this hardly matter)
  3. Install cython: pip install cython
  4. Make editable install: pip install -e .
  5. Run tests: python test_cython/runtests.py (which fails with "'gmpy2.pxd' not found", etc)
  6. Now do usual install: pip install .
  7. Run tests: python test_cython/runtests.py - now pass.

The is a workaround for (5): PYTHONPATH=pwd/gmpy2 python test_cython/runtests.py.

Environment

Python 3.11.1+ (heads/3.11:ba88628808, Jan 14 2023, 08:40:06) [GCC 10.2.1 20210110] on linux
Cython version 0.29.33

Contributor guide

Open the contributing guide

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 difference in a clean environment using the gmpy example and test_cython/runtests.py, comparing pip install -e . with pip install .. Investigate how the editable installation exposes gmpy2.pxd and *.h files to Cython; done means the tests pass after the editable install without setting PYTHONPATH.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.