From 29345a28fc4b3251ab92d21928ef3f477e5cf122 Mon Sep 17 00:00:00 2001 From: evelynmitchell Date: Thu, 28 Dec 2023 18:35:29 -0700 Subject: [PATCH 1/2] python version, actions version --- .github/workflows/code_quality_control.yml | 6 +++--- .github/workflows/cos_integration.yml | 6 +++--- .github/workflows/docs.yml | 4 ++-- .github/workflows/docs_test.yml | 6 +++--- .github/workflows/lints.yml | 6 +++--- .github/workflows/pr_request_checks.yml | 6 +++--- .github/workflows/pylint.yml | 4 ++-- .github/workflows/python-publish.yml | 4 ++-- .github/workflows/run_test.yml | 8 ++++---- .github/workflows/test.yml | 1 - .github/workflows/testing.yml | 6 +++--- .github/workflows/unit-test.yml | 2 +- 12 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/code_quality_control.yml b/.github/workflows/code_quality_control.yml index 3fb4eb8..5bc4b1e 100644 --- a/.github/workflows/code_quality_control.yml +++ b/.github/workflows/code_quality_control.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Find Python files run: find swarms_torch -name "*.py" -type f -exec autopep8 --in-place --aggressive --aggressive {} + diff --git a/.github/workflows/cos_integration.yml b/.github/workflows/cos_integration.yml index f98e956..15e681a 100644 --- a/.github/workflows/cos_integration.yml +++ b/.github/workflows/cos_integration.yml @@ -10,15 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Run unit tests run: pytest tests/unit diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e2e3e49..7d19ad8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,10 +10,10 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - run: pip install mkdocs-material - run: pip install "mkdocstrings[python]" - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/docs_test.yml b/.github/workflows/docs_test.yml index 9bb0766..eacb798 100644 --- a/.github/workflows/docs_test.yml +++ b/.github/workflows/docs_test.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Build documentation run: make docs diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 8cbb55a..2a667b0 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Run linters run: pylint swarms_torch \ No newline at end of file diff --git a/.github/workflows/pr_request_checks.yml b/.github/workflows/pr_request_checks.yml index 19c89aa..6322998 100644 --- a/.github/workflows/pr_request_checks.yml +++ b/.github/workflows/pr_request_checks.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Run tests and checks run: | diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index d3f42fb..f334972 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -16,7 +16,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --no-cache-dir --upgrade pip pip install pylint - name: Analysing the code with pylint run: | diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index aef7b00..424e5e7 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,10 +18,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.10' - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --no-cache-dir --upgrade pip pip install build - name: Build package run: python -m build diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index ff7ee86..b0766d6 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -9,15 +9,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: '3.10' - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --no-cache-dir --upgrade pip pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi - name: Run tests with pytest run: | pytest tests/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65dc68d..e2fb311 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,6 @@ jobs: strategy: matrix: python-version: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3a417da..9a32b8d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Run unit tests run: pytest tests/ \ No newline at end of file diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b32eb6f..a6a94f6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -21,7 +21,7 @@ jobs: python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: pip install --no-cache-dir -r requirements.txt - name: Run Python unit tests run: python3 -m unittest tests/ From 2fb680851c715309365676eed3109dc642a46358 Mon Sep 17 00:00:00 2001 From: evelynmitchell Date: Thu, 28 Dec 2023 18:38:06 -0700 Subject: [PATCH 2/2] Dockerfile --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6eba764 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# ================================== +# Use an official Python runtime as a parent image +FROM python:3.10-slim +RUN apt-get update && apt-get -y install libgl1-mesa-dev libglib2.0-0 build-esse +ntial; apt-get clean +RUN pip install opencv-contrib-python-headless + +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# Set the working directory in the container +WORKDIR /usr/src/zeta + + +# Install Python dependencies +# COPY requirements.txt and pyproject.toml if you're using poetry for dependency + management +COPY requirements.txt . +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt + +RUN pip install --no-cache-dir zetascale + +# Copy the rest of the application +COPY . . +