Skip to content

Commit

Permalink
build: streamline gradle setup (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Nov 10, 2022
1 parent d9af4f7 commit b962d9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
21 changes: 8 additions & 13 deletions datahub-classify/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ext {
}

task checkPythonVersion(type: Exec) {
commandLine python_executable, '-c', 'import sys; assert sys.version_info >= (3, 6)'
commandLine python_executable, '-c', 'import sys; assert sys.version_info >= (3, 7)'
}

task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
Expand All @@ -50,12 +50,7 @@ task installDev(type: Exec, dependsOn: [install]) {
}

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', '-x', '-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 && black --check --diff src/ tests/ && isort --check --diff src/ tests/ && flake8 --count --statistics src/ tests/ && mypy src/ tests/"
}
task lintFix(type: Exec, dependsOn: installDev) {
Expand Down Expand Up @@ -87,13 +82,13 @@ task installDevTest(type: Exec, dependsOn: [installDev]) {
def testFile = hasProperty('testFile') ? testFile : 'unknown'
task testSingle(dependsOn: [installDevTest]) {
doLast {
if (testFile != 'unknown') {
exec {
commandLine 'bash', '-x', '-c',
"source ${venv_name}/bin/activate && pytest ${testFile}"
}
} else {
throw new GradleException("No file provided. Use -PtestFile=<test_file>")
if (testFile != 'unknown') {
exec {
commandLine 'bash', '-x', '-c',
"source ${venv_name}/bin/activate && pytest ${testFile}"
}
} else {
throw new GradleException("No file provided. Use -PtestFile=<test_file>")
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion datahub-classify/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

# Copyright 2021 Acryl Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash
set -euxo pipefail

if [[ ! ${RELEASE_SKIP_TEST:-} ]]; then
Expand Down

0 comments on commit b962d9d

Please sign in to comment.