# run when a release has been created
release:
types: [created]
+ # push:
+ # branches:
+ # - "go_wheel_*"
# env:
- # comment TWINE_REPOSITORY_URL to use the real pypi. NOTE: change also the secret used in TWINE_PASSWORD
- # TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
+# # comment TWINE_REPOSITORY_URL to use the real pypi. NOTE: change also the secret used in TWINE_PASSWORD
+# TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
jobs:
build_wheels:
- name: Build ${{ matrix.wheel_mode }} wheels on ${{ matrix.os }} ${{ matrix.linux_archs }}
+ name: ${{ matrix.wheel_mode }} wheels ${{ matrix.python }} on ${{ matrix.os }} ${{ matrix.os == 'ubuntu-22.04' && matrix.linux_archs || '' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
+ # emulated wheels on linux take too much time, split wheels into multiple runs
+ python:
+ - "cp37-* cp38-*"
+ - "cp39-* cp310-*"
+ - "cp311-*"
+ wheel_mode:
+ - compiled
+ os:
+ - "windows-2022"
+ - "macos-12"
+ - "ubuntu-22.04"
+ linux_archs:
+ # this is only meaningful on linux. windows and macos ignore exclude all but one arch
+ - "aarch64"
+ - "x86_64"
+
include:
- - os: windows-2022
- wheel_mode: compiled
- - os: macos-12
- wheel_mode: compiled
- # emulated wheels on linux take too much time, so run two jobs
- - os: ubuntu-22.04
- wheel_mode: compiled
- linux_archs: "x86_64"
- - os: ubuntu-22.04
- wheel_mode: compiled
- linux_archs: "aarch64"
# create pure python build
- os: ubuntu-22.04
wheel_mode: pure-python
+ python: "cp-311*"
+
+ exclude:
+ - os: "windows-2022"
+ linux_archs: "aarch64"
+ - os: "macos-12"
+ linux_archs: "aarch64"
fail-fast: false
uses: pypa/cibuildwheel@v2.12.1
env:
CIBW_ARCHS_LINUX: ${{ matrix.linux_archs }}
+ CIBW_BUILD: ${{ matrix.python }}
+ # setting it here does not work on linux
+ # PYTHONNOUSERSITE: "1"
- name: Set up Python for twine and pure-python wheel
import operator
import os
import re
+import sys
import uuid
import pytest
collect_types.stop()
+def _log_sqlalchemy_info(session):
+ import sqlalchemy
+ from sqlalchemy import __version__
+ from sqlalchemy.util import has_compiled_ext
+ from sqlalchemy.util._has_cy import _CYEXTENSION_MSG
+
+ greet = "sqlalchemy installation"
+ site = "no user site" if sys.flags.no_user_site else "user site loaded"
+ msgs = [
+ f"SQLAlchemy {__version__} ({site})",
+ f"Path: {sqlalchemy.__file__}",
+ ]
+
+ if has_compiled_ext():
+ from sqlalchemy.cyextension import util
+
+ msgs.append(f"compiled extension enabled, e.g. {util.__file__} ")
+ else:
+ msgs.append(f"compiled extension not enabled; {_CYEXTENSION_MSG}")
+
+ pm = session.config.pluginmanager.get_plugin("terminalreporter")
+ if pm:
+ pm.write_sep("=", greet)
+ for m in msgs:
+ pm.write_line(m)
+ else:
+ # fancy pants reporter not found, fallback to plain print
+ print("=" * 25, greet, "=" * 25)
+ for m in msgs:
+ print(m)
+
+
def pytest_sessionstart(session):
from sqlalchemy.testing import asyncio
+ _log_sqlalchemy_info(session)
asyncio._assume_async(plugin_base.post_begin)
return (collections, immutabledict, processors, resultproxy, util)
+_CYEXTENSION_MSG: str
if not typing.TYPE_CHECKING:
if os.environ.get("DISABLE_SQLALCHEMY_CEXT_RUNTIME"):
HAS_CYEXTENSION = False
+ _CYEXTENSION_MSG = "DISABLE_SQLALCHEMY_CEXT_RUNTIME is set"
else:
try:
_import_cy_extensions()
- except ImportError:
+ except ImportError as err:
HAS_CYEXTENSION = False
+ _CYEXTENSION_MSG = str(err)
else:
+ _CYEXTENSION_MSG = "Loaded"
HAS_CYEXTENSION = True
else:
HAS_CYEXTENSION = False
[tool.cibuildwheel]
test-requires = "pytest pytest-xdist"
-test-command = "pytest -c {project}/pyproject.toml -n2 -q --nomemory --notimingintensive --nomypy {project}/test"
+# remove user site, otherwise the local checkout has precedence, disabling cyextensions
+test-command = "python -s -m pytest -c {project}/pyproject.toml -n2 -q --nomemory --notimingintensive --nomypy {project}/test"
build = "*"
# python 3.6 is no longer supported by sqlalchemy