Skip to content

Commit 2ad4b3a

Browse files
authored
Merge pull request #58 from tiagocoutinho/cython-build-only
Remove cython from installation
2 parents d84961e + 200429d commit 2ad4b3a

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
python -m pytest --cov=$MOD_NAME $MOD_DPATH ../tests
4343
cd ..
4444
- name: Upload sdist artifact
45-
uses: actions/upload-artifact@v3
45+
uses: actions/upload-artifact@v4
4646
with:
47-
name: wheels
47+
name: wheels-src
4848
path: ./wheelhouse/*.tar.gz
4949

5050
build_binary_wheels:
@@ -53,21 +53,21 @@ jobs:
5353
strategy:
5454
matrix:
5555
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
56-
cibw_skip: ["*-win32"]
56+
cibw_skip: ["win32"]
5757
arch: [auto]
5858
include:
5959
- os: windows-latest
6060
arch: auto
61-
cibw_skip: '*-win_amd64'
61+
cibw_skip: 'win_amd64'
6262
steps:
6363
- name: Checkout source
6464
uses: actions/checkout@v4
6565
- name: Enable MSVC 64bit
6666
uses: ilammy/msvc-dev-cmd@v1
67-
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
67+
if: matrix.os == 'windows-latest' && matrix.cibw_skip == 'win32'
6868
- name: Enable MSVC 32bit
6969
uses: ilammy/msvc-dev-cmd@v1
70-
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
70+
if: matrix.os == 'windows-latest' && matrix.cibw_skip == 'win_amd64'
7171
with:
7272
arch: x86
7373
- name: Build binary wheels
@@ -78,7 +78,7 @@ jobs:
7878
env:
7979
CIBW_BUILD_VERBOSITY: 1
8080
#CIBW_TEST_COMMAND: pytest
81-
CIBW_SKIP: ${{ matrix.cibw_skip }}
81+
CIBW_SKIP: "*-${{ matrix.cibw_skip }}"
8282
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
8383
- name: Show built files
8484
shell: bash
@@ -107,12 +107,13 @@ jobs:
107107
name: Codecov Upload
108108
with:
109109
file: ./tests/coverage.xml
110-
- uses: actions/upload-artifact@v3
110+
- uses: actions/upload-artifact@v4
111111
name: Upload wheels artifact
112112
with:
113-
name: wheels
113+
name: wheels-${{ matrix.os }}-${{ matrix.cibw_skip }}
114114
path: ./wheelhouse/*.whl
115115

116+
116117
publish_wheels:
117118
name: Publish Wheels
118119
runs-on: ubuntu-latest
@@ -121,11 +122,17 @@ jobs:
121122
- build_sdist
122123

123124
steps:
125+
- name: Merge wheels
126+
uses: actions/upload-artifact/merge@v4
127+
with:
128+
name: wheels
129+
pattern: wheels-*
130+
124131
- name: Checkout source
125132
uses: actions/checkout@v4
126133

127134
- name: Download wheels and sdist
128-
uses: actions/download-artifact@v3
135+
uses: actions/download-artifact@v4
129136
with:
130137
name: wheels
131138
path: wheelhouse

setup.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@
55

66
# python .\setup.py build_ext --inplace
77

8-
9-
# Delayed import; https://stackoverflow.com/questions/37471313/setup-requires-with-cython
10-
try:
11-
from Cython.Build import cythonize
12-
except ImportError:
13-
14-
def cythonize(*args, **kwargs):
15-
from Cython.Build import cythonize
16-
17-
return cythonize(*args, **kwargs)
8+
from Cython.Build import cythonize
189

1910

2011
def parse_description():
@@ -38,8 +29,8 @@ def parse_description():
3829
packages=find_packages(),
3930
ext_modules=cythonize("lark_cython/*.pyx"), # accepts a glob pattern
4031
requires=["Cython"],
41-
install_requires=["lark>=1.1.7", "cython>=3.0,<3.1", "Cython>=3.0,<3.1"],
42-
setup_requires=["Cython"],
32+
install_requires=["lark>=1.1.7"],
33+
setup_requires=["Cython>=3.0,<3.1"],
4334
author="Erez Shinan",
4435
author_email="lark@erezsh.com",
4536
description="A Lark plugin that optimizes LALR parsing using Cython",

0 commit comments

Comments
 (0)