Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

MNT: Always compile Cython at build time #149

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include LICENSE_Python.txt
include README.rst
include python25.pxd
include timers.h
include _line_profiler.c
exclude _line_profiler.c
include unset_trace.h
recursive-include tests *.py
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools",
"wheel",
"cython"
]
14 changes: 5 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import sys

# Monkeypatch distutils.
Expand All @@ -7,22 +6,16 @@
import distutils.errors
from distutils.core import setup
from distutils.extension import Extension
from distutils.log import warn

try:
from Cython.Distutils import build_ext
cmdclass = dict(build_ext=build_ext)
line_profiler_source = '_line_profiler.pyx'
except ImportError:
cmdclass = {}
line_profiler_source = '_line_profiler.c'
if not os.path.exists(line_profiler_source):
raise distutils.errors.DistutilsError("""\
raise distutils.errors.DistutilsError("""\
You need Cython to build the line_profiler from a git checkout, or
alternatively use a release tarball from PyPI to build it without Cython.""")
else:
warn("Could not import Cython. "
"Using the available pre-generated C file.")


long_description = """\
line_profiler will profile the time individual lines of code take to execute.
Expand Down Expand Up @@ -78,6 +71,9 @@
'kernprof=kernprof:main',
],
},
setup_requires = [
'cython',
],
install_requires = [
'IPython>=0.13',
],
Expand Down