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
14 changes: 10 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python -m build

- name: Upload package to artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand Down Expand Up @@ -62,6 +62,7 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
Expand All @@ -71,7 +72,7 @@ jobs:
uses: actions/checkout@v3

- name: Download package from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand All @@ -84,6 +85,9 @@ jobs:
- name: Install test dependencies
run: |
pip install pytest
# work around lack of release version fix for oscrypto issue #75
# https://github.com/wbond/oscrypto/pull/76
pip install --user --force-reinstall --break-system-packages git+https://github.com/wbond/oscrypto.git@master

- name: Install package
run: |
Expand All @@ -105,7 +109,7 @@ jobs:

steps:
- name: Download package from artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand All @@ -120,5 +124,7 @@ jobs:
pip install twine

- name: Upload package to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --skip-existing dist/*
twine upload -u __token__ -p "$PYPI_TOKEN" --skip-existing dist/*
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pytest]
addopts = -ra -v -x
addopts = -ra -v
testpaths =
tests
2 changes: 1 addition & 1 deletion tests/test_ec2_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_fail_on_illegal_kty(crv, kty):


def test_remove_empty_keyops_list():
cose_key = {KpKty: KtyEC2, EC2KpD: p384_d, KpAlg: Es256, EC2KpCurve: P256, KpKeyOps: []}
cose_key = {KpKty: KtyEC2, EC2KpD: p256_d, KpAlg: Es256, EC2KpCurve: P256, KpKeyOps: []}

key = CoseKey.from_dict(cose_key)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_rsa_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
from pycose.keys.keytype import KtySymmetric, KtyOKP, KtyEC2, KtyRSA


@pytest.mark.parametrize('bit_length', [512, 1024, 2048, 4096])
@pytest.mark.parametrize('bit_length', [1024, 2048, 4096])
def test_rsa_key_generation(bit_length):
key = RSAKey.generate_key(bit_length)


@pytest.mark.parametrize('bit_length', [512, 1024])
@pytest.mark.parametrize('bit_length', [1024])
@pytest.mark.parametrize('kty', [KtyOKP, KtySymmetric, KtyEC2, 1, 4])
def test_fail_on_illegal_kty(bit_length, kty):
params = {KpKty: kty}
Expand Down
Loading