Repository: PyBites-Open-Source/pybites-carbon (language: python)

Issue:
Feature treat driver path as option
Hi there,

I just wanted to show it is possible to treat the driver path like this, which:
* now it is the responsibility of the argparse to check for the existence of DRIVER_PATH
*  (Maybe) it will be also easier to make this project work with other webdriver, in the future.


Discussion / hints:
nice, thanks @GreatBahram 
@GreatBahram shall we start use the develop branch for this? Would need to set it up as default branch somewhere I believe ...
FYI updating .env-template and README to use the renamed env variable `DRIVER_PATH`, also fixing this test that broke (thanks GH Actions): https://github.com/PyBites-Open-Source/pybites-carbon/runs/3660790462?check_suite_focus=true
> @GreatBahram shall we start use the develop branch for this? Would need to set it up as default branch somewhere I believe ...

Sounds great to me, though it sometimes makes the workflow for a small project more complicated than it should be.
But, overall, it is good to have a separate branch for merging feature branches without messing with the release branch.
> FYI updating .env-template and README to use the renamed env variable `DRIVER_PATH`, also fixing this test that broke (thanks GH Actions): https://github.com/PyBites-Open-Source/pybites-carbon/runs/3660790462?check_suite_focus=true

I wasn't aware of those places! Should I address these problems in this branch? or another one?
I am happy to go with main only for now. No worries I will commit those fixes on main for now, bit busy with meetings and I want to try to automate the upload to PyPI when we add a new tag ...

Fix patch:
diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml
index d4b5603..3c418a6 100644
--- a/.github/workflows/python-app.yml
+++ b/.github/workflows/python-app.yml
@@ -8,6 +8,7 @@ on:
     branches:
       - main
       - develop
+      - development
   pull_request:
     branches:
       - develop
@@ -18,22 +19,29 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Set up Python 3.9
-      uses: actions/setup-python@v2
+    - uses: actions/checkout@v4
+
+    - name: Set up Python 3.10
+      uses: actions/setup-python@v5
+      with:
+        python-version: "3.10"
+
+    - name: Install uv
+      uses: astral-sh/setup-uv@v3
       with:
-        python-version: 3.9
+        version: "0.5.1"
+
     - name: Install dependencies
       run: |
         sudo apt update && sudo apt install tesseract-ocr libtesseract-dev
-        python -m pip install --upgrade pip
-        pip install -r requirements-dev.txt
-    - name: Lint with flake8
-      run: |
-        # stop the build if there are Python syntax errors or undefined names
-        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
-        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
-        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+        uv sync --all-extras --dev
+
+    - name: Run Ruff
+      run: uv run ruff check --output-format=github .
+
+    - name: Ensure browsers are installed for playwright
+      run: uv run playwright install --with-deps chromium
+
     - name: Test with pytest
       run: |
-        pytest
+        uv run pytest
diff --git a/pyproject.toml b/pyproject.toml
index 6876937..c76a033 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -22,7 +22,7 @@ dev-dependencies = [
 ]
 
 [tool.ruff.lint]
-select = ["E4", "E7", "E9", "F", "I"]
+select = ["E4", "E7", "E9", "F", "B", "I"]
 ignore = ["E501"]
 
 [tool.mypy]


Test patch:
diff --git a/tests/test_carbon.py b/tests/test_carbon.py
index bc10375..3450d9b 100644
--- a/tests/test_carbon.py
+++ b/tests/test_carbon.py
@@ -1,5 +1,5 @@
-from pathlib import Path
 import re
+from pathlib import Path
 
 import pytesseract
 import pytest