aboutsummaryrefslogtreecommitdiff
blob: 847552aac11957286f4ce660d23bbadb82cba7c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Maintainer: Oskari Pirhonen <xxc3ncoredxx@gmail.com>

image: ubuntu/jammy
shell: true
repositories:
  # For more versions than just the default python3
  deadsnakes: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main "BA6932366A755776"
environment:
  PYTHON_VERSIONS:
    - '3.9'
    - '3.10'
    - '3.11'
tasks:
  - setup-python: |
      portage/.builds/setup-python.sh "${PYTHON_VERSIONS[@]}"

  - setup-black: |
      .venv/bin/pip install black

  - setup-pylint: |
      for py in "${PYTHON_VERSIONS[@]}"; do
        ".venv-$py/bin/pip" install pylint pytest
      done

  - black: |
      source .venv/bin/activate
      cd portage
      STRAGGLERS="$(find bin runtests -type f -not -name '*.py' -not -name '*.sh' | \
          xargs grep -l '#!/usr/bin/env python' | \
          tr '\n' ' ')"
      time black --check --diff --color . $STRAGGLERS
      deactivate

  - pylint: |
      for py in "${PYTHON_VERSIONS[@]}"; do
        source ".venv-$py/bin/activate"
        pushd portage
          time ./run-pylint
        popd
        deactivate
      done