From 0159d25e48bce906113a3562790ce868bccc3039 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 13 Dec 2024 13:34:04 +0100 Subject: [PATCH 01/17] chore: add missing dev-deps to pyproject.toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bb457555384..ea9b3777a7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,6 +111,8 @@ develop = [ "pytest-cov", "pytest-mock", "pytest-random-order", + "pytest-timeout", + "pytest-xdist", "pytest", "ruff", "time-machine", From 3295b1c8de86296aa8f8bcade8caab00275f2f8a Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:32:08 +0100 Subject: [PATCH 02/17] chore: try using UV for windows runs --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f42816561e6..4bb4d9f5c31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,6 +267,8 @@ jobs: matrix: os: [ windows-latest ] python-version: ["3.10", "3.11", "3.12"] + env: + UV_SYSTEM_PYTHON: 1 steps: - uses: actions/checkout@v4 @@ -275,15 +277,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + python-version-file: ".python-version" + + - name: Install uv + uses: astral-sh/setup-uv@v4 - - name: Pip cache (Windows) - uses: actions/cache@v4 - with: - path: ~\AppData\Local\pip\Cache - key: pip-${{ matrix.os }}-${{ matrix.python-version }} - name: Installation run: | + Set-Alias -name pip -value "uv pip" ./build_helpers/install_windows.ps1 - name: Tests From 6963141eb88edfc3e395d2066eb92e2b403669e6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:36:01 +0100 Subject: [PATCH 03/17] chore: fix aliasing --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bb4d9f5c31..53e370ab6ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,7 +285,8 @@ jobs: - name: Installation run: | - Set-Alias -name pip -value "uv pip" + function uvpipFunction { uv pip $args } + Set-Alias -name pip -value uvpipFunction ./build_helpers/install_windows.ps1 - name: Tests From aa8e504ef7df1f0d8c024e26c2376b9683fa54a3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:39:25 +0100 Subject: [PATCH 04/17] chore: remove non-existing UV argument --- build_helpers/install_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index 4aa070992c1..fa7d66e2360 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -5,7 +5,7 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" -pip install --find-links=build_helpers\ --prefer-binary TA-Lib +pip install --find-links=build_helpers\ TA-Lib pip install -r requirements-dev.txt pip install -e . From 7d1ac0248bb3468694cf68ab0e9dd3b5929b9251 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:48:04 +0100 Subject: [PATCH 05/17] chore: only binary ... --- build_helpers/install_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index fa7d66e2360..820b9a9511d 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -5,7 +5,7 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" -pip install --find-links=build_helpers\ TA-Lib +pip install --find-links=build_helpers\ --only-binary TA-Lib pip install -r requirements-dev.txt pip install -e . From c1be014499f097d6da775eafa33dc35545afa7f6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:51:02 +0100 Subject: [PATCH 06/17] chore: package name lowercase ?? --- build_helpers/install_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index 820b9a9511d..2a284d25356 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -5,7 +5,7 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" -pip install --find-links=build_helpers\ --only-binary TA-Lib +pip install --find-links=build_helpers\ --only-binary ta-lib pip install -r requirements-dev.txt pip install -e . From 569ac2bc5b0667000a5fe8699cfa0d9e252e7df6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 21:59:41 +0100 Subject: [PATCH 07/17] chore: move uv work --- build_helpers/install_windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index 2a284d25356..dca641757c9 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -4,8 +4,8 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" - -pip install --find-links=build_helpers\ --only-binary ta-lib +pip install -U wheel +pip install --find-links=build_helpers\ ta-lib pip install -r requirements-dev.txt pip install -e . From 8f617d01d444349b3900423c414a01c2d8a0bf9d Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 22:11:56 +0100 Subject: [PATCH 08/17] chore: further uv tests --- .github/workflows/ci.yml | 1 - build_helpers/install_windows.ps1 | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53e370ab6ff..d7492a659f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -282,7 +282,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v4 - - name: Installation run: | function uvpipFunction { uv pip $args } diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index dca641757c9..bea9725f101 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -4,8 +4,8 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" -pip install -U wheel -pip install --find-links=build_helpers\ ta-lib +pip install -U wheel "numpy<2" +pip install --no-build --find-links=build_helpers\ ta-lib pip install -r requirements-dev.txt pip install -e . From 8cd03c962486af77a41ded3c009c6ecc11d07757 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 22:30:11 +0100 Subject: [PATCH 09/17] chore: uv - enable cache --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7492a659f9..35fa07dfa4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,6 +281,9 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + - name: Installation run: | From 30909d13ba44df43ead0afd1c2b03469baf0ee3b Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 22:31:37 +0100 Subject: [PATCH 10/17] chore: uv: glob --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35fa07dfa4c..54f6da930db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,7 +283,7 @@ jobs: uses: astral-sh/setup-uv@v4 with: enable-cache: true - + cache-dependency-glob: "requirements**.txt" - name: Installation run: | From f378e107525b343796b65e100e01ac6c6fda34af Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 22:49:22 +0100 Subject: [PATCH 11/17] chore: link mode copy --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54f6da930db..330fda6f81b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,6 +269,7 @@ jobs: python-version: ["3.10", "3.11", "3.12"] env: UV_SYSTEM_PYTHON: 1 + UV_LINK_MODE: copy steps: - uses: actions/checkout@v4 From f978a5c754aea9da84db83b496e8348abcc83098 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 23:09:00 +0100 Subject: [PATCH 12/17] chore: uv - different caching --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 330fda6f81b..1430cb64e92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,7 +284,9 @@ jobs: uses: astral-sh/setup-uv@v4 with: enable-cache: true - cache-dependency-glob: "requirements**.txt" + # cache-dependency-glob: "requirements**.txt" + cache-suffix: "${{ matrix.python-version }}" + prune-cache: false - name: Installation run: | From 4f318a5981181ff3b30e4680ea0c3304336432a8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Dec 2024 23:10:16 +0100 Subject: [PATCH 13/17] chore: uv - different caching --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1430cb64e92..fb1aaaaff66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,7 +284,7 @@ jobs: uses: astral-sh/setup-uv@v4 with: enable-cache: true - # cache-dependency-glob: "requirements**.txt" + cache-dependency-glob: "requirements**.txt" cache-suffix: "${{ matrix.python-version }}" prune-cache: false From 3a6ef8c34b7587e9b49988aee4209f7ca92feb58 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 13 Dec 2024 08:00:05 +0100 Subject: [PATCH 14/17] chore: use link mode for UV installs --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb1aaaaff66..e85742ad8f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,7 +269,7 @@ jobs: python-version: ["3.10", "3.11", "3.12"] env: UV_SYSTEM_PYTHON: 1 - UV_LINK_MODE: copy + UV_LINK_MODE: hardlink steps: - uses: actions/checkout@v4 From 219e6b420e3a85a17f537cd86fca46004b418a1e Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 13 Dec 2024 08:13:26 +0100 Subject: [PATCH 15/17] chore: Try using uv venv creation --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e85742ad8f6..bf3aa48624f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,7 +278,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - python-version-file: ".python-version" - name: Install uv uses: astral-sh/setup-uv@v4 @@ -290,6 +289,8 @@ jobs: - name: Installation run: | + uv venv + .venv\Scripts\activate function uvpipFunction { uv pip $args } Set-Alias -name pip -value uvpipFunction ./build_helpers/install_windows.ps1 From f11fe14cddcbf986043df2a1f3919dc7004d9c3c Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 13 Dec 2024 12:27:21 +0100 Subject: [PATCH 16/17] chore: remove system mode, set path globally --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf3aa48624f..16f3df9a252 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,9 +267,6 @@ jobs: matrix: os: [ windows-latest ] python-version: ["3.10", "3.11", "3.12"] - env: - UV_SYSTEM_PYTHON: 1 - UV_LINK_MODE: hardlink steps: - uses: actions/checkout@v4 @@ -291,6 +288,9 @@ jobs: run: | uv venv .venv\Scripts\activate + # persist the venv path for future steps + "$(pwd)/.venv/Scripts" >> $env:GITHUB_PATH + function uvpipFunction { uv pip $args } Set-Alias -name pip -value uvpipFunction ./build_helpers/install_windows.ps1 From cc7b1a5642d761b7793713ed911a1de11c57b4fc Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 13 Dec 2024 13:30:36 +0100 Subject: [PATCH 17/17] chore: clean up install_windows call --- build_helpers/install_windows.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index bea9725f101..228a2ca23d7 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -1,8 +1,7 @@ # vendored Wheels compiled via https://github.com/xmatthias/ta-lib-python/tree/ta_bundled_040 -python -m pip install --upgrade pip wheel - -$pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" +python -m pip install --upgrade pip +python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" pip install -U wheel "numpy<2" pip install --no-build --find-links=build_helpers\ ta-lib