From 3763bb5f6237ef8220de99bf45856f909fc63c8d Mon Sep 17 00:00:00 2001 From: Jonathan Gutierrez Date: Tue, 17 Jun 2025 13:15:34 -0500 Subject: [PATCH 1/4] Update actions to support Python 3.11 & 3.12. - Regenerates the poetry.lock file. - Fixes pyproject.toml's `tool.poetry.dev-dependencies` deprecation warning. - Updates action versions to the latest stable versions. - Updates wheel names so Github actions doesn't collide on names (e.g. CD 3.10 aarch64 for both linux & macos). --- .github/workflows/ci.yml | 14 +++++++--- .github/workflows/release.yml | 48 ++++++++++++++++++++++++----------- poetry.lock | 44 ++++++++++++++++++-------------- pyproject.toml | 2 +- 4 files changed, 69 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c41f537..70c0f66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,23 @@ on: jobs: CI: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} - name: Build Wheel uses: messense/maturin-action@v1 with: manylinux: off args: --find-interpreter - - uses: abatilo/actions-poetry@v2.3.0 + - name: Install poetry + uses: abatilo/actions-poetry@v4 - name: Run Tests run: | poetry install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a44c3d2..834a7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,55 +14,73 @@ jobs: runs-on: macos-latest strategy: matrix: + python-version: ["3.10", "3.11", "3.12"] target: [x64, aarch64] steps: - - uses: actions/checkout@v2 - - name: Build wheels - uses: messense/maturin-action@v1 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: + python-version: ${{ matrix.python-version }} + - name: Build Wheels + uses: PyO3/maturin-action@v1 + with: + command: build target: ${{ matrix.target }} args: --release -o dist --find-interpreter - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: wheels + name: macos-wheels-${{ matrix.python-version }}-${{matrix.target}} path: dist windows: runs-on: windows-latest strategy: matrix: + python-version: ["3.10", "3.11", "3.12"] target: [x64, x86] steps: - - uses: actions/checkout@v2 - - name: Build wheels - uses: messense/maturin-action@v1 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Build Wheels + uses: PyO3/maturin-action@v1 with: + command: build target: ${{ matrix.target }} args: --release -o dist --find-interpreter - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: wheels + name: windows-wheels-${{ matrix.python-version }}-${{matrix.target}} path: dist linux: runs-on: ubuntu-latest strategy: matrix: + python-version: ["3.10", "3.11", "3.12"] target: [x86_64, i686, aarch64, armv7] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Build Wheels - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: + command: build target: ${{ matrix.target }} manylinux: auto args: --release -o dist --find-interpreter - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: wheels + name: linux-wheels-${{ matrix.python-version }}-${{matrix.target}} path: dist # TODO Add pypy @@ -76,7 +94,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: wheels - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: 3.9 - name: Publish to PyPi diff --git a/poetry.lock b/poetry.lock index 140b8c8..1cb12b7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,12 +1,12 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "attrs" version = "22.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, @@ -17,15 +17,16 @@ cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] dev = ["attrs[docs,tests]"] docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope.interface"] tests = ["attrs[tests-no-zope]", "zope.interface"] -tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] +tests-no-zope = ["cloudpickle ; platform_python_implementation == \"CPython\"", "cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990) ; platform_python_implementation == \"CPython\"", "mypy (>=0.971,<0.990) ; platform_python_implementation == \"CPython\"", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version < \"3.11\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version < \"3.11\"", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -35,9 +36,10 @@ files = [ name = "exceptiongroup" version = "1.1.0" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, @@ -50,9 +52,10 @@ test = ["pytest (>=6)"] name = "importlib-metadata" version = "6.0.0" description = "Read metadata from Python packages" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version == \"3.7\"" files = [ {file = "importlib_metadata-6.0.0-py3-none-any.whl", hash = "sha256:7efb448ec9a5e313a57655d35aa54cd3e01b7e1fbcf72dce1bf06119420f5bad"}, {file = "importlib_metadata-6.0.0.tar.gz", hash = "sha256:e354bedeb60efa6affdcc8ae121b73544a7aa74156d047311948f6d711cd378d"}, @@ -65,15 +68,15 @@ zipp = ">=0.5" [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] +testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3) ; python_version < \"3.9\"", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8 ; python_version < \"3.12\"", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-perf (>=0.9.2)"] [[package]] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -83,9 +86,9 @@ files = [ name = "maturin" version = "0.14.15" description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "maturin-0.14.15-py3-none-linux_armv6l.whl", hash = "sha256:366642ad2195419d07f53f620e4c8e3a67dacd1a1fd9e98f80eb92103726514b"}, {file = "maturin-0.14.15-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:043787e41a039c47e070e735336ead7161a17112d2ae35db1c6516ad362dc6d7"}, @@ -113,9 +116,9 @@ zig = ["ziglang (>=0.10.0,<0.11.0)"] name = "packaging" version = "23.0" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, @@ -125,9 +128,9 @@ files = [ name = "pluggy" version = "1.0.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, @@ -144,9 +147,9 @@ testing = ["pytest", "pytest-benchmark"] name = "pytest" version = "7.2.2" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-7.2.2-py3-none-any.whl", hash = "sha256:130328f552dcfac0b1cec75c12e3f005619dc5f874f0a06e8ff7263f0ee6225e"}, {file = "pytest-7.2.2.tar.gz", hash = "sha256:c99ab0c73aceb050f68929bc93af19ab6db0558791c6a0715723abe9d0ade9d4"}, @@ -169,9 +172,9 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2. name = "pytest-asyncio" version = "0.20.3" description = "Pytest support for asyncio" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-asyncio-0.20.3.tar.gz", hash = "sha256:83cbf01169ce3e8eb71c6c278ccb0574d1a7a3bb8eaaf5e50e0ad342afb33b36"}, {file = "pytest_asyncio-0.20.3-py3-none-any.whl", hash = "sha256:f129998b209d04fcc65c96fc85c11e5316738358909a8399e93be553d7656442"}, @@ -189,9 +192,10 @@ testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -201,9 +205,10 @@ files = [ name = "typing-extensions" version = "4.5.0" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version == \"3.7\"" files = [ {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, @@ -213,9 +218,10 @@ files = [ name = "zipp" version = "3.15.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version == \"3.7\"" files = [ {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, @@ -223,9 +229,9 @@ files = [ [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8 ; python_version < \"3.12\"", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\""] [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = "^3.7" -content-hash = "33e5f95b73dcbf4528a485106ea8e8de46bffd6766f442cf7344643947ce3941" +content-hash = "20e0079f78b3f2f771a7b43c51b2250d0f88d8873b9af6b3321e099d1015b712" diff --git a/pyproject.toml b/pyproject.toml index d78f8c1..09b70d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ authors = [ "Spruce Systems, Inc." ] [tool.poetry.dependencies] python = "^3.7" -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] maturin = "^0.14.15" pytest = "^7.2.2" pytest-asyncio = "^0.20.3" From a92108b18fdf8e2a6b676098d9a310184273379a Mon Sep 17 00:00:00 2001 From: Jonathan Gutierrez Date: Thu, 21 Aug 2025 15:58:52 -0500 Subject: [PATCH 2/4] Update pyproject config & GH actions. - Remove builds on PRs. - Update to use `actions/download-artifact@v4` --- .github/workflows/ci.yml | 2 -- .github/workflows/release.yml | 19 +++++++++---------- pyproject.toml | 22 ++++++++++++++-------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70c0f66..a0618e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,6 @@ name: CI on: push: branches: [main] - pull_request: - branches: [main] jobs: CI: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 834a7b4..2afccd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,6 @@ on: push: tags: - v* - pull_request: branches: - 'main' @@ -85,22 +84,22 @@ jobs: # TODO Add pypy - release: - name: Release + publish: + name: Publish to PyPI (Twine) runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" needs: [ macos, linux, windows] steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: - name: wheels + pattern: '*' + merge-multiple: true - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: Publish to PyPi + with: { python-version: "3.12" } + - name: Upload with twine env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - pip install --upgrade twine + python -m pip install --upgrade twine twine upload --skip-existing * diff --git a/pyproject.toml b/pyproject.toml index 09b70d9..1d3108a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,7 @@ [project] -name = "didkit" +name = "dlinc-didkit" # <-- PyPI dist name +version = "0.1.0" +description = "Fork of spruceid/didkit-python maintained by dLinc. Library for Verifiable Credentials and Decentralized Identifiers." requires-python = ">=3.7" classifiers = [ "Programming Language :: Rust", @@ -8,16 +10,16 @@ classifiers = [ "Topic :: Security", ] -# [project.urls] -# homepage = "https://github.com/spruceid/didkit-python" -# documentation = "https://github.com/spruceid/didkit-python" -# repository = "https://github.com/spruceid/didkit-python" +[project.urls] +Homepage = "https://github.com/dogwoodlogic/didkit-python" +Source = "https://github.com/dogwoodlogic/didkit-python" +Issues = "https://github.com/dogwoodlogic/didkit-python/issues" +Upstream = "https://github.com/spruceid/didkit-python" [tool.poetry] -name = "didkit" +name = "dlinc-didkit" # keep in sync with [project].name version = "0.1.0" -description = "Library for Verifiable Credentials and Decentralized Identifiers." -authors = [ "Spruce Systems, Inc." ] +description = "Fork of spruceid/didkit-python. Library for Verifiable Credentials and Decentralized Identifiers." [tool.poetry.dependencies] python = "^3.7" @@ -30,3 +32,7 @@ pytest-asyncio = "^0.20.3" [build-system] requires = ["maturin>=0.14,<0.15"] build-backend = "maturin" + +[tool.maturin] +# Critical - This keeps the Python import as 'didkit' +module-name = "didkit" From 40993995c392240041a20e9bc9c776b65d1ea7eb Mon Sep 17 00:00:00 2001 From: Jonathan Gutierrez Date: Thu, 21 Aug 2025 16:06:10 -0500 Subject: [PATCH 3/4] Run tests on PR not builds - GH actions. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0618e2..54bdb40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: push: branches: [main] + pull_request: + branches: [main] jobs: CI: @@ -17,7 +19,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + + # Build wheel ONLY on push (not on PR) - name: Build Wheel + if: github.event_name != 'pull_request' uses: messense/maturin-action@v1 with: manylinux: off From eeb72e091f7e25135b2cf80d8d1ce0a4912132b5 Mon Sep 17 00:00:00 2001 From: Jonathan Gutierrez Date: Thu, 21 Aug 2025 16:16:02 -0500 Subject: [PATCH 4/4] Fix tests on PR - GH actions. --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54bdb40..598948e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,10 @@ jobs: args: --find-interpreter - name: Install poetry uses: abatilo/actions-poetry@v4 - - name: Run Tests + - uses: dtolnay/rust-toolchain@stable + with: { toolchain: stable } + - name: Install deps & test run: | - poetry install + poetry install --no-root poetry run maturin develop poetry run pytest