From ad634c90ac825f91ebbd9876c957e83250b3c855 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 18 Mar 2020 15:06:37 -0500 Subject: [PATCH 1/2] Cythonize a pure python file --- recipe/build.sh | 3 +++ recipe/cythonize.patch | 17 +++++++++++++++++ recipe/meta.yaml | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 recipe/cythonize.patch diff --git a/recipe/build.sh b/recipe/build.sh index 0615cac..e3f1baf 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -9,3 +9,6 @@ $PYTHON -m conda init --install if [[ $(uname -o) == Msys ]]; then sed -i "s|CONDA_EXE=.*|CONDA_EXE=\'${PREFIXW//\\/\\\\}\\\\Scripts\\\\conda.exe\'|g" $PREFIX/etc/profile.d/conda.sh fi + +cd $SP_DIR/conda/common +cythonize -i _logic.py diff --git a/recipe/cythonize.patch b/recipe/cythonize.patch new file mode 100644 index 0000000..86ca117 --- /dev/null +++ b/recipe/cythonize.patch @@ -0,0 +1,17 @@ +diff --git a/conda/common/_logic.py b/conda/common/_logic.py +index 2852bfdbc..55c64cbc3 100644 +--- a/conda/common/_logic.py ++++ b/conda/common/_logic.py +@@ -669,7 +669,11 @@ class Clauses(object): + + lo = 0 + try0 = 0 +- for peak in ((True, False) if maxval > 1 else (False,)): ++ if maxval > 1: ++ peaks = (True, False) ++ else: ++ peaks = (False,) ++ for peak in peaks: + if peak: + log.trace('Beginning peak minimization') + objval = peak_val diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 113715b..4b165a6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,6 +11,7 @@ source: sha256: 123fc5b953fb62d85351f9f87b22b3849791d4d9818d790fe66e740058619259 patches: - gh9764.patch + - cythonize.patch build: number: 1 @@ -40,6 +41,7 @@ requirements: - pip - ruamel_yaml >=0.11.14,<0.16 - setuptools >=31.0.1 + - cython # [unix and python_impl == "cpython"] run: - python - conda-package-handling >=1.3.0 From 56446127cd59be3faa3d68cf1443c1bb57880955 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 18 Mar 2020 23:09:19 -0500 Subject: [PATCH 2/2] Update meta.yaml --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4b165a6..07bef01 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -31,6 +31,7 @@ requirements: - m2-filesystem # [win] - m2-bash # [win] - m2-base # [win] + - {{ compiler('c') }} # [unix and python_impl=="cpython"] host: - python