-
-
Notifications
You must be signed in to change notification settings - Fork 58
72 lines (67 loc) · 2.62 KB
/
python-ci.yml
File metadata and controls
72 lines (67 loc) · 2.62 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Detectree2 CI
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# permissions:
# contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10.6"
- name: Install code development dependencies
run: |
python3 --version
python -m pip install --upgrade pip
pip3 install flake8 pep8-naming pydocstyle pytest isort
pip3 install mypy data-science-types pandas-stubs types-pillow numpy==1.23.1
# if [ -f requirements/requirements.txt ]; then pip install -r requirements/requirements.txt; fi
- name: Install detectree2 dependencies
run: |
sudo apt install -yqq software-properties-common
sudo add-apt-repository -y ppa:ubuntugis/ppa
sudo apt -yqq update
sudo apt install -yqq libgdal-dev gdal-bin python3-pip git python3-dev build-essential
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
python -m pip install --upgrade pip wheel
python -m pip install opencv-python
python -m pip install cython
python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
python -m pip install wandb sphinx
python -m pip install pycocotools
python -m pip install --no-build-isolation 'git+https://github.com/facebookresearch/detectron2.git'
- name: Show GDAL version installed via apt
run: |
gdalinfo --version
- name: Install detectree2
run: |
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip3 install GDAL==3.6.4
pip3 install .
- name: flake8 checks
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 detectree2 --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 detectree2 --count --exit-zero --max-complexity=10 --statistics
- name: pytest checks
run: |
pip install --upgrade --force-reinstall "numpy>=1.20,<2.0"
pip install pytest-order
pytest
- name: mypy checks
run: |
mypy detectree2
- name: isort checks
run: |
isort --check detectree2