sagemath/sage

src/setup.py: Don't cythonize everything in src/

mkoeppe opened this issue · 12 comments

In the version of setup.py used by the editable install:

 extensions = cythonize(
        ["**/*.pyx"],

at least it should restrict itself to sage/**/*.pyx
so that it does not go cythonizing in random directories that the user may have in this directory... such as a venv...

Depends on #32673

CC: @tobiasdiez @kliem

Component: build

Author: Matthias Koeppe

Branch/Commit: ff2a352

Reviewer: Jonathan Kliem

Issue created by migration from https://trac.sagemath.org/ticket/32672

Author: Matthias Koeppe

Commit: 669ea2c

New commits:

669ea2csrc/setup.py: Restrict cythonize to sage/**

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

17acb7bDo not need Cython for sdist or egg_info
ff2a352src/setup.py: Restrict cythonize to sage/**

Changed commit from 669ea2c to ff2a352

Dependencies: #32673

Description changed:

--- 
+++ 
@@ -1,3 +1,4 @@
+In the version of setup.py used by the editable install:
 
 ```
  extensions = cythonize(
kliem commented

Reviewer: Jonathan Kliem

kliem commented
comment:7

LGTM.

Btw, this is how I verified how it works. cythonize calls extended_iglob

sage: _ = !cd $SAGE_SRC
sage: from Cython.Build.Dependencies import extended_iglob
sage: a = list(extended_iglob("sage/**/*.pyx"))
sage: b = list(extended_iglob("**/*.pyx"))
sage: list(t for t in b if not t in a)
['foo.pyx']
sage: list(t for t in a if not t in b)
[]

In my case I placed foo.pyx in SAGE_SRC.

comment:8

Thank you!