python 311 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GIL Talk Demo | |
on: push | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
version: ["3.11"] | |
runs-on: "cirun-aws-t2-large-ubuntu2204--${{ github.run_id }}" | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Try pip | |
if: always() | |
run: pip install setuptools | |
# - name: Set up Python | |
# if: matrix.version != 3.13 | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: "${{ matrix.version }}" | |
# allow-prereleases: true | |
- name: Setup Python via Miniconda | |
if: always() | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: "${{ matrix.version }}" | |
channels: conda-forge | |
#channels: defaults,ad-testing/label/py313_nogil | |
- name: Try pip again | |
if: always() | |
run: pip install setuptools | |
- name: Install build essentials | |
run: | | |
conda install gcc -c conda-forge -y | |
- name: Check Python version | |
run: | | |
python -VV | |
- name: Check Python GIL enabled | |
if: matrix.version == 3.13 | |
run: python -c "import sys; print(sys._is_gil_enabled())" | |
- name: Install dependencies | |
run: | | |
pip install setuptools | |
- name: Build C extension | |
run: | | |
python python_c_extension/setup.py build | |
cp -r build/*/* python_c_extension | |
- name: Run script in single and multi-thread mode | |
run: | | |
python python_c_extension/c_extension_gil.py | |
env: | |
PYTHONPATH: "." | |
PYTHON_GIL: 0 | |
- name: Run Tests | |
run: python -m unittest discover tests/ -vvv | |
env: | |
PYTHON_GIL: 0 |