From 2faba5a39e369c75028da0b9fa84c05a137b7d67 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:00:53 -0500 Subject: [PATCH 01/16] Create tests.yml --- .github/workflows/tests.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..eb72d79 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,33 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest git+https://github.com/ultralytics/ultralytics.git@main + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with pytest + run: | + pytest From 1d3e7684460468707dfa2597df0f4cb203d1bffd Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:16:41 -0500 Subject: [PATCH 02/16] checking directories --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb72d79..2a40359 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,13 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest git+https://github.com/ultralytics/ultralytics.git@main if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Check docs location + run: | + python -c " + from ultralytics import ASSETS + print((ASSETS.parent / "docs").exists()) + _ = [print(a) for a in ASSETS.iterdir()] + " - name: Test with pytest run: | pytest From f703560748d89cfbe8f05adb605ce60b0ea55d77 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:19:38 -0500 Subject: [PATCH 03/16] remove indents --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2a40359..8994f3d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,10 +31,10 @@ jobs: - name: Check docs location run: | python -c " - from ultralytics import ASSETS - print((ASSETS.parent / "docs").exists()) - _ = [print(a) for a in ASSETS.iterdir()] - " + from ultralytics import ASSETS + print((ASSETS.parent / "docs").exists()) + _ = [print(a) for a in ASSETS.iterdir()] + " - name: Test with pytest run: | pytest From d4c7272ac202b7b15487aa8efadabdf1166e73db Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:22:13 -0500 Subject: [PATCH 04/16] fix quotes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8994f3d..3c712af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: run: | python -c " from ultralytics import ASSETS - print((ASSETS.parent / "docs").exists()) + print((ASSETS.parent / 'docs').exists()) _ = [print(a) for a in ASSETS.iterdir()] " - name: Test with pytest From 1259f2420927bd2bea201f0f2afa338c8e2a86f0 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:26:04 -0500 Subject: [PATCH 05/16] update parent --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c712af..845a8d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,8 +32,8 @@ jobs: run: | python -c " from ultralytics import ASSETS - print((ASSETS.parent / 'docs').exists()) - _ = [print(a) for a in ASSETS.iterdir()] + print((ASSETS.parent.parent / 'docs').exists()) + _ = [print(a) for a in ASSETS.parent.parent.iterdir()] " - name: Test with pytest run: | From 2994eb36d42f1edb74097054984e506885d7809f Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:34:55 -0500 Subject: [PATCH 06/16] update directories add git clone --- .github/workflows/tests.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 845a8d3..479663c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,17 +23,21 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" + - name: View directories + run: ls -lah - name: Install dependencies run: | + git clone https://github.com/ultralytics/ultralytics.git python -m pip install --upgrade pip - pip install flake8 pytest git+https://github.com/ultralytics/ultralytics.git@main + pip install flake8 pytest + pip install -e .ultralytics if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Check docs location run: | python -c " from ultralytics import ASSETS - print((ASSETS.parent.parent / 'docs').exists()) - _ = [print(a) for a in ASSETS.parent.parent.iterdir()] + print((ASSETS.parent / 'docs').exists()) + _ = [print(a) for a in ASSETS.parent.iterdir()] " - name: Test with pytest run: | From 9ac7ee41131c5cbc2e439161114af9b1ddbf9940 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:36:19 -0500 Subject: [PATCH 07/16] update editable install --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 479663c..28d6f45 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: git clone https://github.com/ultralytics/ultralytics.git python -m pip install --upgrade pip pip install flake8 pytest - pip install -e .ultralytics + pip install -e ./ultralytics if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Check docs location run: | From 78c672dd237c3440abd0f424e432a875e5123eb6 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:41:42 -0500 Subject: [PATCH 08/16] skip install and only check directories --- .github/workflows/tests.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28d6f45..00e9444 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,15 +30,10 @@ jobs: git clone https://github.com/ultralytics/ultralytics.git python -m pip install --upgrade pip pip install flake8 pytest - pip install -e ./ultralytics + # pip install -e ./ultralytics if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Check docs location - run: | - python -c " - from ultralytics import ASSETS - print((ASSETS.parent / 'docs').exists()) - _ = [print(a) for a in ASSETS.parent.iterdir()] - " + run: ls -lah && cd ultralytics && ls -lah - name: Test with pytest run: | pytest From e842449b438b0c928132efa5f9c708123969b27e Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:56:49 -0500 Subject: [PATCH 09/16] try changing git clone location --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 00e9444..90f319c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,10 +24,12 @@ jobs: with: python-version: "3.10" - name: View directories - run: ls -lah + run: PATH=cwd && ls -lah - name: Install dependencies run: | + cd .. git clone https://github.com/ultralytics/ultralytics.git + cd $PATH python -m pip install --upgrade pip pip install flake8 pytest # pip install -e ./ultralytics From fe138925da08b4524da7ad9f1038275ff7c126c0 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:00:38 -0500 Subject: [PATCH 10/16] try setting bash var with quotes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 90f319c..bfba384 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: with: python-version: "3.10" - name: View directories - run: PATH=cwd && ls -lah + run: PATH="$cwd" && ls -lah - name: Install dependencies run: | cd .. From 9b23563435f14b9f7be390f5127e306d9880ebf4 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:02:18 -0500 Subject: [PATCH 11/16] multiline --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bfba384..517d8af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,9 @@ jobs: with: python-version: "3.10" - name: View directories - run: PATH="$cwd" && ls -lah + run: | + echo cwd + echo ls -lah - name: Install dependencies run: | cd .. From 2f32116155a290344e06391b8fb26532f1ad66c9 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:03:41 -0500 Subject: [PATCH 12/16] okay set var and then show and reuse --- .github/workflows/tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 517d8af..acf69c3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,16 +25,17 @@ jobs: python-version: "3.10" - name: View directories run: | - echo cwd - echo ls -lah + DIR=cwd + echo $DIR + ls -lah - name: Install dependencies run: | cd .. git clone https://github.com/ultralytics/ultralytics.git - cd $PATH + cd $DIR python -m pip install --upgrade pip pip install flake8 pytest - # pip install -e ./ultralytics + # pip install -e ../ultralytics if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Check docs location run: ls -lah && cd ultralytics && ls -lah From 48a4d2b43d39cba034a553941b8c50da802e32ec Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:09:57 -0500 Subject: [PATCH 13/16] fix setting bash var --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index acf69c3..8c9100c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: python-version: "3.10" - name: View directories run: | - DIR=cwd + DIR=$(cwd) echo $DIR ls -lah - name: Install dependencies From 7a73575807e9bc277770b914e4c41fedd6c2b3b0 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:10:36 -0500 Subject: [PATCH 14/16] cwd --> pwd --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c9100c..2260714 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: python-version: "3.10" - name: View directories run: | - DIR=$(cwd) + DIR=$(pwd) echo $DIR ls -lah - name: Install dependencies From bb1d173ceb5b618773f05cdcaf471feb848ef5a2 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:24:06 -0500 Subject: [PATCH 15/16] clean up and add `uv` --- .github/workflows/tests.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2260714..e3b5fa3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,26 +19,20 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" - - name: View directories - run: | - DIR=$(pwd) - echo $DIR - ls -lah - name: Install dependencies + shell: bash # for Windows compatibility run: | - cd .. - git clone https://github.com/ultralytics/ultralytics.git + DIR=$(pwd) + cd .. && git clone https://github.com/ultralytics/ultralytics.git + # ULTRA_DOCS="$(pwd)/ultralytics/docs" cd $DIR - python -m pip install --upgrade pip - pip install flake8 pytest - # pip install -e ../ultralytics + uv pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Check docs location - run: ls -lah && cd ultralytics && ls -lah - name: Test with pytest run: | pytest From cfa9927c11305ebdc819d86a4d4b74bcbd526f70 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:25:09 -0500 Subject: [PATCH 16/16] include `--system` flag for `uv` install --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3b5fa3..acf78f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: cd .. && git clone https://github.com/ultralytics/ultralytics.git # ULTRA_DOCS="$(pwd)/ultralytics/docs" cd $DIR - uv pip install flake8 pytest + uv pip install --system flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: |