diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41f84c9..f8c519e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,8 @@ jobs: pip install pytest pip install requests if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Check installed dependencies + run: python -m pip check - name: Run tests run: | pytest @@ -38,9 +40,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-cov codecov + pip install pytest pytest-cov requests if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run core vLEI tests run: | pytest --cov=./ --cov-report=xml - codecov diff --git a/Makefile b/Makefile index 4ff55ab..7c5b22e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PYTHON ?= python3.12 VENV_PYTHON := $(VENV)/bin/python VLEI_SERVER := $(VENV)/bin/vLEI-server -VERSION=1.0.3 +VERSION=1.0.4 IMAGE_NAME=gleif/vlei LATEST_TAG=$(IMAGE_NAME):latest VERSION_TAG=$(IMAGE_NAME):$(VERSION) diff --git a/container/Dockerfile b/container/Dockerfile index ce8f94b..f905a34 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -1,53 +1,15 @@ -FROM python:3.12.6-slim AS builder +FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 -# Install compilation dependencies for Ubuntu including ca-certificates, libffi, and libsodium -RUN apt-get update && apt-get install -y \ - build-essential \ - libffi-dev \ - libsodium-dev \ - libssl-dev \ - python3-dev \ - python3-venv \ - python3-pip \ - curl - -SHELL ["/bin/bash", "-c"] - -# Setup Rust for blake3 dependency build -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y - -WORKDIR /vLEI - -RUN python -m venv venv -ENV PATH=/vLEI/venv/bin:${PATH} -RUN pip install --upgrade pip - -COPY requirements.txt setup.py /vLEI/ -RUN mkdir /vLEI/src - -# Build vLEI-server -RUN . "$HOME/.cargo/env" && \ - pip install -r requirements.txt - -# Create smaller runner image by copying over built binary -FROM python:3.12.6-slim AS runner - -RUN apt-get update -RUN apt-get install -y libsodium23 curl - -# Prevents Python from buffering stdout and stderr, logs to stdout immediately -ENV PYTHONUNBUFFERED=1 -# Set default encoding to UTF-8 -ENV PYTHONIOENCODING=UTF-8 +RUN apt-get update && apt-get install -y --no-install-recommends libsodium23 curl \ + && rm -rf /var/lib/apt/lists/* +ENV PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8 WORKDIR /vLEI - -COPY --from=builder /vLEI /vLEI -COPY src/ src/ -COPY ./schema/acdc /vLEI/schema -COPY ./samples/acdc /vLEI/credentials -COPY ./samples/oobis /vLEI/oobis - -ENV PATH=/vLEI/venv/bin:${PATH} +COPY setup.py README.md LICENSE /vLEI/ +COPY src/ /vLEI/src/ +RUN python -m pip install --no-cache-dir . && python -m pip check +COPY schema/acdc/ /vLEI/schema/ +COPY samples/acdc/ /vLEI/credentials/ +COPY samples/oobis/ /vLEI/oobis/ CMD ["vLEI-server", "-s", "/vLEI/schema", "-c", "/vLEI/credentials", "-o", "/vLEI/oobis"] diff --git a/setup.py b/setup.py index 8c4019d..e7e6bc4 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup( name='vlei', - version='1.0.3', # also change in src/vlei/__init__.py + version='1.0.4', # also change in src/vlei/__init__.py license='Apache Software License 2.0', description='Verifiable Legal Entity Identifier', long_description=long_description, @@ -74,8 +74,8 @@ ], python_requires='>=3.12.6', install_requires=[ - 'hio>=0.6.14,<0.7.0', - 'keri>=1.2.13,<1.3.0', + 'gleif_hio==0.6.21', + 'gleif_keri==1.2.16', 'falcon>=4.0.2', 'multicommand>=1.0.0' ], diff --git a/src/vlei/__init__.py b/src/vlei/__init__.py index 9f23f9a..e839d6d 100644 --- a/src/vlei/__init__.py +++ b/src/vlei/__init__.py @@ -1,4 +1,4 @@ # -*- encoding: utf-8 -*- -__version__ = '1.0.3' # also change in setup.py +__version__ = '1.0.4' # also change in setup.py diff --git a/tests/test_dependency_ownership.py b/tests/test_dependency_ownership.py new file mode 100644 index 0000000..76ae949 --- /dev/null +++ b/tests/test_dependency_ownership.py @@ -0,0 +1,13 @@ +"""The schema server must run on one consistent GLEIF dependency chain.""" +from importlib import metadata +import hio +import keri +import vlei + + +def test_release_dependencies_have_exclusive_import_ownership(): + names = {d.metadata["Name"].lower().replace("_", "-") for d in metadata.distributions()} + assert not {"keri", "hio"} & names + assert metadata.version("gleif-hio") == hio.__version__ == "0.6.21" + assert metadata.version("gleif-keri") == keri.__version__ == "1.2.16" + assert metadata.version("vlei") == vlei.__version__ == "1.0.4"