Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ZeroIntensity/pyawaitable
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Choose a base ref
...
head repository: ZeroIntensity/pyawaitable
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 20 commits
  • 61 files changed
  • 2 contributors

Commits on Nov 15, 2024

  1. README: Use the PyAwaitable prefixes

    ZeroIntensity authored Nov 15, 2024
    Copy the full SHA
    38ac00f View commit details

Commits on Dec 22, 2024

  1. CI: Don't run unrelated workflows (#37)

    - Add `paths` to the workflows to prevent them from being run for no
    reason.
    - Rename `Memory Check` to `Memory Leaks`.
    - Give job names something more specific so I can use them in status
    checks.
    ZeroIntensity authored Dec 22, 2024
    Copy the full SHA
    d892e1e View commit details
  2. Meta: Use my name in the license and project metadata. (#38)

    Changes from `ZeroIntensity` to my actual name in the license and the
    `pyproject.toml`. Also adds an `__author__` variable to the package.
    ZeroIntensity authored Dec 22, 2024
    Copy the full SHA
    421aaaf View commit details

Commits on Dec 23, 2024

  1. README: Fix 'Memory Leaks' badge. (#41)

    Also adds a badge for "Build Wheels"
    ZeroIntensity authored Dec 23, 2024
    Copy the full SHA
    640cde2 View commit details
  2. README: Fix 'Memory Leaks' badge (round two). (#42)

    Apparently, it's `memory_leak`, and not `memory_leaks`.
    ZeroIntensity authored Dec 23, 2024
    Copy the full SHA
    4c25047 View commit details
  3. CI: Setup an 'all checks pass' workflow. (#43)

    * Add an 'All checks pass' workflow, because apparently GitHub doesn't
    report status checks if a job is skipped via `paths`.
    * Only run the build step on modifications to `src/`
    * Bump CIBW to 2.22.0
    ZeroIntensity authored Dec 23, 2024
    Copy the full SHA
    3d2dd9b View commit details
  4. CI: Only run the memory leak tests if the C code is modified (#45)

    I thought I did this already but apparently not.
    ZeroIntensity authored Dec 23, 2024
    Copy the full SHA
    7b0c97b View commit details

Commits on Jan 7, 2025

  1. CI: Add a workflow for checking changelog updates (#49)

    I'll make this a required check once I merge it.
    ZeroIntensity authored Jan 7, 2025
    Copy the full SHA
    a96d239 View commit details
  2. Core: Use a consistent implementation for arrays (#48)

    Mostly importantly, this removes any size limits and significantly
    reduces the size of a PyAwaitable object.
    
    A couple other things as well:
    
    - Add a `PYAWAITABLE_OPTIMIZED` setting for CI.
    - Changed some error types from `SystemError` to `RuntimeError`, because
    apparently it wasn't clear that those were user errors.
    - Removed the awaitable pool which only slightly improved performance,
    at the cost of using more preallocated memory. We should just use a
    freelist in the future.
    ZeroIntensity authored Jan 7, 2025
    Copy the full SHA
    f4d1e60 View commit details

Commits on Jan 8, 2025

  1. CI: Fix platform compatibility (#50)

    Apparently, #48 broke some builds.
    
    - Fixes compiler flags used on Windows.
    - Removes usage of `Py_UNREACHABLE`, which apparently only works on
    Linux.
    ZeroIntensity authored Jan 8, 2025
    Copy the full SHA
    dbeb0f3 View commit details

Commits on Jan 9, 2025

  1. CI: Make auto-triage more robust (#53)

    - Add a global "triage" workflow instead of only changelogs.
    - Add a check for updated unit tests.
    ZeroIntensity authored Jan 9, 2025
    Copy the full SHA
    9b9b006 View commit details
  2. CI: Make test workflows more robust (#54)

    - Merge all test workflows into one.
    - Use an action for path filtering instead of GitHub's.
    - Use a cleaner `All checks passed` workflow.
    ZeroIntensity authored Jan 9, 2025
    Copy the full SHA
    05101f5 View commit details
  3. CI: Add a name to the changes workflow (#55)

    Just so it doesn't show up as plain old "changes."
    ZeroIntensity authored Jan 9, 2025
    Copy the full SHA
    3714dee View commit details
  4. CI: Fix missing pytest installation in the memory errors workflow (#56)

    Apparently, I forgot to do that.
    ZeroIntensity authored Jan 9, 2025
    Copy the full SHA
    fcf070d View commit details
  5. Netlify: Only build deployment preview if the docs were changed (#57)

    This should make it less annoying on PRs.
    ZeroIntensity authored Jan 9, 2025
    Copy the full SHA
    8bed34f View commit details
  6. Add PyAwaitable_DeferAwait (#52)

    Implements #36.
    Co-authored-by: Peter Bierma <[email protected]>
    AraHaan authored Jan 9, 2025
    Copy the full SHA
    4c5303f View commit details

Commits on Feb 10, 2025

  1. Prepare for 1.4.0 release (#60)

    Bumped the version and updated the changelog. This will be the final 1.x
    release!
    ZeroIntensity authored Feb 10, 2025
    Copy the full SHA
    ebf2e8e View commit details
  2. CI: Use actions/download-artifact v4 (#61)

    GitHub decides to completely break the workflow if something gets
    deprecated rather than emitting a warning :(
    ZeroIntensity authored Feb 10, 2025
    Copy the full SHA
    bac32f4 View commit details
  3. CI: Roll back actions/upload-artifact to v3 (#62)

    For whatever reason, v4 breaks the upload job now. See
    actions/upload-artifact#478. I'm just going to
    roll it back for the time being and retry the 1.4.0 release.
    ZeroIntensity authored Feb 10, 2025
    Copy the full SHA
    8783da2 View commit details

Commits on Feb 16, 2025

  1. Use vendoring as the distribution method (#59)

    This eliminates function tables entirely, and instead ships the entire
    PyAwaitable source code as a header file. This may seem bad at first,
    but has a lot of nice benefits for us:
    
    - PyAwaitable is no longer needed as a runtime dependency, as it will be
    completely baked into an extension.
    - In turn, there's no chance of runtime collisions between installed
    versions of PyAwaitable.
    - Thus, it's completely safe to pin a PyAwaitable version to an exact
    number without worrying about compatibility.
    
    On the other hand, there a few downsides:
    
    - Our `ctypes` bindings need to be written in favor of a C extension.
    - There is some added complexity with how things are initialized,
    because a virtual extension has to be created and stored on the
    interpreter state.
    - We're now completely reliant on a vendoring script, which could prove
    to be maintenance heavy. (But I doubt it will be worse than capsules.)
    - Debugging will be screwed up a little bit downstream, because function
    names are mangled.
    
    Closes #30 and #47.
    
    ---------
    
    Co-authored-by: AraHaan <[email protected]>
    ZeroIntensity and AraHaan authored Feb 16, 2025
    Copy the full SHA
    06f7453 View commit details
Showing with 2,818 additions and 2,701 deletions.
  1. +53 −90 .github/workflows/build.yml
  2. +0 −47 .github/workflows/memory_check.yml
  3. +68 −39 .github/workflows/tests.yml
  4. +67 −0 .github/workflows/triage.yml
  5. +4 −1 .gitignore
  6. +20 −4 CHANGELOG.md
  7. +2 −14 CONTRIBUTING.md
  8. +1 −1 LICENSE
  9. +0 −1 MANIFEST.in
  10. +9 −29 README.md
  11. +1 −1 SECURITY.md
  12. +0 −34 docs/utilities.md
  13. +21 −0 hatch.toml
  14. +422 −0 hatch_build.py
  15. +260 −0 include/pyawaitable/array.h
  16. +39 −56 include/pyawaitable/awaitableobject.h
  17. +34 −23 include/pyawaitable/backport.h
  18. +5 −2 include/pyawaitable/coro.h
  19. +26 −0 include/pyawaitable/dist.h
  20. +12 −12 include/pyawaitable/genwrapper.h
  21. +19 −0 include/pyawaitable/init.h
  22. +52 −0 include/pyawaitable/optimize.h
  23. +74 −39 include/pyawaitable/values.h
  24. +7 −7 include/pyawaitable/with.h
  25. +0 −95 include/vendor.h
  26. +1 −0 netlify.toml
  27. +5 −4 pyproject.toml
  28. +2 −1 requirements.txt
  29. +0 −20 setup.py
  30. +155 −0 src/_pyawaitable/array.c
  31. +147 −178 src/_pyawaitable/awaitable.c
  32. +0 −69 src/_pyawaitable/backport.c
  33. +50 −48 src/_pyawaitable/coro.c
  34. +220 −185 src/_pyawaitable/genwrapper.c
  35. +378 −0 src/_pyawaitable/init.c
  36. +0 −99 src/_pyawaitable/mod.c
  37. +128 −144 src/_pyawaitable/values.c
  38. +30 −42 src/_pyawaitable/with.c
  39. +15 −12 src/pyawaitable/__init__.py
  40. +0 −5 src/pyawaitable/abi.py
  41. +0 −170 src/pyawaitable/bindings.py
  42. +0 −158 src/pyawaitable/pyawaitable.h
  43. +0 −58 tests/conftest.py
  44. +0 −8 tests/extension/a.c
  45. +0 −3 tests/extension/pyproject.toml
  46. +0 −15 tests/extension/setup.py
  47. +0 −84 tests/extension/test.c
  48. +45 −0 tests/main.py
  49. +35 −0 tests/module.c
  50. +9 −0 tests/pyawaitable_test.h
  51. +7 −0 tests/pyproject.toml
  52. +30 −0 tests/setup.py
  53. +159 −0 tests/test_awaitable.c
  54. +0 −218 tests/test_awaitable.py
  55. +0 −146 tests/test_callbacks.py
  56. +66 −0 tests/test_util.h
  57. +0 −270 tests/test_values.py
  58. +0 −188 tests/test_with.py
  59. +139 −0 tests/util.c
  60. +1 −2 uncrustify.cfg
  61. +0 −79 vendor.py
143 changes: 53 additions & 90 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,59 @@
name: Build Wheels
name: Build

on:
push:
tags:
- v*
branches:
- master
push:
tags:
- v*
branches:
- master
paths:
- 'src/**'
pull_request:
branches:
- master

concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true

env:
CIBW_SKIP: >
pp*
group: build-${{ github.head_ref }}
cancel-in-progress: true

jobs:
binary-wheels-standard:
name: Binary wheels for ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
with:
# Fetch all tags
fetch-depth: 0

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_MACOS: x86_64
HATCH_BUILD_HOOKS_ENABLE: "true"

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error

binary-wheels-arm:
name: Build Linux wheels for ARM
runs-on: ubuntu-latest
# Very slow, no need to run on PRs
if: >
github.event_name == 'push'
&&
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))
steps:
- uses: actions/checkout@v2
with:
# Fetch all tags
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_LINUX: aarch64
HATCH_BUILD_HOOKS_ENABLE: "true"

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: wheelhouse/*.whl
if-no-files-found: error

publish:
name: Publish release
needs:
- binary-wheels-standard
- binary-wheels-arm
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v3
with:
name: artifacts
path: dist

- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@v1.10.3
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
pure-python-wheel-and-sdist:
name: Build a pure Python wheel and source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install build dependencies
run: python -m pip install --upgrade build

- name: Build
run: python -m build

- uses: actions/upload-artifact@v4
with:
name: artifacts
path: dist/*
if-no-files-found: error

publish:
name: Publish release
needs:
- pure-python-wheel-and-sdist
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v4
with:
name: artifacts
path: dist

- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
47 changes: 0 additions & 47 deletions .github/workflows/memory_check.yml

This file was deleted.

107 changes: 68 additions & 39 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,77 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHONIOENCODING: "utf8"
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHONIOENCODING: "utf8"
PYAWAITABLE_OPTIMIZED: 1

jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Pytest
run: pip install pytest pytest-asyncio typing_extensions

- name: Build PyAwaitable
run: pip install .

- name: Build PyAwaitable Test Package
run: pip install setuptools wheel && pip install ./tests/extension/ --no-build-isolation

- name: Run tests
run: pytest -W error
changes:
name: Check for changed files
runs-on: ubuntu-latest
outputs:
source: ${{ steps.filter.outputs.source }}
csource: ${{ steps.filter.outputs.csource }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
source:
- 'src/**'
run-tests:
needs: changes
if: ${{ needs.changes.outputs.source == 'true' }}
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build PyAwaitable
run: pip install . --verbose

- name: Build PyAwaitable Test Package
run: pip install ./tests --verbose

- name: Run tests
run: python -W error -m unittest tests/main.py --verbose

tests-pass:
runs-on: ubuntu-latest
name: All tests passed
if: always()

needs:
- run-tests

steps:
- name: Check whether all tests passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: ${{ toJSON(needs) }}
67 changes: 67 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Triage
on:
pull_request:
types:
- "opened"
- "reopened"
- "synchronize"
- "labeled"
- "unlabeled"

jobs:
changelog_check:
runs-on: ubuntu-latest
name: Check for changelog updates
steps:
- name: "Check if the source directory was changed"
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src/**'
- name: "Check for changelog updates"
if: steps.changes.outputs.src == 'true'
uses: brettcannon/check-for-changed-files@v1
with:
file-pattern: |
CHANGELOG.md
skip-label: "skip changelog"
failure-message: "Missing a CHANGELOG.md update; please add one or apply the ${skip-label} label to the pull request"

tests_check:
runs-on: ubuntu-latest
name: Check for updated tests
steps:
- name: "Check if the source directory was changed"
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src/**'
- name: "Check for test updates"
if: steps.changes.outputs.src == 'true'
uses: brettcannon/check-for-changed-files@v1
with:
file-pattern: |
tests/*
skip-label: "skip tests"
failure-message: "Missing unit tests; please add some or apply the ${skip-label} label to the pull request"

all_green:
runs-on: ubuntu-latest
name: PR has no missing information
if: always()

needs:
- changelog_check
- tests_check

steps:
- name: Check whether jobs passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
Loading