Skip to content

Commit 1598070

Browse files
authored
fix(ci): simplify python release process (#10133)
1 parent 45f6c2a commit 1598070

File tree

8 files changed

+15
-22
lines changed

8 files changed

+15
-22
lines changed

.github/workflows/documentation.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ jobs:
4747
run: ./metadata-ingestion/scripts/install_deps.sh
4848
- name: Build Docs
4949
run: |
50-
./gradlew --info docs-website:build \
51-
-x :metadata-ingestion-modules:airflow-plugin:build \
52-
-x :metadata-ingestion-modules:airflow-plugin:check \
53-
-x :metadata-ingestion-modules:dagster-plugin:build \
54-
-x :metadata-ingestion-modules:dagster-plugin:check \
50+
./gradlew --info docs-website:build
5551
5652
- name: Deploy
5753
if: github.event_name == 'push' && github.repository == 'datahub-project/datahub'

docs-website/build.gradle

+3-8
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,14 @@ task yarnInstall(type: YarnTask) {
7979
)
8080
outputs.dir('node_modules')
8181
}
82-
task airflowPluginBuild(dependsOn: [':metadata-ingestion-modules:airflow-plugin:buildWheel']) {
83-
}
84-
85-
// The Dagster plugin build and airflow plugin build can't be built at the same time; otherwise, it will raise
86-
// fatal: Unable to create '/home/runner/work/datahub/datahub/.git/index.lock': File exists.. on CI
87-
task dagsterPluginBuild(dependsOn: [':metadata-ingestion-modules:dagster-plugin:buildWheel', airflowPluginBuild]) {
88-
}
8982

9083
task yarnGenerate(type: YarnTask, dependsOn: [yarnInstall,
9184
generateGraphQLSchema, generateJsonSchema,
9285
':metadata-ingestion:modelDocGen', ':metadata-ingestion:docGen',
9386
':metadata-ingestion:buildWheel',
94-
airflowPluginBuild, dagsterPluginBuild] ) {
87+
':metadata-ingestion-modules:airflow-plugin:buildWheel',
88+
':metadata-ingestion-modules:dagster-plugin:buildWheel',
89+
]) {
9590
inputs.files(projectMdFiles)
9691
outputs.cacheIf { true }
9792
args = ['run', 'generate']

metadata-ingestion-modules/airflow-plugin/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ task cleanPythonCache(type: Exec) {
106106
commandLine 'bash', '-c',
107107
"find src -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete -o -type d -empty -delete"
108108
}
109-
task buildWheel(type: Exec, dependsOn: [install, cleanPythonCache]) {
109+
task buildWheel(type: Exec, dependsOn: [environmentSetup, cleanPythonCache]) {
110110
commandLine 'bash', '-c',
111111
"source ${venv_name}/bin/activate && set -x && " +
112112
'uv pip install build && RELEASE_VERSION="\${RELEASE_VERSION:-0.0.0.dev1}" RELEASE_SKIP_TEST=1 RELEASE_SKIP_INSTALL=1 RELEASE_SKIP_UPLOAD=1 ./scripts/release.sh'

metadata-ingestion-modules/airflow-plugin/scripts/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ python -m build
2323
if [[ ! ${RELEASE_SKIP_UPLOAD:-} ]]; then
2424
python -m twine upload 'dist/*'
2525
fi
26-
git restore src/${MODULE}/__init__.py
26+
mv src/${MODULE}/__init__.py.bak src/${MODULE}/__init__.py

metadata-ingestion-modules/dagster-plugin/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ task testFull(type: Exec, dependsOn: [testQuick, installDevTest]) {
109109
commandLine 'bash', '-x', '-c',
110110
"source ${venv_name}/bin/activate && pytest -m 'not slow_integration' -vv --continue-on-collection-errors --junit-xml=junit.full.xml"
111111
}
112-
task buildWheel(type: Exec, dependsOn: [install]) {
112+
task buildWheel(type: Exec, dependsOn: [environmentSetup]) {
113113
commandLine 'bash', '-c', "source ${venv_name}/bin/activate && " +
114114
'uv pip install build && RELEASE_VERSION="\${RELEASE_VERSION:-0.0.0.dev1}" RELEASE_SKIP_TEST=1 RELEASE_SKIP_UPLOAD=1 ./scripts/release.sh'
115115
}

metadata-ingestion-modules/dagster-plugin/scripts/release.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MODULE=datahub_dagster_plugin
1313
python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"'
1414
if [[ ${RELEASE_VERSION:-} ]]; then
1515
# Replace version with RELEASE_VERSION env variable
16-
sed -i.bak "s/__version__ = \"0.0.0.dev0\"/__version__ = \"$RELEASE_VERSION\"/" src/${MODULE}/__init__.py
16+
sed -i.bak "s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \"$(echo $RELEASE_VERSION|sed s/-/+/)\"/" src/${MODULE}/__init__.py
1717
else
1818
vim src/${MODULE}/__init__.py
1919
fi
@@ -23,4 +23,4 @@ python -m build
2323
if [[ ! ${RELEASE_SKIP_UPLOAD:-} ]]; then
2424
python -m twine upload 'dist/*'
2525
fi
26-
git restore src/${MODULE}/__init__.py
26+
mv src/${MODULE}/__init__.py.bak src/${MODULE}/__init__.py

metadata-ingestion/scripts/release.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ elif [[ ! ${RELEASE_SKIP_INSTALL:-} ]]; then
77
../gradlew install
88
fi
99

10+
MODULE=datahub
11+
1012
# Check packaging constraint.
1113
python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"'
1214
if [[ ${RELEASE_VERSION:-} ]]; then
1315
# Replace version with RELEASE_VERSION env variable
14-
sed -i.bak "s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \"$(echo $RELEASE_VERSION|sed s/-/+/)\"/" src/datahub/__init__.py
16+
sed -i.bak "s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \"$(echo $RELEASE_VERSION|sed s/-/+/)\"/" src/${MODULE}/__init__.py
1517
else
16-
vim src/datahub/__init__.py
18+
vim src/${MODULE}/__init__.py
1719
fi
1820

1921
rm -rf build dist || true
2022
python -m build
2123
if [[ ! ${RELEASE_SKIP_UPLOAD:-} ]]; then
2224
python -m twine upload 'dist/*'
2325
fi
24-
git restore src/datahub/__init__.py
26+
mv src/${MODULE}/__init__.py.bak src/${MODULE}/__init__.py

vercel.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"buildCommand": "./gradlew -PuseSystemNode=true :docs-website:build -x :metadata-ingestion-modules:dagster-plugin:build -x :metadata-ingestion-modules:dagster-plugin:check",
2+
"buildCommand": "./gradlew -PuseSystemNode=true :docs-website:build",
33
"github": {
44
"silent": true,
55
"autoJobCancelation": true

0 commit comments

Comments
 (0)