Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2289 Migrate to Poetry #2436

Merged
merged 27 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fc118c5
move from requirements.txt to poetry
Gavinok Aug 19, 2023
f111da7
Merge branch 'main' into migrate-to-poetry
Gavinok Aug 19, 2023
5b8ba48
Add python3-indy for Dockerfile.indy and corrected pyproject.toml
Gavinok Aug 19, 2023
5bfc54e
removed old setup.py and requirements.txt files
Gavinok Aug 19, 2023
8246b6c
Migrate poetry groups to extra dependancies
Gavinok Aug 22, 2023
d2db5dc
Updated test workflow to use poetry
Gavinok Aug 22, 2023
d1baab1
use pip install as the dockerfiles do for poetry
Gavinok Aug 22, 2023
e33d164
Corrected outdated "Indy Agent" to "Aries Agent"
Gavinok Aug 22, 2023
6d06184
Converted bash script to a python script for poetry support
Gavinok Aug 22, 2023
b6c9cc7
Simplify install by installing the complete package
Gavinok Aug 22, 2023
5cb336e
change entry point to be in 'name=module:attrs [extras]' format
Gavinok Aug 22, 2023
2aac2ce
Move tests from being optional to being a dev dependency
Gavinok Aug 22, 2023
65d058e
instead of os for aca-py import the module it's self
Gavinok Aug 24, 2023
ff377ec
Dropped dedicated aca-py script for poetry calling of main()
Gavinok Aug 24, 2023
8347c0b
bin directory is no longer necessary
Gavinok Aug 24, 2023
9d7a416
Create a dedicated scripting main to prevent failing during tests
Gavinok Aug 24, 2023
219240d
Conform to flake8
Gavinok Aug 24, 2023
ca60314
Corrected name of function in aca-py script
Gavinok Aug 24, 2023
9205b65
Merge branch 'main' into migrate-to-poetry
Gavinok Aug 25, 2023
981bc6c
removed tests as an extra and added hyperledger as the author
Gavinok Aug 25, 2023
afa1a67
Update publication to now use poetry
Gavinok Aug 25, 2023
433086d
Merge branch 'main' into migrate-to-poetry
Gavinok Aug 25, 2023
7bf400b
Merge branch 'main' into migrate-to-poetry
Gavinok Aug 28, 2023
93dfcab
Update devcontainer to use the poetry files.
Gavinok Aug 29, 2023
e7423b5
Added a Poetry.md
Gavinok Aug 29, 2023
ef6aac7
Relocate Poetry.md to the docs directory for consistancy
Gavinok Aug 29, 2023
040e830
Merge branch 'main' into migrate-to-poetry
usingtechnology Aug 29, 2023
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
13 changes: 4 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ jobs:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements*.txt'
- name: Install dependencies
- name: Install the project dependencies
run: |
python -m pip install --upgrade pip
pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
pip install poetry
poetry install -E "askar bbs test"
- name: Tests
run: |
pytest
run: poetry run pytest
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,4 @@ _build/
**/*.iml

# Open API build
open-api/.build

# poetry
poetry.lock
pyproject.toml
open-api/.build
13 changes: 9 additions & 4 deletions aries_cloudagent/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ def run(args):
run_command(command, args)


def script_main():
"""Run the main function as a script for poetry."""
main(sys.argv)


def main(args):
"""Execute default entry point."""
if __name__ == "__main__":
init_debug(args)
run(args)
init_debug(args)
run(args)


main(sys.argv)
if __name__ == "__main__":
script_main()
10 changes: 0 additions & 10 deletions bin/aca-py

This file was deleted.

4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ WORKDIR /src

ADD . .

RUN pip install setuptools wheel
RUN python setup.py sdist bdist_wheel
RUN pip install --no-cache-dir poetry
RUN poetry build

FROM python:${python_version}-slim-bullseye AS main

Expand Down
15 changes: 5 additions & 10 deletions docker/Dockerfile.demo
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ RUN mkdir -p bin && curl -L -o bin/jq \
https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
chmod ug+x bin/jq

# Add and install Indy Agent code
ADD requirements*.txt ./
# Add and install Aries Agent code
RUN pip install --no-cache-dir poetry

RUN pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
ADD README.md pyproject.toml poetry.lock ./

RUN poetry install --no-root --no-directory -E "askar bbs"

ADD aries_cloudagent ./aries_cloudagent
ADD bin ./bin
ADD README.md ./
ADD scripts ./scripts
ADD setup.py ./

RUN pip3 install --no-cache-dir -e .

Expand Down
15 changes: 6 additions & 9 deletions docker/Dockerfile.indy
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,16 @@ WORKDIR /home/indy/src

RUN mkdir -p test-reports && chown -R indy:indy test-reports && chmod -R ug+rw test-reports

ADD requirements*.txt ./
ADD ./README.md pyproject.toml ./poetry.lock ./

USER root
RUN pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
RUN pip install --no-cache-dir poetry
RUN poetry install --no-root --no-directory -E "askar bbs indy test"

ADD --chown=indy:root . .
USER indy

ENTRYPOINT ["/bin/bash", "-c", "pytest \"$@\"", "--"]
ENTRYPOINT ["/bin/bash", "-c", "poetry run pytest \"$@\"", "--"]

# ACA-Py Builder
# Build ACA-Py wheel using setuptools
Expand All @@ -210,8 +207,8 @@ WORKDIR /src

ADD . .

RUN pip install setuptools wheel
RUN python setup.py sdist bdist_wheel
RUN pip install --no-cache-dir poetry
RUN poetry build


# ACA-Py Indy
Expand Down
22 changes: 8 additions & 14 deletions docker/Dockerfile.run
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ ENV ENABLE_PTVSD 0

# For consistency with base images, include curl for healthchecks
RUN apt-get update && apt-get install -y curl && apt-get clean
ADD requirements*.txt ./

RUN pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
RUN pip install --no-cache-dir poetry

RUN mkdir aries_cloudagent && touch aries_cloudagent/__init__.py
ADD aries_cloudagent/version.py aries_cloudagent/version.py
ADD bin ./bin
ADD README.md ./
ADD setup.py ./
ADD . .

RUN poetry install -E "askar bbs"

RUN pip3 install --no-cache-dir -e .
RUN mkdir -p aries_cloudagent && touch aries_cloudagent/__init__.py
ADD aries_cloudagent/version.py aries_cloudagent/version.py

RUN mkdir logs && chmod -R ug+rw logs
RUN mkdir -p logs && chmod -R ug+rw logs
ADD aries_cloudagent ./aries_cloudagent

ENTRYPOINT ["/bin/bash", "-c", "aca-py \"$@\"", "--"]
ENTRYPOINT ["/bin/bash", "-c", "poetry run aca-py \"$@\"", "--"]
12 changes: 5 additions & 7 deletions docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ RUN apt-get update -y && \

WORKDIR /usr/src/app

ADD requirements*.txt ./
RUN pip install --no-cache-dir poetry

RUN pip3 install --no-cache-dir \
-r requirements.txt \
-r requirements.askar.txt \
-r requirements.bbs.txt \
-r requirements.dev.txt
ADD ./README.md pyproject.toml ./poetry.lock ./

RUN poetry install --no-root --no-directory -E "askar bbs test"

ADD . .

ENTRYPOINT ["/bin/bash", "-c", "pytest \"$@\"", "--"]
ENTRYPOINT ["/bin/bash", "-c", "poetry run pytest \"$@\"", "--"]
Loading