From 1d5de2f412f74c9487bd2714202df8e1b776c448 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 13:48:25 -0400 Subject: [PATCH 01/16] Add a test workflow --- .github/workflows/test.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..574649f6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: test-wf +on: pull_request +jobs: + test-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get install chromium-browser + - name: Install devtools + run: pip install . numpy + - name: test1 + run: pytest + - name: test2 + run: python app/test1.py + - name: diagnost + run: devtools_doctor From c59292964a5a9dcb633f900951bd5e90cff07dbc Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:09:24 -0400 Subject: [PATCH 02/16] Fix up test.yml for syntax/github stuff --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 574649f6..add19bec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,13 +5,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v1 - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools - run: pip install . numpy + run: pip install --user .[dev] numpy + - name: diagnostic + run: devtools-doctor - name: test1 run: pytest - name: test2 - run: python app/test1.py - - name: diagnost - run: devtools_doctor + run: python app/test1.py From 1d94e6a83becebec19e6938ebda586a1cf1e0e22 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:28:58 -0400 Subject: [PATCH 03/16] Remove circle-ci config --- .circleci/config.yml | 70 -------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5b8885b7..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: 2.1 - -orbs: - win: circleci/windows@5.0 - -commands: # all jobs/workflows use same commands - diagnostic: - steps: - - run: - name: install_devtools - command: pip install . numpy - - run: - name: first_test - command: python ./app/test1.py - -jobs: - linux-docker: # similiar to the one below us - docker: # machine specifies a linux vm, can we just use docker for the pull? - - image: cimg/python:3.12.3 - resource_class: small - steps: - - checkout - - run: - name: install_chrome - command: sudo apt-get update && sudo apt-get install chromium-browser - - diagnostic - - windows-x64: - executor: - name: win/default - steps: - - checkout - - run: - name: install_chrome - command: choco install googlechrome -y --ignore-checksums - - diagnostic - - osx: - macos: # indicate that we are using the macOS executor - xcode: 15.4.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - run: - name: install_chrome - command: brew install google-chrome - - diagnostic - -workflows: - 1-arch-3-os: # this workflow will do mac, linux, and windows without arch xcompile - jobs: - - hold: - type: approval - - linux-docker: - requires: - - hold - - windows-x64: - requires: - - hold - - osx: - requires: - - hold - cheap_test: - jobs: - - hold: - type: approval - - linux-docker: - requires: - - hold - From 7f3817426a437287bd0a9fc54f839de85fd1c97f Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:34:50 -0400 Subject: [PATCH 04/16] Update diagnose --- devtools/browser.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/devtools/browser.py b/devtools/browser.py index 2a2f20d8..64418cb0 100644 --- a/devtools/browser.py +++ b/devtools/browser.py @@ -542,10 +542,8 @@ def diagnose(): print(which_browser()) print("Running a very simple test...") try: - import pip - print(pip.get_installed_distributions()) - except ImportError: - print("No pip installed for getting version") + import subprocess, sys # noqa + print(subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])) finally: pass async def test(): From 8d8200f78f58a6d84e1e85b0a55793f69962d7f7 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:39:44 -0400 Subject: [PATCH 05/16] Add placeholder test --- tests/placeholder.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/placeholder.py diff --git a/tests/placeholder.py b/tests/placeholder.py new file mode 100644 index 00000000..201975fc --- /dev/null +++ b/tests/placeholder.py @@ -0,0 +1,2 @@ +def test_placeholder(): + pass From fd12b59ab039261eba3bb765ec32ef28d0674a6c Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:40:44 -0400 Subject: [PATCH 06/16] Fix placeholder test naming --- tests/{placeholder.py => test_placeholder.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{placeholder.py => test_placeholder.py} (100%) diff --git a/tests/placeholder.py b/tests/test_placeholder.py similarity index 100% rename from tests/placeholder.py rename to tests/test_placeholder.py From 4a0768e97482ffe525206c5dc31830cfc5a2d546 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:50:00 -0400 Subject: [PATCH 07/16] Add other OSes to GHA --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index add19bec..0b64e103 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,3 +16,33 @@ jobs: run: pytest - name: test2 run: python app/test1.py + test-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v1 + - name: Install Dependencies + run: choco install googlechrome -y --ignore-checksums + - name: Install devtools + run: pip install --user .[dev] numpy + - name: diagnostic + run: devtools-doctor + - name: test1 + run: pytest + - name: test2 + run: python app/test1.py + test-mac: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v1 + - name: Install Dependencies + run: macos-latest + - name: Install devtools + run: pip install --user .[dev] numpy + - name: diagnostic + run: devtools-doctor + - name: test1 + run: pytest + - name: test2 + run: python app/test1.py From 4567028212820226f875acfb2a89d85dbe8aa4cf Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:53:16 -0400 Subject: [PATCH 08/16] Add git describe to diagnose --- devtools/browser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/browser.py b/devtools/browser.py index 64418cb0..cbaabaca 100644 --- a/devtools/browser.py +++ b/devtools/browser.py @@ -544,6 +544,7 @@ def diagnose(): try: import subprocess, sys # noqa print(subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])) + print(subprocess.check_output(["git", "describe", "--all", "--tags", "--long", "--always",])) finally: pass async def test(): From d5eaa4fd92e57ae5153f78c07c88735ee9dc8f1b Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:54:45 -0400 Subject: [PATCH 09/16] Fixup typo in gha --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b64e103..f6417f0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,12 +32,12 @@ jobs: - name: test2 run: python app/test1.py test-mac: - runs-on: windows-latest + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v1 - name: Install Dependencies - run: macos-latest + run: brew install google-chrome - name: Install devtools run: pip install --user .[dev] numpy - name: diagnostic From 552e0ff929ae6c5d549c0183e0cd7b6c0e2f59b1 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 14:58:46 -0400 Subject: [PATCH 10/16] Upgrade actions/python --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6417f0c..72cbf994 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools @@ -20,7 +20,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 - name: Install Dependencies run: choco install googlechrome -y --ignore-checksums - name: Install devtools @@ -35,7 +35,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 - name: Install Dependencies run: brew install google-chrome - name: Install devtools From 7a7b91c4b8e8d012e40b24dc502895a03ef27828 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 15:04:42 -0400 Subject: [PATCH 11/16] Try removing --user to make bin path work --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72cbf994..a096c958 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools - run: pip install --user .[dev] numpy + run: pip install .[dev] numpy - name: diagnostic run: devtools-doctor - name: test1 @@ -24,7 +24,7 @@ jobs: - name: Install Dependencies run: choco install googlechrome -y --ignore-checksums - name: Install devtools - run: pip install --user .[dev] numpy + run: pip install .[dev] numpy - name: diagnostic run: devtools-doctor - name: test1 @@ -39,7 +39,7 @@ jobs: - name: Install Dependencies run: brew install google-chrome - name: Install devtools - run: pip install --user .[dev] numpy + run: pip install .[dev] numpy - name: diagnostic run: devtools-doctor - name: test1 From 22d754e701a1af002ec30836cde5ec9419ec1b7c Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 15:07:38 -0400 Subject: [PATCH 12/16] Add --user back just for linux --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a096c958..f280d18e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools - run: pip install .[dev] numpy + run: pip install --user .[dev] numpy - name: diagnostic run: devtools-doctor - name: test1 From 0798aa492fd734a5e9efbb76e5f37e7b994223d2 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 15:12:07 -0400 Subject: [PATCH 13/16] Test linux explicitly- regression --- .github/workflows/test.yml | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f280d18e..f930d531 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,37 +9,7 @@ jobs: - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools - run: pip install --user .[dev] numpy - - name: diagnostic - run: devtools-doctor - - name: test1 - run: pytest - - name: test2 - run: python app/test1.py - test-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install Dependencies - run: choco install googlechrome -y --ignore-checksums - - name: Install devtools - run: pip install .[dev] numpy - - name: diagnostic - run: devtools-doctor - - name: test1 - run: pytest - - name: test2 - run: python app/test1.py - test-mac: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install Dependencies - run: brew install google-chrome - - name: Install devtools - run: pip install .[dev] numpy + run: ls && pip install .[dev] numpy - name: diagnostic run: devtools-doctor - name: test1 From 48c221321c04d2dfdbffb2d111c306bc4bbd7880 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Thu, 26 Sep 2024 15:20:33 -0400 Subject: [PATCH 14/16] Put linux python to v1 gha --- .github/workflows/test.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f930d531..a8fd0bc6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v1 - name: Install Dependencies run: sudo apt-get update && sudo apt-get install chromium-browser - name: Install devtools @@ -16,3 +16,33 @@ jobs: run: pytest - name: test2 run: python app/test1.py + test-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install Dependencies + run: choco install googlechrome -y --ignore-checksums + - name: Install devtools + run: pip install .[dev] numpy + - name: diagnostic + run: devtools-doctor + - name: test1 + run: pytest + - name: test2 + run: python app/test1.py + test-mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install Dependencies + run: brew install google-chrome + - name: Install devtools + run: pip install .[dev] numpy + - name: diagnostic + run: devtools-doctor + - name: test1 + run: pytest + - name: test2 + run: python app/test1.py From 7491b7163bdb64999645182a99468850b1647831 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Fri, 27 Sep 2024 11:25:05 -0400 Subject: [PATCH 15/16] Add python version to devtools-doctor --- devtools/browser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devtools/browser.py b/devtools/browser.py index cbaabaca..a0eb9cd0 100644 --- a/devtools/browser.py +++ b/devtools/browser.py @@ -545,6 +545,8 @@ def diagnose(): import subprocess, sys # noqa print(subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])) print(subprocess.check_output(["git", "describe", "--all", "--tags", "--long", "--always",])) + print(sys.version) + print(sys.version_info) finally: pass async def test(): From 7aa90fab3371de2131091cd02fa9dff3aac117a5 Mon Sep 17 00:00:00 2001 From: Andrew Pikul Date: Fri, 27 Sep 2024 11:26:06 -0400 Subject: [PATCH 16/16] Change name of devtools-doctor to dtdoctor --- .github/workflows/test.yml | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8fd0bc6..38cfb696 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - name: Install devtools run: ls && pip install .[dev] numpy - name: diagnostic - run: devtools-doctor + run: dtdoctor - name: test1 run: pytest - name: test2 @@ -26,7 +26,7 @@ jobs: - name: Install devtools run: pip install .[dev] numpy - name: diagnostic - run: devtools-doctor + run: dtdoctor - name: test1 run: pytest - name: test2 @@ -41,7 +41,7 @@ jobs: - name: Install devtools run: pip install .[dev] numpy - name: diagnostic - run: devtools-doctor + run: dtdoctor - name: test1 run: pytest - name: test2 diff --git a/pyproject.toml b/pyproject.toml index 0fd615b8..4c607a67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ dev = [ ] [project.scripts] -devtools-doctor = "devtools.browser:diagnose" +dtdoctor = "devtools.browser:diagnose" [tool.ruff.lint] ignore = ["E701"]