From 7d13a4a05420e10013e083efe41a3ea1d256dc59 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 18 Jan 2025 16:30:06 +0300 Subject: [PATCH] ci: fix venv activation ci: specify Python version in venv ci: adjust python handling ci: install uv via curl --- .github/workflows/github-ci.yml | 18 +++++++++++------- .python-version | 1 + pyproject.toml | 3 ++- uv.lock | 11 +++++++++++ 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 .python-version diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index 651e7aa..05b6482 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -30,16 +30,20 @@ jobs: with: submodules: recursive - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.12" + - name: Install uv + run: | + uv_version=$(cat ./requirement-uv.txt | awk -F'==' '{print $2}' | tr -d ' \n') + curl -LsSf https://astral.sh/uv/${uv_version}/install.sh | sh + + - name: Record original PATH + id: record_original_path + run: echo "PATH_ORIGINAL=$PATH" >> $GITHUB_OUTPUT - name: Activate .venv run: | - python3 -m pip install -r requirement-uv.txt uv sync --frozen --no-install-project - source .venv/bin/activate + . .venv/bin/activate + echo PATH=${GITHUB_WORKSPACE}/.venv/bin:$PATH >> $GITHUB_ENV - name: Build And Assemble run: | @@ -56,7 +60,7 @@ jobs: if-no-files-found: "error" - name: Deactivate .venv - run: deactivate + run: echo PATH=${{ steps.record_original_path.outputs.PATH_ORIGINAL }} release: runs-on: ubuntu-latest diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..c10780c --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13.1 diff --git a/pyproject.toml b/pyproject.toml index 4d3818b..4cf6a53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,8 @@ dependencies = [ "requests ~=2.31", "pathlib ~=1.0", "typing ~=3.7", - "pydantic ~=2.6" + "pydantic ~=2.6", + "pip" ] [project.urls] diff --git a/uv.lock b/uv.lock index c07eba3..12f3171 100644 --- a/uv.lock +++ b/uv.lock @@ -352,6 +352,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1d/44/6a65ecd630393d47ad3e7d5354768cb7f9a10b3a0eb2cd8c6f52b28211ee/pbr-6.1.0-py2.py3-none-any.whl", hash = "sha256:a776ae228892d8013649c0aeccbb3d5f99ee15e005a4cbb7e61d55a067b28a2a", size = 108529 }, ] +[[package]] +name = "pip" +version = "24.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f4/b1/b422acd212ad7eedddaf7981eee6e5de085154ff726459cf2da7c5a184c1/pip-24.3.1.tar.gz", hash = "sha256:ebcb60557f2aefabc2e0f918751cd24ea0d56d8ec5445fe1807f1d2109660b99", size = 1931073 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/7d/500c9ad20238fcfcb4cb9243eede163594d7020ce87bd9610c9e02771876/pip-24.3.1-py3-none-any.whl", hash = "sha256:3790624780082365f47549d032f3770eeb2b1e8bd1f7b2e02dace1afa361b4ed", size = 1822182 }, +] + [[package]] name = "platformdirs" version = "4.3.6" @@ -674,6 +683,7 @@ dependencies = [ { name = "argparse" }, { name = "conan" }, { name = "pathlib" }, + { name = "pip" }, { name = "pydantic" }, { name = "requests" }, { name = "typing" }, @@ -694,6 +704,7 @@ requires-dist = [ { name = "argparse" }, { name = "conan", specifier = "~=1.6" }, { name = "pathlib", specifier = "~=1.0" }, + { name = "pip" }, { name = "pydantic", specifier = "~=2.6" }, { name = "requests", specifier = "~=2.31" }, { name = "typing", specifier = "~=3.7" },