-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated tests and linting in ligth of upcoming changes from ru-sql
- Loading branch information
1 parent
e77e779
commit dcc9df9
Showing
8 changed files
with
130 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main, staging-* ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: pip cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: lint-pip-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
lint-pip- | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[test] | ||
- name: Lint | ||
run: ./scripts/lint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main, staging-* ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
os: [ubuntu-latest] # , macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Ubuntu cache | ||
uses: actions/cache@v1 | ||
if: startsWith(matrix.os, 'ubuntu') | ||
with: | ||
path: ~/.cache/pip | ||
key: | ||
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
${{ matrix.os }}-${{ matrix.python-version }}- | ||
- name: macOS cache | ||
uses: actions/cache@v1 | ||
if: startsWith(matrix.os, 'macOS') | ||
with: | ||
path: ~/Library/Caches/pip | ||
key: | ||
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
${{ matrix.os }}-${{ matrix.python-version }}- | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Generate databases | ||
run: python cities/utils/csv_to_db_pipeline.py | ||
|
||
- name: Test | ||
run: python -m pytest tests/ | ||
|
||
- name: Test Notebooks | ||
run: | | ||
./scripts/test_notebooks.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
isort --profile black cities/ tests/ | ||
# isort suspended till the CI-vs-local issue is resolved | ||
# isort cities/ tests/ | ||
|
||
black cities/ tests/ | ||
autoflake --remove-all-unused-imports --in-place --recursive ./cities ./tests | ||
|
||
nbqa black docs/guides/ | ||
nbqa autoflake --remove-all-unused-imports --recursive --in-place docs/guides/ | ||
nbqa isort -in-place docs/guides/ | ||
# nbqa isort docs/guides/ | ||
nbqa black docs/guides/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters