Repository: agronholm/cbor2 (language: python)

Issue:
Provide -none-any wheels
For applications in which there is neither access to a compiler nor there is any widespread CPU architecture used, it would be convenient to provide -none-any wheels in addition to the provided binary wheels.

A concrete use case for this is pyodide, which runs Python code in the browser: At <https://pyodide.org/en/stable/console.html>, running `import micropip; await micropip.install('cbor2'), micropip.list()` shows that it falls back to cbor2 version 4.1.2, which was the last version that had such wheels.

One reason not to do this would be if pip preferred these to the platform specific ones; I don't think it does, but I did not try it.

An alternative for that particular use case might be to ask pyodide to provide the module within their build system, which would compile the C code to WASM ([they managed even with cryptography](https://github.com/pyodide/pyodide/issues/761)).


Discussion / hints:
Good idea, I will look into it as soon as I can.

Fix patch:
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 782f0d7a..098aaf10 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -9,26 +9,20 @@ on:
       - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
 
 jobs:
-  wheels:
+  binary-wheels:
     strategy:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v3
-    - name: Set up Python
-      uses: actions/setup-python@v4
-    - uses: actions/cache@v3
-      with:
-        path: ~/.cache/pip
-        key: publish-${{ matrix.os }}
     - name: Set up QEMU
       if: runner.os == 'Linux'
       uses: docker/setup-qemu-action@v2
       with:
         platforms: arm64
     - name: Build wheels
-      uses: pypa/cibuildwheel@v2.11.1
+      uses: pypa/cibuildwheel@v2.11.2
       env:
         CIBW_SKIP: pp*
         CIBW_ARCHS: auto64
@@ -39,7 +33,7 @@ jobs:
         name: wheels
         path: wheelhouse/*.whl
 
-  sdist:
+  sdist-purewheel:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v3
@@ -49,27 +43,28 @@ jobs:
         python-version: 3.x
     - name: Install dependencies
       run: pip install build
-    - name: Create sdist
-      run: python -m build --sdist .
+    - name: Create sdist and pure-Python wheel
+      run: python -m build .
+      env:
+        CBOR2_BUILD_C_EXTENSION: "0"
     - uses: actions/upload-artifact@v3
       with:
         name: sdist
-        path: dist/*.tar.gz
+        path: dist/*
 
   publish:
     needs:
-      - wheels
-      - sdist
+      - binary-wheels
+      - sdist-purewheel
     runs-on: ubuntu-latest
     steps:
     - name: Download generated packaging artifacts
-      uses: actions/download-artifact@v2
+      uses: actions/download-artifact@v3
     - name: Move the packages to dist/
       run: |
         mkdir dist
         mv */*.whl */*.tar.gz dist
     - name: Upload packages
-      uses: pypa/gh-action-pypi-publish@master
+      uses: pypa/gh-action-pypi-publish@release/v1
       with:
-        user: __token__
         password: ${{ secrets.pypi_password }}


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8fa13b11..8eeb8bc0 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -40,10 +40,8 @@ jobs:
       uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
-    - uses: actions/cache@v3
-      with:
-        path: ~/.cache/pip
-        key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
+        cache: pip
+        cache-dependency-path: pyproject.toml
     - name: Install dependencies
       run: pip install -e .[test] coveralls
     - name: Test with pytest