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
24 changes: 24 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,32 @@ on:
default: 'CRITICAL,HIGH'

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we use matrix here 🤔

Copy link
Contributor Author

@sunnywu sunnywu Oct 15, 2025

Choose a reason for hiding this comment

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

so we could define a range of setups to run unit tests on, e.g. like below i extended to not just run unit tests on py 3.8 but 3.9/3.10/etc add test coverage, like this run:

https://github.com/IABTechLab/uid2-client-python/actions/runs/18513552871

python-version: ["3.10","3.11","3.12","3.13"]

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run unit tests
run: |
python -m unittest tests/*.py

build-and-pubish:
name: Build and publish Python packages to PyPi
needs: unit-tests
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-publish-to-pypi-versioned.yaml@v3
with:
release_type: ${{ inputs.release_type }}
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,31 @@ name: Build and Test
on: [pull_request, push, workflow_dispatch]

jobs:
build:
vulnerability-scan:
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-build-and-test.yaml@v3
secrets: inherit
with:
vulnerability_scan_only: true

unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10","3.11","3.12","3.13"]

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run unit tests
run: |
python -m unittest tests/*.py
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM python:3.8
FROM python:3.10
COPY . /build
RUN pip install --no-cache-dir -e /build[dev]
18 changes: 14 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[build-system]
requires = [
"setuptools == 68.2.2",
"setuptools < 81",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["uid2_client*"]
exclude = ["tests*", "examples*"]

[project]
name = "uid2_client"
version = "2.7.0"
Expand All @@ -18,13 +22,19 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.6"
requires-python = ">=3.8"
dependencies = [
"setuptools",
"pycryptodome",
"bitarray"
]
keywords = ["uid2"]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"unittest-xml-reporting"
]
keywords = ["uid2","euid"]
[project.license]
file="LICENSE"
[project.urls]
Expand Down
39 changes: 0 additions & 39 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_bidstream_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest
from unittest.mock import patch

from test_utils import *
from .test_utils import *
from uid2_client import BidstreamClient, Uid2Base64UrlCoder, DecryptionStatus, Uid2ClientFactory
from uid2_client.refresh_response import RefreshResponse

Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from unittest.mock import patch

from test_utils import *
from .test_utils import *
from uid2_client import *
from uid2_client.euid_client_factory import EuidClientFactory
from uid2_client.refresh_response import RefreshResponse
Expand Down
2 changes: 1 addition & 1 deletion tests/test_encryption.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from test_utils import *
from .test_utils import *
from uid2_client import *

_master_secret = bytes([139, 37, 241, 173, 18, 92, 36, 232, 165, 168, 23, 18, 38, 195, 123, 92, 160, 136, 185, 40, 91, 173, 165, 221, 168, 16, 169, 164, 38, 139, 8, 155])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_refresh_keys_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from unittest.mock import patch, MagicMock

from uid2_client import refresh_keys_util, Uid2Response
from test_utils import *
from .test_utils import *
from uid2_client.encryption import _encrypt_gcm, _decrypt_gcm


Expand Down
2 changes: 1 addition & 1 deletion tests/test_sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch

from uid2_client import *
from test_utils import *
from .test_utils import *

import datetime as dt

Expand Down
6 changes: 3 additions & 3 deletions tests/test_sharing_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import unittest
from unittest.mock import patch

from test_utils import *
from test_bidstream_client import TestBidStreamClient
from test_encryption import TestEncryptionFunctions
from .test_utils import *
from .test_bidstream_client import TestBidStreamClient
from .test_encryption import TestEncryptionFunctions
from uid2_client import SharingClient, DecryptionStatus, Uid2ClientFactory
from uid2_client.encryption_status import EncryptionStatus
from uid2_client.refresh_response import RefreshResponse
Expand Down