From 1d62dc68463d827c15c3ba6fc576fbb441b06d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 10:45:22 -0700 Subject: [PATCH 01/12] chore: release-please integration --- .github/workflows/CD-publish_to_pypi.yml | 36 ++++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CD-publish_to_pypi.yml b/.github/workflows/CD-publish_to_pypi.yml index c6cdf887..718e6102 100644 --- a/.github/workflows/CD-publish_to_pypi.yml +++ b/.github/workflows/CD-publish_to_pypi.yml @@ -1,15 +1,39 @@ name: CD | Publish Python 🐍 distributions đŸ“Ļ to PyPI on: - release: - types: [published] - + push: + branches: + - main workflow_dispatch: +permissions: + contents: write + pull-requests: write + actions: write + jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: python + package-name: runpod + build-n-publish: name: Build and publish Python 🐍 distributions đŸ“Ļ to PyPI + needs: release-please + if: ${{ needs.release-please.outputs.release_created }} runs-on: ubuntu-latest + environment: release + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -41,14 +65,14 @@ jobs: repository_url: https://test.pypi.org/legacy/ - name: Publish distribution đŸ“Ļ to PyPI - # if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} notify-runpod-workers: name: Notify workers - needs: build-n-publish + needs: [release-please, build-n-publish] + if: ${{ needs.release-please.outputs.release_created }} strategy: matrix: repo: @@ -75,7 +99,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Wait for propegation + - name: Wait for propagation run: sleep 300s shell: bash From 9f7a63c7129a4f5cfa66dc1bbd95771aabdd82af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 13:51:45 -0700 Subject: [PATCH 02/12] chore: PyPI publishing using OIDC --- .github/workflows/CD-publish_to_pypi.yml | 7 ++----- .github/workflows/CD-test_publish_to_pypi.yml | 7 +++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CD-publish_to_pypi.yml b/.github/workflows/CD-publish_to_pypi.yml index 718e6102..49642a03 100644 --- a/.github/workflows/CD-publish_to_pypi.yml +++ b/.github/workflows/CD-publish_to_pypi.yml @@ -33,7 +33,7 @@ jobs: environment: release permissions: contents: read - id-token: write + id-token: write # Required for OIDC steps: - uses: actions/checkout@v4 @@ -61,13 +61,10 @@ jobs: - name: Publish distribution đŸ“Ļ to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: Publish distribution đŸ“Ļ to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} notify-runpod-workers: name: Notify workers diff --git a/.github/workflows/CD-test_publish_to_pypi.yml b/.github/workflows/CD-test_publish_to_pypi.yml index 308522bc..42d7981e 100644 --- a/.github/workflows/CD-test_publish_to_pypi.yml +++ b/.github/workflows/CD-test_publish_to_pypi.yml @@ -11,6 +11,10 @@ jobs: build-n-publish: name: Build and publish Python 🐍 distributions đŸ“Ļ to TestPyPI runs-on: ubuntu-latest + environment: test-release + permissions: + contents: read + id-token: write # Required for OIDC steps: - uses: actions/checkout@v4 @@ -38,5 +42,4 @@ jobs: - name: Publish distribution đŸ“Ļ to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ From 9350ec37fe7f78b02dab4a04225a26e51e23e2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 13:58:35 -0700 Subject: [PATCH 03/12] fix: modernize end-to-end workflow and remove deprecated features - Replace deprecated ::set-output with $GITHUB_OUTPUT - Update Docker actions to v4 (setup-qemu, setup-buildx, login) - Use docker/build-push-action@v6 with GitHub Actions cache - Remove redundant Docker login step - Add Docker layer caching for faster builds --- .github/workflows/CI-e2e.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI-e2e.yml b/.github/workflows/CI-e2e.yml index a08f4f81..137d78b6 100644 --- a/.github/workflows/CI-e2e.yml +++ b/.github/workflows/CI-e2e.yml @@ -33,13 +33,13 @@ jobs: echo "git+https://github.com/runpod/runpod-python.git@$GIT_SHA" > mock-worker/builder/requirements.txt - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -52,16 +52,17 @@ jobs: - name: Set Docker Tag as Output id: output_docker_tag - run: echo "::set-output name=docker_tag::${{ env.DOCKER_TAG }}" + run: echo "docker_tag=${{ env.DOCKER_TAG }}" >> $GITHUB_OUTPUT - name: Build and push Docker image - env: - DOCKERHUB_REPO: ${{ vars.DOCKERHUB_REPO }} - DOCKERHUB_IMG: ${{ vars.DOCKERHUB_IMG }} - run: | - docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} - docker build -t $DOCKERHUB_REPO/$DOCKERHUB_IMG:${{ env.DOCKER_TAG }} -f mock-worker/Dockerfile mock-worker - docker push $DOCKERHUB_REPO/$DOCKERHUB_IMG:${{ env.DOCKER_TAG }} + uses: docker/build-push-action@v6 + with: + context: ./mock-worker + file: ./mock-worker/Dockerfile + push: true + tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ env.DOCKER_TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max test: name: Run End-to-End Tests From eff1d4b498809b07a06d21afe94776d276117b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 13:59:41 -0700 Subject: [PATCH 04/12] ci: improve performance --- .github/workflows/CD-publish_to_pypi.yml | 1 + .github/workflows/CD-test_publish_to_pypi.yml | 1 + .github/workflows/CI-pytests.yml | 1 + .github/workflows/vhs.yml | 7 +++++++ 4 files changed, 10 insertions(+) diff --git a/.github/workflows/CD-publish_to_pypi.yml b/.github/workflows/CD-publish_to_pypi.yml index 49642a03..9e60c0a0 100644 --- a/.github/workflows/CD-publish_to_pypi.yml +++ b/.github/workflows/CD-publish_to_pypi.yml @@ -41,6 +41,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.11.10 + cache: 'pip' - name: Install pypa/build run: >- diff --git a/.github/workflows/CD-test_publish_to_pypi.yml b/.github/workflows/CD-test_publish_to_pypi.yml index 42d7981e..f3064abf 100644 --- a/.github/workflows/CD-test_publish_to_pypi.yml +++ b/.github/workflows/CD-test_publish_to_pypi.yml @@ -22,6 +22,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.11.10 + cache: 'pip' - name: Install pypa/build run: >- diff --git a/.github/workflows/CI-pytests.yml b/.github/workflows/CI-pytests.yml index bc78f6d4..86759f0a 100644 --- a/.github/workflows/CI-pytests.yml +++ b/.github/workflows/CI-pytests.yml @@ -25,6 +25,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install Dependencies run: | diff --git a/.github/workflows/vhs.yml b/.github/workflows/vhs.yml index 9921509f..49f4ebbf 100644 --- a/.github/workflows/vhs.yml +++ b/.github/workflows/vhs.yml @@ -12,8 +12,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + - name: Install runpod run: | + python -m pip install --upgrade pip pip install . # runpod --help From d148eb0cade20c8be3a1dc29c3c375a8575e0ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 14:00:06 -0700 Subject: [PATCH 05/12] ci: upgrade CodeQL to v4 and enable enhanced security scanning - Update github/codeql-action from v3 to v4 - Enable security-extended and security-and-quality queries - Improve vulnerability detection capabilities - Remove commented security query configuration --- .github/workflows/CI-codeql.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI-codeql.yml b/.github/workflows/CI-codeql.yml index aa1e8b56..6bf763db 100644 --- a/.github/workflows/CI-codeql.yml +++ b/.github/workflows/CI-codeql.yml @@ -42,20 +42,15 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + queries: security-extended,security-and-quality # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@v4 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -68,6 +63,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" From 5dea1b0a96a650a5a5a623004bcbeeb750292dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 15:13:51 -0700 Subject: [PATCH 06/12] chore: revert to codeql v3 --- .github/workflows/CI-codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-codeql.yml b/.github/workflows/CI-codeql.yml index 6bf763db..1ce26cfd 100644 --- a/.github/workflows/CI-codeql.yml +++ b/.github/workflows/CI-codeql.yml @@ -42,7 +42,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: security-extended,security-and-quality @@ -50,7 +50,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v4 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -63,6 +63,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" From d7de383904e654abc711efb79f0c1a013ed820a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 19:30:21 -0700 Subject: [PATCH 07/12] chore: revert to docker/login-action v3 --- .github/workflows/CI-e2e.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-e2e.yml b/.github/workflows/CI-e2e.yml index 137d78b6..9c1ec013 100644 --- a/.github/workflows/CI-e2e.yml +++ b/.github/workflows/CI-e2e.yml @@ -33,13 +33,13 @@ jobs: echo "git+https://github.com/runpod/runpod-python.git@$GIT_SHA" > mock-worker/builder/requirements.txt - name: Set up QEMU - uses: docker/setup-qemu-action@v4 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v4 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} From 6f7e1eb5177a974a465c9d5323fe468de3482689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 19:36:33 -0700 Subject: [PATCH 08/12] chore: pytests are failing --- .github/workflows/CI-pytests.yml | 2 +- pytest.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI-pytests.yml b/.github/workflows/CI-pytests.yml index 86759f0a..e9a1636c 100644 --- a/.github/workflows/CI-pytests.yml +++ b/.github/workflows/CI-pytests.yml @@ -15,7 +15,7 @@ jobs: run_tests: strategy: matrix: - python-version: [3.8, 3.9, 3.10.15, 3.11.10] + python-version: [3.8, 3.9, 3.10, 3.11] runs-on: ubuntu-latest steps: diff --git a/pytest.ini b/pytest.ini index 68e2f208..1b234a21 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,4 @@ addopts = --durations=10 --cov-config=.coveragerc --timeout=120 --timeout_method=thread --cov=runpod --cov-report=xml --cov-report=term-missing --cov-fail-under=90 -W error -p no:cacheprovider -p no:unraisableexception python_files = tests.py test_*.py *_test.py norecursedirs = venv *.egg-info .git build +asyncio_mode = auto From 14a66610691d70e466615be10051d669266d1ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 19:38:03 -0700 Subject: [PATCH 09/12] chore: restore python-version --- .github/workflows/CI-pytests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-pytests.yml b/.github/workflows/CI-pytests.yml index e9a1636c..86759f0a 100644 --- a/.github/workflows/CI-pytests.yml +++ b/.github/workflows/CI-pytests.yml @@ -15,7 +15,7 @@ jobs: run_tests: strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, 3.10.15, 3.11.10] runs-on: ubuntu-latest steps: From d89d7e4a1b42fbdf20bf90dad8ed73c148ca90de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 20:02:38 -0700 Subject: [PATCH 10/12] chore: using uv --- .github/workflows/CI-pytests.yml | 16 ++++++++-------- pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI-pytests.yml b/.github/workflows/CI-pytests.yml index 86759f0a..5be856a9 100644 --- a/.github/workflows/CI-pytests.yml +++ b/.github/workflows/CI-pytests.yml @@ -21,16 +21,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' + enable-cache: true + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install '.[test]' + run: uv sync --group test - name: Run Tests - run: pytest + run: uv run pytest diff --git a/pyproject.toml b/pyproject.toml index 30f24c08..abf416c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ version_file = "runpod/_version.py" runpod = "runpod.cli.entry:runpod_cli" -[project.optional-dependencies] +[dependency-groups] test = [ "asynctest", "nest_asyncio", From 0187ef26422f7c56507b513530da332f2202d149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 20:04:21 -0700 Subject: [PATCH 11/12] fix: `raise RuntimeError('Event loop is closed')` --- tests/test_serverless/test_modules/test_fastapi.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/test_serverless/test_modules/test_fastapi.py b/tests/test_serverless/test_modules/test_fastapi.py index a140dc0e..9b27139f 100644 --- a/tests/test_serverless/test_modules/test_fastapi.py +++ b/tests/test_serverless/test_modules/test_fastapi.py @@ -90,7 +90,6 @@ def test_run(self): """ Tests the _run() method. """ - loop = asyncio.get_event_loop() module_location = "runpod.serverless.modules.rp_fastapi" with patch( @@ -133,14 +132,12 @@ def generator_handler(job): ) assert generator_run_return == {"id": "test-123", "status": "IN_PROGRESS"} - loop.close() @pytest.mark.asyncio def test_runsync(self): """ Tests the _runsync() method. """ - loop = asyncio.get_event_loop() module_location = "runpod.serverless.modules.rp_fastapi" with patch(f"{module_location}.FastAPI", Mock()), patch( @@ -195,14 +192,12 @@ def generator_handler(job): asyncio.run(worker_api._sim_runsync(input_object_with_webhook)) assert mock_threading.Thread.called - loop.close() @pytest.mark.asyncio def test_stream(self): """ Tests the _stream() method. """ - loop = asyncio.get_event_loop() module_location = "runpod.serverless.modules.rp_fastapi" with patch(f"{module_location}.FastAPI", Mock()), patch( @@ -260,14 +255,12 @@ def generator_handler(job): asyncio.run(generator_worker_api._sim_stream("test-123")) assert mock_threading.Thread.called - loop.close() @pytest.mark.asyncio def test_status(self): """ Tests the _status() method. """ - loop = asyncio.get_event_loop() module_location = "runpod.serverless.modules.rp_fastapi" with patch(f"{module_location}.FastAPI", Mock()), patch( @@ -332,4 +325,3 @@ def generator_handler(job): error_status_return = asyncio.run(error_worker_api._sim_status("test-123")) assert "error" in error_status_return - loop.close() From bcad8dc6535e16449d2adbffb6c53e5341acdab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20Qui=C3=B1anola?= Date: Wed, 16 Jul 2025 20:07:55 -0700 Subject: [PATCH 12/12] chore: use uv for all python actions --- .github/workflows/CD-publish_to_pypi.yml | 25 ++++++------------- .github/workflows/CD-test_publish_to_pypi.yml | 25 ++++++------------- .github/workflows/vhs.yml | 14 +++++------ CONTRIBUTING.md | 5 ++++ README.md | 8 +++--- 5 files changed, 31 insertions(+), 46 deletions(-) diff --git a/.github/workflows/CD-publish_to_pypi.yml b/.github/workflows/CD-publish_to_pypi.yml index 9e60c0a0..fd6e3714 100644 --- a/.github/workflows/CD-publish_to_pypi.yml +++ b/.github/workflows/CD-publish_to_pypi.yml @@ -37,27 +37,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11.10 - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: 3.11.10 - cache: 'pip' + enable-cache: true - - name: Install pypa/build - run: >- - python -m - pip install - build - --user + - name: Set up Python 3.11.10 + run: uv python install 3.11.10 - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . + - name: Build package + run: uv build - name: Publish distribution đŸ“Ļ to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/CD-test_publish_to_pypi.yml b/.github/workflows/CD-test_publish_to_pypi.yml index f3064abf..390fea0b 100644 --- a/.github/workflows/CD-test_publish_to_pypi.yml +++ b/.github/workflows/CD-test_publish_to_pypi.yml @@ -18,27 +18,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11.10 - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: 3.11.10 - cache: 'pip' + enable-cache: true - - name: Install pypa/build - run: >- - python -m - pip install - build - --user + - name: Set up Python 3.11.10 + run: uv python install 3.11.10 - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . + - name: Build package + run: uv build - name: Publish distribution đŸ“Ļ to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/vhs.yml b/.github/workflows/vhs.yml index 49f4ebbf..ae34d94b 100644 --- a/.github/workflows/vhs.yml +++ b/.github/workflows/vhs.yml @@ -12,16 +12,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: '3.11' - cache: 'pip' + enable-cache: true + + - name: Set up Python 3.11 + run: uv python install 3.11 - name: Install runpod - run: | - python -m pip install --upgrade pip - pip install . + run: uv sync # runpod --help - uses: charmbracelet/vhs-action@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8c35b2f..af0be9cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,6 +35,11 @@ Here is a quick guide on how to contribute code to this project: 6. Run tests to ensure that your changes do not break any existing functionality. You can run tests using the following command: ```bash + # Using uv (recommended - faster) + uv sync --group test + uv run pytest + + # Or using pip pip install '.[test]' pytest ``` diff --git a/README.md b/README.md index 7972eeb6..7a99b693 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ [![CI | End-to-End Runpod Python Tests](https://github.com/runpod/runpod-python/actions/workflows/CI-e2e.yml/badge.svg)](https://github.com/runpod/runpod-python/actions/workflows/CI-e2e.yml) -[![CI | Code Quality](https://github.com/runpod/runpod-python/actions/workflows/CI-pylint.yml/badge.svg)](https://github.com/runpod/runpod-python/actions/workflows/CI-pylint.yml) -  [![CI | Unit Tests](https://github.com/runpod/runpod-python/actions/workflows/CI-pytests.yml/badge.svg)](https://github.com/runpod/runpod-python/actions/workflows/CI-pytests.yml)   [![CI | CodeQL](https://github.com/runpod/runpod-python/actions/workflows/CI-codeql.yml/badge.svg)](https://github.com/runpod/runpod-python/actions/workflows/CI-codeql.yml) @@ -36,10 +34,14 @@ Welcome to the official Python library for Runpod API & SDK. # Install the latest release version pip install runpod -# or +# Using uv (faster alternative) +uv add runpod # Install the latest development version (main branch) pip install git+https://github.com/runpod/runpod-python.git + +# Or with uv +uv add git+https://github.com/runpod/runpod-python.git ``` *Python 3.8 or higher is required to use the latest version of this package.*