From 04808885be4c28077dd8ad0701c57ab46072b70c Mon Sep 17 00:00:00 2001 From: Kent Bull Date: Fri, 10 Jan 2025 12:02:40 -0700 Subject: [PATCH] chore: upgrade deps to prep for 0.2.0-rc1 release --- .github/workflows/python-app-ci.yml | 14 ++++----- Makefile | 19 ++++++++++-- images/keria.dockerfile | 22 ++++++++------ scripts/keri/cf/keria.json | 16 ++++++++++ scripts/keri/cf/main/keria.json | 0 setup.py | 47 +++++++++++++++++------------ src/keria/__init__.py | 2 +- src/keria/app/agenting.py | 2 +- 8 files changed, 81 insertions(+), 41 deletions(-) delete mode 100755 scripts/keri/cf/main/keria.json diff --git a/.github/workflows/python-app-ci.yml b/.github/workflows/python-app-ci.yml index a53b5351..2776c1f9 100644 --- a/.github/workflows/python-app-ci.yml +++ b/.github/workflows/python-app-ci.yml @@ -20,11 +20,11 @@ jobs: os: [ macos-13, ubuntu-latest ] steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.12.2 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.12.8 + uses: actions/setup-python@v5 with: - python-version: 3.12.2 + python-version: 3.12.8 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -43,11 +43,11 @@ jobs: coverage: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.12.2 + - uses: actions/checkout@v4 + - name: Set up Python 3.12.8 uses: actions/setup-python@v2 with: - python-version: 3.12.2 + python-version: 3.12.8 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/Makefile b/Makefile index c318b882..d58a29ef 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ .PHONY: build-keria -VERSION=0.2.0-dev6 +VERSION=0.2.0-rc1 +IMAGE_NAME=weboftrust/keria +VERSION_TAG=$(IMAGE_NAME):$(VERSION) +LATEST_TAG=$(IMAGE_NAME):latest define DOCKER_WARNING In order to use the multi-platform build enable the containerd image store @@ -11,11 +14,21 @@ To enable the feature for Docker Desktop: Select Apply and Restart." endef +build-wheel: + @python setup.py sdist + build-keria: .warn - @docker build --platform=linux/amd64,linux/arm64 --no-cache -f images/keria.dockerfile -t weboftrust/keria:$(VERSION) . + @docker build \ + --build-arg KERI_AGENT_CORS=false \ + --platform=linux/amd64,linux/arm64 \ + --no-cache \ + -f images/keria.dockerfile \ + -t $(LATEST_TAG) \ + -t $(VERSION_TAG) \ + . publish-keria: - @docker push weboftrust/keria:$(VERSION) + @docker push $(VERSION_TAG) && docker push $(LATEST_TAG) .warn: @echo -e ${RED}"$$DOCKER_WARNING"${NO_COLOUR} diff --git a/images/keria.dockerfile b/images/keria.dockerfile index ecc6424d..1b292730 100644 --- a/images/keria.dockerfile +++ b/images/keria.dockerfile @@ -1,8 +1,9 @@ # Builder stage -FROM python:3.12-alpine3.19 as builder +FROM python:3.12.8-alpine3.21 AS builder # Install compilation dependencies RUN apk --no-cache add \ + curl \ bash \ alpine-sdk \ libffi-dev \ @@ -13,29 +14,32 @@ SHELL ["/bin/bash", "-c"] # Install Rust for blake3 dependency build RUN curl https://sh.rustup.rs -sSf | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /keria RUN python -m venv venv ENV PATH=/keria/venv/bin:${PATH} -RUN pip install --upgrade pip -# Copy in Python dependency files -COPY requirements.txt setup.py ./ +RUN pip install --upgrade pip # "src/" dir required for installation of dependencies with setup.py RUN mkdir /keria/src +# Copy in Python dependency files +COPY requirements.txt setup.py ./ + # Install Python dependencies -RUN . "$HOME/.cargo/env" && \ - pip install -r requirements.txt +RUN . "$HOME/.cargo/env" +RUN pip install -r requirements.txt # Runtime stage -FROM python:3.12-alpine3.19 +FROM python:3.12.8-alpine3.21 # Install runtime dependencies RUN apk --no-cache add \ bash \ - alpine-sdk \ - libsodium-dev + curl \ + libsodium-dev \ + gcc WORKDIR /keria diff --git a/scripts/keri/cf/keria.json b/scripts/keri/cf/keria.json index e69de29b..f44b8bcd 100755 --- a/scripts/keri/cf/keria.json +++ b/scripts/keri/cf/keria.json @@ -0,0 +1,16 @@ +{ + "dt": "2025-01-03T16:08:30.123456+00:00", + "keria": { + "dt": "2025-01-03T16:08:30.123457+00:00", + "curls": ["http://127.0.0.1:3902/"] + }, + "iurls": [ + "http://127.0.0.1:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha/controller?name=Wan&tag=witness", + "http://127.0.0.1:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM/controller?name=Wil&tag=witness", + "http://127.0.0.1:5644/oobi/BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX/controller?name=Wes&tag=witness" + ], + "tocks": { + "initer": 0.0, + "escrower": 1.0 + } +} \ No newline at end of file diff --git a/scripts/keri/cf/main/keria.json b/scripts/keri/cf/main/keria.json deleted file mode 100755 index e69de29b..00000000 diff --git a/setup.py b/setup.py index 694427bb..ee9fd0f9 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ https://caremad.io/posts/2013/07/setup-vs-requirement/ """ - +from pathlib import Path from glob import glob from os.path import basename from os.path import splitext @@ -32,12 +32,19 @@ from setuptools import find_packages from setuptools import setup +this_directory = Path(__file__).parent +if (this_directory / "README.md").exists(): # If building inside a container, like in the `images/keria.dockerfile`, this file won't exist and fails the build + long_description = (this_directory / "README.md").read_text() +else: + long_description = "KERIA: KERI Agent in the cloud." + setup( name='keria', - version='0.2.0-dev6', # also change in src/keria/__init__.py + version='0.2.0-rc1', # also change in src/keria/__init__.py license='Apache Software License 2.0', description='KERIA: KERI Agent in the cloud', - long_description="KERIA: KERI Agent in the cloud.", + long_description=long_description, + long_description_content_type='text/markdown', author='Philip S. Feairheller', author_email='pfeairheller@gmail.com', url='https://github.com/WebOfTrust/keria', @@ -54,7 +61,7 @@ 'Operating System :: Unix', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', - 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', # uncomment if you test on these interpreters: # 'Programming Language :: Python :: Implementation :: PyPy', @@ -64,37 +71,37 @@ 'Topic :: Utilities', ], project_urls={ + 'Documentation': 'https://weboftrust.github.io/keridoc', 'Issue Tracker': 'https://github.com/WebOfTrust/keria/issues', + 'Source': 'https://github.com/WebOfTrust/keria', }, keywords=[ "secure attribution", "authentic data", "discovery", - "resolver", - # eg: 'keyword1', 'keyword2', 'keyword3', + "resolver" ], python_requires='>=3.12.2', install_requires=[ - 'hio>=0.6.14', - 'keri==1.2.0.dev13', - 'mnemonic>=0.21', - 'multicommand>=1.0.0', - 'falcon>=3.1.3', - 'http_sfv>=0.9.8', - 'dataclasses_json>=0.5.7', - 'apispec>=6.6.0', + 'hio==0.6.14', + 'keri==1.2.2', + 'mnemonic==0.21', + 'multicommand==1.0.0', + 'falcon==4.0.2', + 'http_sfv==0.9.9', + 'dataclasses_json==0.6.7', + 'apispec==6.8.1', ], extras_require={ - # eg: - # 'rst': ['docutils>=0.11'], - # ':python_version=="2.6"': ['argparse'], + 'test': ['pytest', 'coverage'], + 'docs': ['sphinx', 'sphinx-rtd-theme'] }, tests_require=[ - 'coverage>=5.5', - 'pytest>=6.2.4', - 'requests==2.32.3' + 'coverage>=7.6.10', + 'pytest>=8.3.4', ], setup_requires=[ + 'setuptools==75.8.0' ], entry_points={ 'console_scripts': [ diff --git a/src/keria/__init__.py b/src/keria/__init__.py index 7f1c432f..babcc040 100644 --- a/src/keria/__init__.py +++ b/src/keria/__init__.py @@ -3,5 +3,5 @@ main package """ -__version__ = '0.2.0-dev6' # also change in setup.py +__version__ = '0.2.0-rc1' # also change in setup.py diff --git a/src/keria/app/agenting.py b/src/keria/app/agenting.py index 127798da..59895026 100644 --- a/src/keria/app/agenting.py +++ b/src/keria/app/agenting.py @@ -1206,7 +1206,7 @@ def on_get(req, rep): pre = req.params.get("pre") preb = pre.encode("utf-8") events = [] - for fn, dig in agent.hby.db.getFelItemPreIter(preb, fn=0): + for _, fn, dig in agent.hby.db.getFelItemPreIter(preb, fn=0): if not (raw := agent.hby.db.cloneEvtMsg(pre=preb, fn=fn, dig=dig)): raise falcon.HTTPInternalServerError(f"Missing event for dig={dig}.")