Skip to content

Commit

Permalink
Fix Cython build for Python 3.12 (#58)
Browse files Browse the repository at this point in the history
* Fix Cython build for Python 3.12

While at it:

- Add CI tests for Python 3.12.
- Remove 3.8 support in preparation of spaCy v4.

* GH actions: ignore Metal 2.0 paravirt warning
  • Loading branch information
danieldk committed Apr 9, 2024
1 parent a139a5e commit 63a0b0d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.11"]
python_version: ["3.12"]
include:
- os: ubuntu-20.04
python_version: "3.8"
- os: macos-latest
python_version: "3.9"
- os: windows-latest
python_version: "3.10"
- os: ubuntu-20.04
python_version: "3.11"
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -82,4 +82,4 @@ jobs:
- name: Run tests
shell: bash
run: |
python -m pytest --pyargs $MODULE_NAME -Werror
python -m pytest --pyargs $MODULE_NAME
2 changes: 0 additions & 2 deletions build-constraints.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# build version constraints for use with wheelwright + multibuild
numpy==1.17.3; python_version=='3.8' and platform_machine!='aarch64'
numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64'
numpy==1.19.3; python_version=='3.9'
numpy==1.21.3; python_version=='3.10'
numpy==1.23.2; python_version=='3.11'
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ requires = [
"spacy>=4.0.0.dev1,<4.1.0",
"numpy",
]

[tool.pytest.ini_options]
filterwarnings = [
"ignore:^.*Skipping device Apple Paravirtual device that does not support Metal 2.0.*",
]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ long_description_content_type = text/markdown

[options]
zip_safe = false
python_requires = >=3.8
python_requires = >=3.9
install_requires =
spacy>=4.0.0.dev1,<4.1.0

Expand Down
2 changes: 1 addition & 1 deletion spacy_experimental/biaffine_parser/arc_labeler.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: infer_types=True, profile=True, binding=True
# cython: infer_types=True, binding=True

from itertools import islice
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion spacy_experimental/biaffine_parser/arc_predicter.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: infer_types=True, profile=True, binding=True
# cython: infer_types=True, binding=True

from typing import Callable, Dict, Iterable, List, Optional
from itertools import islice
Expand Down
2 changes: 1 addition & 1 deletion spacy_experimental/biaffine_parser/mst.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: infer_types=True, profile=True, binding=True
# cython: infer_types=True, binding=True

# Copyright 2018-2020 Daniël de Kok and Tobias Pütz
# Copyright 2021 ExplosionAI GmbH
Expand Down
2 changes: 1 addition & 1 deletion spacy_experimental/char_tokenizer/char_ner_tokenizer.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: infer_types=True, profile=True, binding=True
# cython: infer_types=True, binding=True
from typing import Optional, Callable

import srsly
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: infer_types=True, profile=True, binding=True
# cython: infer_types=True, binding=True
from typing import Optional, Callable

import srsly
Expand Down

0 comments on commit 63a0b0d

Please sign in to comment.