| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ jobs: | |||
| 37 | 37 | mkdir -p dist/ | |
| 38 | 38 | echo "${VERSION}" > dist/VERSION | |
| 39 | 39 | ||
| 40 | - - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
| 40 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| 41 | 41 | with: | |
| 42 | 42 | name: dist | |
| 43 | 43 | path: dist/ | |
@@ -55,7 +55,7 @@ jobs: | |||
| 55 | 55 | fetch-depth: 50 | |
| 56 | 56 | submodules: true | |
| 57 | 57 | ||
| 58 | - - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | ||
| 58 | + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
| 59 | 59 | with: | |
| 60 | 60 | python-version: 3.x | |
| 61 | 61 | ||
@@ -64,7 +64,7 @@ jobs: | |||
| 64 | 64 | python -m pip install --upgrade setuptools wheel pip | |
| 65 | 65 | python setup.py sdist | |
| 66 | 66 | ||
| 67 | - - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
| 67 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| 68 | 68 | with: | |
| 69 | 69 | name: dist | |
| 70 | 70 | path: dist/*.tar.* | |
@@ -84,6 +84,7 @@ jobs: | |||
| 84 | 84 | - "cp312-*" | |
| 85 | 85 | - "cp313-*" | |
| 86 | 86 | - "cp314-*" | |
| 87 | + - "cp314t-*" | ||
| 87 | 88 | cibw_arch: ["x86_64", "aarch64", "universal2"] | |
| 88 | 89 | exclude: | |
| 89 | 90 | - os: ubuntu-latest | |
@@ -115,14 +116,14 @@ jobs: | |||
| 115 | 116 | run: | | |
| 116 | 117 | brew install gnu-sed libtool autoconf automake | |
| 117 | 118 | ||
| 118 | - - uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3 | ||
| 119 | + - uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0 | ||
| 119 | 120 | env: | |
| 120 | 121 | CIBW_BUILD_VERBOSITY: 1 | |
| 121 | 122 | CIBW_BUILD: ${{ matrix.cibw_python }} | |
| 122 | 123 | CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
| 123 | 124 | CIBW_TEST_SKIP: "*universal2:arm64" | |
| 124 | 125 | ||
| 125 | - - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
| 126 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| 126 | 127 | with: | |
| 127 | 128 | name: dist | |
| 128 | 129 | path: wheelhouse/*.whl | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ jobs: | |||
| 23 | 23 | - "3.12" | |
| 24 | 24 | - "3.13" | |
| 25 | 25 | - "3.14" | |
| 26 | + - "3.14t" | ||
| 26 | 27 | os: [ubuntu-latest, macos-latest] | |
| 27 | 28 | ||
| 28 | 29 | env: | |
@@ -45,7 +46,7 @@ jobs: | |||
| 45 | 46 | __version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) | |
| 46 | 47 | ||
| 47 | 48 | - name: Set up Python ${{ matrix.python-version }} | |
| 48 | - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | ||
| 49 | + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
| 49 | 50 | if: steps.release.outputs.version == 0 | |
| 50 | 51 | with: | |
| 51 | 52 | python-version: ${{ matrix.python-version }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ test = [ | |||
| 41 | 41 | 'flake8~=6.1', | |
| 42 | 42 | 'psutil', | |
| 43 | 43 | 'pycodestyle~=2.11.0', | |
| 44 | - 'pyOpenSSL~=23.0.0', | ||
| 44 | + 'pyOpenSSL~=25.3.0', | ||
| 45 | 45 | 'mypy>=0.800', | |
| 46 | 46 | ] | |
| 47 | 47 | dev = [ | |
@@ -58,7 +58,7 @@ docs = [ | |||
| 58 | 58 | requires = [ | |
| 59 | 59 | "setuptools>=60", | |
| 60 | 60 | "wheel", | |
| 61 | - "Cython~=3.0", | ||
| 61 | + "Cython~=3.1", | ||
| 62 | 62 | ] | |
| 63 | 63 | build-backend = "setuptools.build_meta" | |
| 64 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ | |||
| 4 | 4 | import os | |
| 5 | 5 | import random | |
| 6 | 6 | import sys | |
| 7 | + import subprocess | ||
| 7 | 8 | import threading | |
| 8 | 9 | import time | |
| 9 | 10 | import uvloop | |
@@ -735,6 +736,69 @@ def scheduler(): | |||
| 735 | 736 | thread.join() | |
| 736 | 737 | self.assertEqual(counter[0], ITERATIONS) | |
| 737 | 738 | ||
| 739 | + def test_freethreading(self): | ||
| 740 | + if not hasattr(sys, "_is_gil_enabled"): | ||
| 741 | + raise unittest.SkipTest("No sys._is_gil_enabled()") | ||
| 742 | + if os.cpu_count() < 2: | ||
| 743 | + raise unittest.SkipTest("Flaky on single CPU machines") | ||
| 744 | + prog = """\ | ||
| 745 | + import asyncio | ||
| 746 | + import os | ||
| 747 | + import sys | ||
| 748 | + import threading | ||
| 749 | + import time | ||
| 750 | + | ||
| 751 | + | ||
| 752 | + counter = 0 | ||
| 753 | + | ||
| 754 | + | ||
| 755 | + def job(barrier): | ||
| 756 | + global counter | ||
| 757 | + barrier.wait() | ||
| 758 | + start_time = time.monotonic() | ||
| 759 | + rv = 0 | ||
| 760 | + while time.monotonic() - start_time < 1: | ||
| 761 | + for _i in range(10**4): | ||
| 762 | + counter += 1 | ||
| 763 | + rv += 1 | ||
| 764 | + return rv | ||
| 765 | + | ||
| 766 | + | ||
| 767 | + async def main(): | ||
| 768 | + if sys._is_gil_enabled(): | ||
| 769 | + print("{impl} turned on GIL") | ||
| 770 | + return False | ||
| 771 | + loop = asyncio.get_running_loop() | ||
| 772 | + n_jobs = os.cpu_count() | ||
| 773 | + barrier = threading.Barrier(n_jobs) | ||
| 774 | + fs = [loop.run_in_executor(None, job, barrier) for _ in range(n_jobs)] | ||
| 775 | + result = sum(await asyncio.gather(*fs)) | ||
| 776 | + if counter == result: | ||
| 777 | + print("Expected race condition did not happen") | ||
| 778 | + return False | ||
| 779 | + return True | ||
| 780 | + | ||
| 781 | + | ||
| 782 | + if __name__ == "__main__": | ||
| 783 | + if sys._is_gil_enabled(): | ||
| 784 | + print("Not running with GIL disabled") | ||
| 785 | + sys.exit(2) | ||
| 786 | + | ||
| 787 | + import {impl} | ||
| 788 | + | ||
| 789 | + if not {impl}.run(main()): | ||
| 790 | + sys.exit(1) | ||
| 791 | + """ | ||
| 792 | + result = subprocess.run( | ||
| 793 | + [sys.executable, '-c', prog.format(impl=self.implementation)], | ||
| 794 | + stdout=subprocess.PIPE, | ||
| 795 | + text=True, | ||
| 796 | + ) | ||
| 797 | + if result.returncode == 2: | ||
| 798 | + raise unittest.SkipTest(result.stdout.strip()) | ||
| 799 | + elif result.returncode != 0: | ||
| 800 | + self.fail(result.stdout.strip()) | ||
| 801 | + | ||
| 738 | 802 | ||
| 739 | 803 | class TestBaseUV(_TestBase, UVTestCase): | |
| 740 | 804 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -405,6 +405,8 @@ async def client(addr): | |||
| 405 | 405 | self.assertEqual(await reader.readexactly(2), b'OK') | |
| 406 | 406 | ||
| 407 | 407 | re = r'(a bytes-like object)|(must be byte-ish)' | |
| 408 | + if sys.version_info >= (3, 14): | ||
| 409 | + re += r'|(must be a bytes, bytearray, or memoryview object)' | ||
| 408 | 410 | with self.assertRaisesRegex(TypeError, re): | |
| 409 | 411 | writer.write('AAAA') | |
| 410 | 412 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - # cython: language_level=3, embedsignature=True | ||
| 1 | + # cython: language_level=3, embedsignature=True, freethreading_compatible=True | ||
| 2 | 2 | ||
| 3 | 3 | import asyncio | |
| 4 | 4 | cimport cython | |
| Back | FazBrowse Home | New Git URL |
0 commit comments