Skip to content
Merged
Changes from 2 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
15 changes: 3 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@

# python .\setup.py build_ext --inplace


# Delayed import; https://stackoverflow.com/questions/37471313/setup-requires-with-cython
try:
from Cython.Build import cythonize
except ImportError:

def cythonize(*args, **kwargs):
from Cython.Build import cythonize

return cythonize(*args, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not doing anything that fixes installation without cython installed.
The real fix was on pyproject.toml by adding cython as build dependency

from Cython.Build import cythonize


def parse_description():
Expand All @@ -38,8 +29,8 @@ def parse_description():
packages=find_packages(),
ext_modules=cythonize("lark_cython/*.pyx"), # accepts a glob pattern
requires=["Cython"],
install_requires=["lark>=1.1.7", "cython>=3.0,<3.1", "Cython>=3.0,<3.1"],
setup_requires=["Cython"],
install_requires=["lark>=1.1.7"],
setup_requires=["Cython>=3.0,<3.1"],
author="Erez Shinan",
author_email="[email protected]",
description="A Lark plugin that optimizes LALR parsing using Cython",
Expand Down
Loading