Skip to content
Merged
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
27 changes: 17 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
python -m pytest --cov=$MOD_NAME $MOD_DPATH ../tests
cd ..
- name: Upload sdist artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-src
path: ./wheelhouse/*.tar.gz

build_binary_wheels:
Expand All @@ -53,21 +53,21 @@ jobs:
strategy:
matrix:
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
cibw_skip: ["*-win32"]
cibw_skip: ["win32"]
arch: [auto]
include:
- os: windows-latest
arch: auto
cibw_skip: '*-win_amd64'
cibw_skip: 'win_amd64'
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Enable MSVC 64bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
if: matrix.os == 'windows-latest' && matrix.cibw_skip == 'win32'
- name: Enable MSVC 32bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
if: matrix.os == 'windows-latest' && matrix.cibw_skip == 'win_amd64'
with:
arch: x86
- name: Build binary wheels
Expand All @@ -78,7 +78,7 @@ jobs:
env:
CIBW_BUILD_VERBOSITY: 1
#CIBW_TEST_COMMAND: pytest
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_SKIP: "*-${{ matrix.cibw_skip }}"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
- name: Show built files
shell: bash
Expand Down Expand Up @@ -107,12 +107,13 @@ jobs:
name: Codecov Upload
with:
file: ./tests/coverage.xml
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload wheels artifact
with:
name: wheels
name: wheels-${{ matrix.os }}-${{ matrix.cibw_skip }}
path: ./wheelhouse/*.whl


publish_wheels:
name: Publish Wheels
runs-on: ubuntu-latest
Expand All @@ -121,11 +122,17 @@ jobs:
- build_sdist

steps:
- name: Merge wheels
uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: wheels-*

- name: Checkout source
uses: actions/checkout@v4

- name: Download wheels and sdist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
path: wheelhouse
Expand Down
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="lark@erezsh.com",
description="A Lark plugin that optimizes LALR parsing using Cython",
Expand Down
Loading