Skip to content

Commit 98efbea

Browse files
author
Henry Harbeck
committed
explicitly import importlib.util; remove erroneous print
1 parent 2cbb98d commit 98efbea

File tree

16 files changed

+156
-517
lines changed

16 files changed

+156
-517
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Create or Label Mirror Issue
2+
on:
3+
discussion:
4+
types:
5+
- labeled
6+
issues:
7+
types:
8+
- labeled
9+
10+
env:
11+
GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
12+
TITLE_PREFIX: "[duckdb-python/#${{ github.event.issue.number || github.event.discussion.number }}]"
13+
PUBLIC_ISSUE_TITLE: ${{ github.event.issue.title }}
14+
15+
jobs:
16+
add_needs_reproducible_example_comment:
17+
if: github.event.label.name == 'needs reproducible example'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Add comment
21+
run: |
22+
cat > needs-reproducible-example-comment.md << EOF
23+
Thanks for opening this issue in the DuckDB-Python project's issue tracker! To resolve this issue, our team needs a reproducible example. This includes:
24+
25+
* A source code snippet which reproduces the issue.
26+
* The snippet should be self-contained, i.e., it should contain all imports and should use relative paths instead of hard coded paths (please avoid \`/Users/JohnDoe/...\`).
27+
* A lot of issues can be reproduced with plain SQL code executed in the [DuckDB command line client](https://duckdb.org/docs/api/cli/overview). For such issues, please open an issue in the [main DuckDB repository](https://github.com/duckdb/duckdb/).
28+
* If the script needs additional data, please share the data as a CSV, JSON, or Parquet file. Unfortunately, we cannot fix issues that can only be reproduced with a confidential data set. [Support contracts](https://duckdblabs.com/#support) allow sharing confidential data with the core DuckDB team under NDA.
29+
30+
For more detailed guidelines on how to create reproducible examples, please visit Stack Overflow's [“Minimal, Reproducible Example”](https://stackoverflow.com/help/minimal-reproducible-example) page.
31+
EOF
32+
gh issue comment --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --body-file needs-reproducible-example-comment.md
33+
34+
create_or_label_mirror_issue:
35+
if: github.event.label.name == 'reproduced' || github.event.label.name == 'under review'
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Remove 'needs triage' / 'under review' if 'reproduced'
39+
if: github.event.label.name == 'reproduced'
40+
run: |
41+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage" --remove-label "under review" --remove-label "needs reproducible example"
42+
43+
- name: Remove 'needs triage' / 'reproduced' if 'under review'
44+
if: github.event.label.name == 'under review'
45+
run: |
46+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage" --remove-label "reproduced"
47+
48+
- name: Remove 'needs triage' if 'expected behavior'
49+
if: github.event.label.name == 'expected behavior'
50+
run: |
51+
gh issue edit --repo duckdb/duckdb-python ${{ github.event.issue.number || github.event.discussion.number }} --remove-label "needs triage"
52+
53+
- name: Get mirror issue number
54+
run: |
55+
gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
56+
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
57+
58+
- name: Print whether mirror issue exists
59+
run: |
60+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
61+
echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
62+
else
63+
echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
64+
fi
65+
66+
- name: Set label environment variable
67+
run: |
68+
if ${{ github.event.label.name == 'reproduced' }}; then
69+
echo "LABEL=reproduced" >> $GITHUB_ENV
70+
echo "UNLABEL=under review" >> $GITHUB_ENV
71+
else
72+
echo "LABEL=under review" >> $GITHUB_ENV
73+
echo "UNLABEL=reproduced" >> $GITHUB_ENV
74+
fi
75+
76+
- name: Create or label issue
77+
run: |
78+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
79+
gh issue create --repo duckdblabs/duckdb-internal --label "$LABEL" --label "Python" --title "$TITLE_PREFIX - $PUBLIC_ISSUE_TITLE" --body "See https://github.com/duckdb/duckdb-python/issues/${{ github.event.issue.number || github.event.discussion.number }}"
80+
else
81+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --remove-label "$UNLABEL" --add-label "$LABEL"
82+
fi
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Mirror Issue
2+
on:
3+
discussion:
4+
types:
5+
- labeled
6+
issues:
7+
types:
8+
- closed
9+
- reopened
10+
11+
env:
12+
GH_TOKEN: ${{ secrets.DUCKDBLABS_BOT_TOKEN }}
13+
TITLE_PREFIX: "[duckdb-python/#${{ github.event.issue.number || github.event.discussion.number }}]"
14+
15+
jobs:
16+
update_mirror_issue:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get mirror issue number
20+
run: |
21+
gh issue list --repo duckdblabs/duckdb-internal --search "${TITLE_PREFIX}" --json title,number --state all --jq ".[] | select(.title | startswith(\"$TITLE_PREFIX\")).number" > mirror_issue_number.txt
22+
echo "MIRROR_ISSUE_NUMBER=$(cat mirror_issue_number.txt)" >> $GITHUB_ENV
23+
24+
- name: Print whether mirror issue exists
25+
run: |
26+
if [ "$MIRROR_ISSUE_NUMBER" == "" ]; then
27+
echo "Mirror issue with title prefix '$TITLE_PREFIX' does not exist yet"
28+
else
29+
echo "Mirror issue with title prefix '$TITLE_PREFIX' exists with number $MIRROR_ISSUE_NUMBER"
30+
fi
31+
32+
- name: Add comment with status to mirror issue
33+
run: |
34+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
35+
gh issue comment --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --body "The issue has been ${{ github.event.action }} (https://github.com/duckdb/duckdb-python/issues/${{ github.event.issue.number || github.event.discussion.number }})."
36+
fi
37+
38+
- name: Add closed label to mirror issue
39+
if: github.event.action == 'closed'
40+
run: |
41+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
42+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public closed" --remove-label "public reopened"
43+
fi
44+
45+
- name: Reopen mirror issue and add reopened label
46+
if: github.event.action == 'reopened'
47+
run: |
48+
if [ "$MIRROR_ISSUE_NUMBER" != "" ]; then
49+
gh issue reopen --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER
50+
gh issue edit --repo duckdblabs/duckdb-internal $MIRROR_ISSUE_NUMBER --add-label "public reopened" --remove-label "public closed"
51+
fi

.github/workflows/packaging_wheels.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
- { minimal: true, python: cp312 }
4747
- { minimal: true, python: cp313 }
4848
- { minimal: true, platform: { arch: universal2 } }
49+
- { python: cp314t, platform: { os: windows-2025 } }
50+
4951
runs-on: ${{ matrix.platform.os }}
5052
env:
5153
### cibuildwheel configuration

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
[submodule "external/duckdb"]
2-
path = external/duckdb
3-
url = https://github.com/duckdb/duckdb.git
4-
branch = main
51
[submodule]
62
recurse = true

adbc_driver_duckdb/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import enum
2121
import functools
22-
import importlib
22+
import importlib.util
2323
import typing
2424

2525
import adbc_driver_manager
@@ -46,5 +46,4 @@ def driver_path() -> str:
4646
if duckdb_module_spec is None:
4747
msg = "Could not find duckdb shared library. Did you pip install duckdb?"
4848
raise ImportError(msg)
49-
print(f"Found duckdb shared library at {duckdb_module_spec.origin}")
5049
return duckdb_module_spec.origin

duckdb_packaging/setuptools_scm_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ._versioning import format_version, parse_version
1313

1414
# MAIN_BRANCH_VERSIONING should be 'True' on main branch only
15-
MAIN_BRANCH_VERSIONING = False
15+
MAIN_BRANCH_VERSIONING = True
1616

1717
SCM_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DUCKDB"
1818
SCM_GLOBAL_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION"

external/duckdb

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ line-length = 120
351351
indent-width = 4
352352
target-version = "py39"
353353
fix = true
354-
exclude = ['external/duckdb', 'sqllogic']
354+
exclude = ['external/duckdb']
355355

356356
[tool.ruff.lint]
357357
fixable = ["ALL"]

sqllogic/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)