Skip to content

Commit

Permalink
Install Cython alpha and disable build isolation under free-threaded
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou committed Feb 17, 2025
1 parent d1e22ca commit 1c857ca
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 113 deletions.
6 changes: 3 additions & 3 deletions packaging/pep517_backend/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ def get_requires_for_build_wheel(

if is_pure_python_build:
c_ext_build_deps = []
elif sysconfig.get_config_var("Py_GIL_DISABLED"):
c_ext_build_deps = ['Cython == 3.1.0a1']
elif sysconfig.get_config_var('Py_GIL_DISABLED'):
c_ext_build_deps = ['Cython ~= 3.1.0a1']
else:
c_ext_build_deps = ['Cython ~= 3.0.0']
c_ext_build_deps = ['Cython ~= 3.0.11']

return _setuptools_get_requires_for_build_wheel(
config_settings=config_settings,
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ test-command = 'pytest -v -m "not hypothesis" --no-cov {project}/tests'
# don't build PyPy wheels, install from source instead
skip = "pp*"

# TODO: Remove this when there's a Cython 3.1 final release
# Remove PIP_CONSTRAINT from the environment
[[tool.cibuildwheel.overrides]]
select = "cp313t-*"
environment = {COLOR="yes", FORCE_COLOR="1", MYPY_FORCE_COLOR="1", PRE_COMMIT_COLOR="always", PY_COLORS="1"}

[tool.cibuildwheel.environment]
COLOR = "yes"
FORCE_COLOR = "1"
Expand Down
3 changes: 1 addition & 2 deletions requirements/cython.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
cython==3.1.0a1; python_version >= '3.13'
cython==3.0.11; python_version <= '3.12'
cython~=3.0.11
7 changes: 0 additions & 7 deletions scripts/cibw_before_build.sh

This file was deleted.

23 changes: 12 additions & 11 deletions tests/test_quoting_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

try:
from pytest_codspeed import BenchmarkFixture
CODSPEED_MISSING = False
except ImportError:
BenchmarkFixture = None
CODSPEED_MISSING = True

from yarl._quoting import _Quoter, _Unquoter

Expand All @@ -21,7 +22,7 @@


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_quote_query_string(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -31,7 +32,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_quoter_ascii(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -41,7 +42,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_quote_long_path(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -51,7 +52,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_quoter_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -61,7 +62,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_long_query(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -71,7 +72,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_long_query_with_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -81,7 +82,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_quoter_quote_utf8(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -91,7 +92,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_short(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -101,7 +102,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_long_ascii(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand All @@ -111,7 +112,7 @@ def _run() -> None:


@pytest.mark.skipif(
BenchmarkFixture is None, reason="pytest-codspeed needs to be installed"
CODSPEED_MISSING, reason="pytest-codspeed needs to be installed"
)
def test_unquoter_long_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
Expand Down
Loading

0 comments on commit 1c857ca

Please sign in to comment.