-
Notifications
You must be signed in to change notification settings - Fork 31
Change workflow to using uv and ruff. #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3078cd5
5126115
2c35de7
04b58c0
55d4a35
35f9108
0d2e15f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,26 +18,26 @@ jobs: | |
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/checkout@v7 | ||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v3 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 pytest tox | ||
| pip install -r requirements/test.txt | ||
| # Won't pass flake8 yet | ||
| # - name: Lint with flake8 | ||
| # run: | | ||
| # # stop the build if there are Python syntax errors or undefined names | ||
| # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
| # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
| - name: Test with tox | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| with: | ||
| # Install a specific version of uv. | ||
| version: "0.11.26" | ||
| - name: Build the wheel | ||
| run: uv build --wheel | ||
| - name: Install the project | ||
| run: uv sync --dev | ||
| - name: Perform static checks | ||
|
dgarske marked this conversation as resolved.
|
||
| run: uv run ruff check | ||
| - name: Run tests using the locally built wheel | ||
| run: | | ||
| tox | ||
| uv pip install --reinstall dist/*.whl | ||
| uv run --no-sync pytest tests | ||
|
|
||
| build-no-pqc: | ||
| # Regression coverage for issue #2659: INVALID_DEVID is only declared | ||
|
|
@@ -47,13 +47,18 @@ jobs: | |
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| submodules: recursive | ||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v3 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| with: | ||
| # Install a specific version of uv. | ||
| version: "0.11.26" | ||
| - name: Install build deps | ||
| run: | | ||
| sudo apt-get update | ||
|
|
@@ -63,7 +68,7 @@ jobs: | |
| cd lib/wolfssl | ||
| ./autogen.sh | ||
| ./configure --enable-cryptonly --disable-shared \ | ||
| --disable-kyber --disable-dilithium \ | ||
| --disable-mlkem --disable-mldsa \ | ||
| --enable-aes --enable-aesgcm --enable-aessiv \ | ||
| --enable-aesctr --enable-aesgcm-stream \ | ||
| --enable-des3 --enable-chacha --enable-poly1305 \ | ||
|
|
@@ -81,12 +86,16 @@ jobs: | |
| env: | ||
| USE_LOCAL_WOLFSSL: ${{ github.workspace }}/wolfssl-install | ||
| run: | | ||
|
dgarske marked this conversation as resolved.
|
||
| python -m pip install --upgrade pip | ||
| pip install -r requirements/test.txt | ||
| pip install -e . | ||
| uv venv | ||
| uv pip install -r requirements/test.txt | ||
| uv pip install -e . | ||
| - name: Check absence of ML-KEM and ML-DSA support | ||
|
dgarske marked this conversation as resolved.
|
||
| run: | | ||
| uv run --no-sync python -c "from wolfcrypt._ffi import lib as _lib; assert _lib.ML_KEM_ENABLED == 0, 'ML-KEM should be disabled'" | ||
| uv run --no-sync python -c "from wolfcrypt._ffi import lib as _lib; assert _lib.ML_DSA_ENABLED == 0, 'ML-DSA should be disabled'" | ||
| - name: Import smoke (regression for INVALID_DEVID) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [Medium] no-pqc 'Import smoke' step omits --no-sync and USE_LOCAL_WOLFSSL, undermining the regression test The Fix: Add |
||
| run: python -c "from wolfcrypt.random import Random; Random()" | ||
| run: uv run python -c "from wolfcrypt.random import Random; Random()" | ||
| - name: Run tests | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 [Low] no-pqc 'Run tests' step omits --no-sync, causing a redundant project re-sync/rebuild The final 'Run tests' step runs Fix: Use |
||
| env: | ||
| USE_LOCAL_WOLFSSL: ${{ github.workspace }}/wolfssl-install | ||
| run: pytest tests/ | ||
| run: uv run pytest tests | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,34 +49,36 @@ clean-test: ## remove test and coverage artifacts | |
| rm -f .coverage | ||
| rm -fr htmlcov/ | ||
|
|
||
| lint: ## check style with flake8 | ||
| flake8 src tests | ||
| pylint src tests/* | ||
| lint: ## check style with ruff | ||
| uv run ruff check | ||
|
|
||
| test: install ## run tests quickly with the default Python | ||
| py.test tests | ||
| test: ## run tests quickly with the default Python | ||
| uv run py.test tests | ||
|
|
||
| check: test ## run tests quickly with the default Python | ||
|
|
||
| test-all: ## run tests on every Python version with tox | ||
| tox | ||
| test-all: ## run tests on every Python version with uv | ||
|
dgarske marked this conversation as resolved.
|
||
| for version in 3.10 3.11 3.12 3.13 3.14; do \ | ||
| echo "=== Python $$version ==="; \ | ||
| uv run --python $$version pytest tests || exit 1; \ | ||
| done | ||
|
|
||
| check-all: test-all ## run tests on every Python version with tox | ||
| check-all: test-all ## run tests on every Python version with uv | ||
|
|
||
| cov: ## check code coverage quickly with the default Python | ||
| uv run pytest --cov=wolfcrypt tests | ||
| uv run coverage report -m | ||
| uv run coverage html | ||
| $(BROWSER) htmlcov/index.html | ||
|
|
||
| docs: install ## generate Sphinx HTML documentation, including API docs | ||
| docs: ## generate Sphinx HTML documentation, including API docs | ||
| $(MAKE) -C docs clean | ||
| $(MAKE) -C docs html | ||
| uv run $(MAKE) -C docs html | ||
| $(BROWSER) docs/_build/html/index.html | ||
|
|
||
| doctest: install ## generate Sphinx HTML documentation, including API docs | ||
| doctest: ## generate Sphinx HTML documentation, including API docs | ||
| $(MAKE) -C docs clean | ||
| $(MAKE) -C docs doctest | ||
| uv run $(MAKE) -C docs doctest | ||
|
|
||
| servedocs: docs ## compile the docs watching for changes | ||
| watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 [Low] Makefile 'dist' target still uses setup.py while README migrates to 'uv build' This PR migrates the documented build workflow to Fix: Optionally switch the |
||
|
|
@@ -92,6 +94,3 @@ dist: clean ## builds source and wheel package | |
|
|
||
| release: ## package and upload a release | ||
| twine upload dist/* | ||
|
|
||
| install: clean ## install the package to the active Python's site-packages | ||
| python setup.py install | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| -r prod.txt | ||
| tox>=4 | ||
| pytest>=8 | ||
| types-cffi>=1.17 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
|
|
||
| # test_chacha20poly1305.py | ||
| # | ||
| # Copyright (C) 2022 wolfSSL Inc. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # test_chacha_iv.py | ||
| # | ||
| # Copyright (C) 2006-2022 wolfSSL Inc. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # test_cipher_modes.py | ||
| # | ||
| # Copyright (C) 2006-2022 wolfSSL Inc. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # test_hmac_copy.py | ||
| # | ||
| # Copyright (C) 2006-2022 wolfSSL Inc. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.