Skip to content

Commit 2fbc1d0

Browse files
authoredOct 6, 2022
Merge pull request #336 from sentinel-hub/develop
Release version 3.8.0
2 parents 01aa7e0 + 1119340 commit 2fbc1d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1766
-637
lines changed
 

‎.flake8

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[flake8]
2-
ignore = E203, W503
2+
ignore = E203, W503, C408
33
exclude = .git, __pycache__
4+
min_python_version = 3.7.0
45
max-line-length= 120
56
max-complexity = 13
67
per-file-ignores =

‎.github/workflows/ci_action.yml

+25-26
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: build
22

33
on:
4+
pull_request:
45
push:
6+
branches:
7+
- "master"
8+
- "develop"
59
schedule:
6-
- cron: '0 0 * * *'
10+
- cron: "0 0 * * *"
711

812
env:
913
# The only way to simulate if-else statement
10-
CHECKOUT_BRANCH: ${{ github.event_name == 'push' && github.ref || 'develop' }}
14+
CHECKOUT_BRANCH: ${{ github.event_name == 'schedule' && 'develop' || github.ref }}
1115

1216
jobs:
13-
14-
check-code-black-isort-flake8:
17+
check-pre-commit-hooks:
1518
runs-on: ubuntu-latest
1619
steps:
1720
- name: Checkout branch
@@ -25,21 +28,13 @@ jobs:
2528
python-version: "3.8"
2629
architecture: x64
2730

28-
- name: Prepare linters
29-
run: pip install black[jupyter] isort flake8 nbqa
30-
31-
- name: Check code compliance with black
32-
run: black . --check --diff
33-
34-
- name: Check code compliance with isort
31+
- name: Prepare pre-commit validators
3532
run: |
36-
isort . --check --diff
37-
nbqa isort . --nbqa-diff
33+
pip install pre-commit
34+
pre-commit install
3835
39-
- name: Check code compliance with flake8
40-
run: |
41-
flake8 .
42-
nbqa flake8 .
36+
- name: Check code compliance with pre-commit validators
37+
run: pre-commit run --all-files
4338

4439
check-code-pylint-and-mypy:
4540
runs-on: ubuntu-latest
@@ -54,10 +49,10 @@ jobs:
5449
with:
5550
python-version: "3.8"
5651
architecture: x64
57-
52+
5853
- name: Install packages
5954
run: pip install -e .[AWS,DEV]
60-
55+
6156
- name: Run mypy
6257
run: mypy sentinelhub setup.py
6358

@@ -69,10 +64,14 @@ jobs:
6964
strategy:
7065
matrix:
7166
python-version:
72-
- '3.7'
73-
- '3.8'
74-
- '3.9'
75-
- '3.10'
67+
- "3.7"
68+
- "3.9"
69+
- "3.10"
70+
include:
71+
# A flag marks whether full or partial tests should be run
72+
# We don't run integration tests on pull requests from outside repos, because they don't have secrets
73+
- python-version: "3.8"
74+
full_test_suite: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
7675
steps:
7776
- name: Checkout branch
7877
uses: actions/checkout@v2
@@ -92,7 +91,7 @@ jobs:
9291
pip install -e .[AWS,DEV]
9392
9493
- name: Run full tests and code coverage
95-
if: matrix.python-version == '3.8'
94+
if: ${{ matrix.full_test_suite }}
9695
run: |
9796
sentinelhub.config \
9897
--sh_client_id "${{ secrets.SH_CLIENT_ID }}" \
@@ -103,12 +102,12 @@ jobs:
103102
pytest --cov --cov-report=term --cov-report=xml
104103
105104
- name: Run pylint and reduced tests
106-
if: matrix.python-version != '3.8'
105+
if: ${{ !matrix.full_test_suite }}
107106
run: |
108107
pytest -m "not sh_integration and not aws_integration"
109108
110109
- name: Upload code coverage
111-
if: matrix.python-version == '3.8'
110+
if: ${{ matrix.full_test_suite }}
112111
uses: codecov/codecov-action@v2
113112
with:
114113
files: coverage.xml

0 commit comments

Comments
 (0)
Please sign in to comment.