diff --git a/.github/workflows/python-linter.yml b/.github/workflows/python-linter.yml index 9e99651f..24b524cd 100644 --- a/.github/workflows/python-linter.yml +++ b/.github/workflows/python-linter.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: "๐Ÿ”Ž Python Linter" on: @@ -10,26 +7,22 @@ on: branches: ["main"] jobs: - build: + lint: runs-on: ubuntu-latest - strategy: - fail-fast: false steps: - name: "โณ Checkout repository" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "๐Ÿ Set up Python" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: cache: "pip" + cache-dependency-path: pyproject.toml python-version: "3.10" - name: "๐Ÿ›  Install dependencies" - run: | - pip install -r .github/workflows/requirements.txt - ruff --version - pytest --version + run: python3 -m pip install -e ".[dev]" - name: "๐Ÿ˜พ Lint with ruff" - run: ruff check + run: make lint diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt deleted file mode 100644 index 2eac7076..00000000 --- a/.github/workflows/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ - - - -ruff==0.11.6 -pytest==7.4.0 -pyyaml==6.0.2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fedf718..b0d3613a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,25 +9,23 @@ on: jobs: mock-tests: runs-on: ubuntu-latest - strategy: - fail-fast: false steps: - name: "โณ Checkout repository" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "๐Ÿ Set up Python" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: cache: "pip" + cache-dependency-path: pyproject.toml python-version: "3.10" - name: "๐Ÿ›  Install dependencies" - run: | - pip install -r .github/workflows/requirements.txt + run: python3 -m pip install -e ".[dev,test]" - name: "๐Ÿงช Run mock tests" - run: python -m pytest tests/ -v -k mock + run: make test-mock - name: "๐Ÿ“‹ Validate examples" - run: python -m pytest tests/test_examples.py -v + run: make test-examples diff --git a/pyproject.toml b/pyproject.toml index 7f3f1443..73efd5c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=64"] +build-backend = "setuptools.build_meta" + [project] name = "micropython-steami-lib" version = "0.1.0" @@ -6,8 +10,12 @@ license = {text = "GPL-3.0-or-later"} requires-python = ">=3.7" [project.optional-dependencies] -dev = ["ruff>=0.9"] -test = ["pytest>=7.0", "pyyaml>=6.0", "mpremote>=1.0"] +dev = ["ruff==0.11.6"] +test = ["pytest==7.4.0", "pyyaml==6.0.2", "mpremote>=1.0"] + +[tool.setuptools] +# No Python packages to install โ€” this project contains MicroPython drivers +packages = [] [project.urls] Homepage = "https://www.steami.cc/" diff --git a/tests/requirements-test.txt b/tests/requirements-test.txt deleted file mode 100644 index 9b2ac3c3..00000000 --- a/tests/requirements-test.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=7.0 -pyyaml>=6.0 -mpremote>=1.0