Skip to content

Commit

Permalink
Fix setup for Windows on 3.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Mar 25, 2024
1 parent 32bb1a7 commit 7cdbe1e
Showing 1 changed file with 57 additions and 6 deletions.
63 changes: 57 additions & 6 deletions config/c-code/tests.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,29 @@ jobs:
{% include 'tests-cache.j2' %}

{% if with_future_python %}
- name: Install Build Dependencies (%(future_python_version)s)
if: matrix.python-version == '%(future_python_version)s'
- name: Install Build Dependencies (%(future_python_version)s) - no Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& !startsWith(runner.os, 'Windows')
run: |
pip install -U pip
pip install -U setuptools wheel twine
# cffi will probably have no public release until a Python 3.13 beta
# or even RC release, see https://github.com/python-cffi/cffi/issues/23
echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install cffi
- name: Install Build Dependencies (%(future_python_version)s) - on Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& startsWith(runner.os, 'Windows')
run: |
# cffi will probably have no public release until a Python 3.13 beta
# or even RC release, see https://github.com/python-cffi/cffi/issues/23
echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt
set PIP_CONSTRAINT=%cd%\cffi_constraint.txt
pip install cffi
pip install -U pip
pip install -U setuptools wheel twine
{% endif %}
- name: Install Build Dependencies
{% if with_future_python %}
Expand Down Expand Up @@ -162,8 +176,10 @@ jobs:
{% endfor %}

{% if with_future_python %}
- name: Install %(package_name)s and dependencies (%(future_python_version)s)
if: matrix.python-version == '%(future_python_version)s'
- name: Install %(package_name)s and dependencies (%(future_python_version)s) - no Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& !startsWith(runner.os, 'Windows')
run: |
# Install to collect dependencies into the (pip) cache.
# cffi will probably have no public release until a Python 3.13 beta
Expand All @@ -172,6 +188,19 @@ jobs:
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre .[test]
- name: Install %(package_name)s and dependencies (%(future_python_version)s) - on Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& startsWith(runner.os, 'Windows')
run: |
# Install to collect dependencies into the (pip) cache.
# cffi will probably have no public release until a Python 3.13 beta
# or even RC release, see https://github.com/python-cffi/cffi/issues/23
echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
set PIP_CONSTRAINT=%cd%\cffi_constraint.txt
pip install --pre .[test]
{% endif %}
- name: Install %(package_name)s and dependencies
{% if with_future_python %}
Expand Down Expand Up @@ -254,8 +283,10 @@ jobs:
{% endfor %}
{% else %}
{% if with_future_python %}
- name: Install %(package_name)s %(future_python_version)s
if: ${{ startsWith(matrix.python-version, '%(future_python_version)s') }}
- name: Install %(package_name)s %(future_python_version)s ${{ matrix.python-version }}- no Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& !startsWith(runner.os, 'Windows')
run: |
pip install -U wheel setuptools
# cffi will probably have no public release until a beta or even RC
Expand All @@ -271,6 +302,26 @@ jobs:
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre -U -e .[test]
- name: Install %(package_name)s %(future_python_version)s - on Windows
if: >
matrix.python-version == '%(future_python_version)s'
&& startsWith(runner.os, 'Windows')
run: |
pip install -U wheel setuptools
# cffi will probably have no public release until a beta or even RC
# version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23
echo 'cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58 ; platform_python_implementation == "CPython"' > cffi_constraint.txt
# coverage has a wheel on PyPI for a future python version which is
# not ABI compatible with the current one, so build it from sdist:
pip install -U --no-binary :all: coverage
# Unzip into src/ so that testrunner can find the .so files
# when we ask it to load tests from that directory. This
# might also save some build time?
unzip -n dist/%(package_name)s-*whl -d src
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
set PIP_CONSTRAINT=%cd%\cffi_constraint.txt
pip install --pre -U -e .[test]
{% endif %}
- name: Install %(package_name)s
{% if with_future_python %}
Expand Down

0 comments on commit 7cdbe1e

Please sign in to comment.