Skip to content

Commit

Permalink
chore(ingest): speed up lintFix command (#12346)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Jan 15, 2025
1 parent 3108b53 commit cfe65cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 1 addition & 8 deletions metadata-ingestion/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,7 @@ task modelDocUpload(type: Exec, dependsOn: [modelDocGen]) {


task lint(type: Exec, dependsOn: installDev) {
/*
The find/sed combo below is a temporary work-around for the following mypy issue with airflow 2.2.0:
"venv/lib/python3.8/site-packages/airflow/_vendor/connexion/spec.py:169: error: invalid syntax".
*/
commandLine 'bash', '-c',
"find ${venv_name}/lib -path *airflow/_vendor/connexion/spec.py -exec sed -i.bak -e '169,169s/ # type: List\\[str\\]//g' {} \\; && " +
"source ${venv_name}/bin/activate && set -x && " +
"black --check --diff src/ tests/ examples/ && " +
"isort --check --diff src/ tests/ examples/ && " +
Expand All @@ -122,9 +117,7 @@ task lintFix(type: Exec, dependsOn: installDev) {
commandLine 'bash', '-c',
"source ${venv_name}/bin/activate && set -x && " +
"black src/ tests/ examples/ && " +
"isort src/ tests/ examples/ && " +
"flake8 src/ tests/ examples/ && " +
"mypy --show-traceback --show-error-codes src/ tests/ examples/"
"isort src/ tests/ examples/"
}

def pytest_default_env = "PYTHONDEVMODE=1"
Expand Down
5 changes: 5 additions & 0 deletions metadata-ingestion/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ cd metadata-ingestion-modules/gx-plugin
source venv/bin/activate
datahub version # should print "DataHub CLI version: unavailable (installed in develop mode)"
```

### (Optional) Set up your Python environment for developing on Dagster Plugin

From the repository root:
Expand All @@ -99,6 +100,7 @@ cd metadata-ingestion-modules/dagster-plugin
source venv/bin/activate
datahub version # should print "DataHub CLI version: unavailable (installed in develop mode)"
```

### Common setup issues

Common issues (click to expand):
Expand Down Expand Up @@ -188,6 +190,9 @@ mypy src/ tests/
or you can run from root of the repository

```shell
./gradlew :metadata-ingestion:lint

# This will auto-fix some linting issues.
./gradlew :metadata-ingestion:lintFix
```

Expand Down

0 comments on commit cfe65cc

Please sign in to comment.