From 6ee7406da58bbe6dac86e65072e216f912edd6be Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Fri, 29 Nov 2024 12:08:07 +1100 Subject: [PATCH] Use PEP 735 dependency groups while linting in CI --- .github/workflows/lint.yaml | 71 ++++++++----------------------------- 1 file changed, 14 insertions(+), 57 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 336f322d5..15df346e4 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -15,72 +15,29 @@ on: - '!contrib/**' jobs: - pylint: + lint: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] - name: Pylint - steps: - - name: checkout git - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: true - python-version: ${{ matrix.python-version }} - conda-channels: anaconda, conda-forge - - name: run pylint - run: | - sudo apt-get remove python3-openssl - pip install --upgrade -e '.[test]' - pip install pylint>3.2 - pylint -j 2 --reports no datacube - + python-version: ["3.12"] + lint-command: + - "pylint --j 2 --reports no datacube" + - "--group types mypy datacube" + - "pycodestyle tests integration_tests examples --max-line-length 120" - mypy: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - name: MyPy + name: Code Lint steps: - name: checkout git uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup conda - uses: s-weigand/setup-conda@v1 + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - update-conda: true - python-version: ${{ matrix.python-version }} - conda-channels: anaconda, conda-forge - - name: run mypy + version: 0.5.5 + enable-cache: 'true' + cache-suffix: ${{ matrix.python-version }} + - name: Run ${{ matrix.lint-command }} run: | - sudo apt-get remove python3-openssl - pip install --upgrade -e '.[types]' - mypy datacube - + uv run ${{ matrix.lint-command }} - pycodestyle: - name: pycodestyle - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: true - python-version: ${{ matrix.python-version }} - conda-channels: anaconda, conda-forge - - name: Run pycodestyle - run: | - sudo apt-get remove python3-openssl - pip install --upgrade -e '.[test]' - pycodestyle tests integration_tests examples --max-line-length 120