Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/pyodide/pylock.314.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
lock-version = "1.0"
created-by = "pip"

[[packages]]
name = "iniconfig"
version = "2.3.0"

[[packages.wheels]]
name = "iniconfig-2.3.0-py3-none-any.whl"
url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl"

[packages.wheels.hashes]
sha256 = "f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"

[[packages]]
name = "packaging"
version = "26.2"

[[packages.wheels]]
name = "packaging-26.2-py3-none-any.whl"
url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl"

[packages.wheels.hashes]
sha256 = "5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"

[[packages]]
name = "pluggy"
version = "1.6.0"

[[packages.wheels]]
name = "pluggy-1.6.0-py3-none-any.whl"
url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl"

[packages.wheels.hashes]
sha256 = "e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"

[[packages]]
name = "pygments"
version = "2.20.0"

[[packages.wheels]]
name = "pygments-2.20.0-py3-none-any.whl"
url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl"

[packages.wheels.hashes]
sha256 = "81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176"

[[packages]]
name = "pytest"
version = "9.1.1"

[[packages.wheels]]
name = "pytest-9.1.1-py3-none-any.whl"
url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl"

[packages.wheels.hashes]
sha256 = "37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c"
7 changes: 7 additions & 0 deletions .github/pyodide/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Selected dependencies (including dev ones) to run the test suite with Pyodide.
# Dependencies should be installed from the derived `pylock.toml` file.
# To generate the lockfile, run `python -m pip lock -r requirements.in -o pylock.31x.toml`,
# in a Pyodide venv matching the target Python version. Such a venv can be created using
# `pyodide venv .venv-pyodide` (and this must be done from a Python venv matching the target
# Python version).
pytest~=9.0
99 changes: 96 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# some code from https://github.com/pydantic/pydantic-core/blob/d6e7890b36ef21cb28180a7f5b1479da2319012d/.github/workflows/ci.yml
# and https://github.com/pydantic/pydantic/blob/f59e929c999e8b2efc7b12fd0bc1685c1a186be3/.github/workflows/ci.yml
# MIT License, see author list by link

name: CI
Expand All @@ -11,6 +12,9 @@ on:
- "**"
pull_request: {}

env:
UV_FROZEN: true

permissions: {}

jobs:
Expand Down Expand Up @@ -94,6 +98,43 @@ jobs:

- run: pytest

test-pyemscripten:
name: test ${{ matrix.python-version }} PyEmscripten
needs: [build-pyemscripten]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.14"
pylock-suffix: "314"

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions

- name: get dist artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python_calamine_pypi_files_pyemscripten_${{ matrix.python-version }}
path: dist

- run: |
uv sync --only-group pyodide-build
uv run pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
python -m pip install --upgrade pip>=26.1.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Quote pip>=26.1.1 to prevent shell redirect.

Bash interprets the unquoted > in pip>=26.1.1 as a stdout redirect to a file named =26.1.1. The version constraint is silently lost and pip is upgraded to the latest version without the minimum guarantee. A spurious file =26.1.1 is also created in the working directory.

🐛 Proposed fix
-          python -m pip install --upgrade pip>=26.1.1
+          python -m pip install --upgrade 'pip>=26.1.1'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
python -m pip install --upgrade pip>=26.1.1
python -m pip install --upgrade 'pip>=26.1.1'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/CI.yml at line 130, Quote the pip version constraint in
the CI install command so the shell passes pip>=26.1.1 as a single argument
instead of interpreting > as redirection, preserving the required minimum
version and preventing creation of an unintended file.

python -m pip install -r .github/pyodide/pylock.${{ matrix.pylock-suffix }}.toml
python -m pip install python-calamine --no-index --no-deps --find-links dist
python -m pytest

lint:
permissions:
contents: read
Expand Down Expand Up @@ -138,7 +179,7 @@ jobs:
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [test, lint]
needs: [test, test-pyemscripten, lint]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
Expand Down Expand Up @@ -255,8 +296,60 @@ jobs:
name: wheels-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }}
path: dist

build-pyemscripten:
name: build PyEmscripten (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.14"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]

- run: uv sync --only-group pyodide-build

- name: Get pyodide config
id: pyodide-config
run: |
echo "rust-toolchain=$(uv run pyodide config get rust_toolchain)" >> "$GITHUB_OUTPUT"
echo "emscripten-version=$(uv run pyodide config get emscripten_version)" >> "$GITHUB_OUTPUT"
echo "pyodide-abi-version=$(uv run pyodide config get pyodide_abi_version)" >> "$GITHUB_OUTPUT"
echo "rustflags=$(uv run pyodide config get rustflags)" >> "$GITHUB_OUTPUT"

- uses: emscripten-core/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
with:
version: ${{ steps.pyodide-config.outputs.emscripten-version }}
no-cache: ${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
# Unclear how to avoid manually specifying this yet (https://github.com/PyO3/maturin/issues/3189):
env:
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUSTFLAGS: ${{ steps.pyodide-config.outputs.rustflags }}
MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION: ${{ steps.pyodide-config.outputs.pyodide-abi-version }}
with:
target: wasm32-unknown-emscripten
args: --release --out dist --interpreter ${{ matrix.python-version }}
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
rust-toolchain: ${{ steps.pyodide-config.outputs.rust-toolchain }}

- run: ls -lh dist/

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: python_calamine_pypi_files_pyemscripten_${{ matrix.python-version }}
path: dist

release:
needs: [build, check]
needs: [build, build-pyemscripten, check]
if: success() && startsWith(github.ref, 'refs/tags/')

runs-on: ubuntu-latest
Expand All @@ -280,7 +373,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1.14

gh-release:
needs: [build, check]
needs: [build, build-pyemscripten, check]
if: success() && startsWith(github.ref, 'refs/tags/')

runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dev = [
"pytest~=9.0",
"pandas[excel]>=2.2",
]
pyodide-build = ["pyodide-build"]

[project.urls]
homepage = "https://github.com/dimastbk/python-calamine"
Expand Down
Loading
Loading