Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
test:
strategy:
fail-fast: false
matrix:
dep-type:
- latest
- frozen
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
Expand All @@ -27,9 +31,16 @@ jobs:
python-version: ${{ inputs.pyVersion }}

- name: Run tests
run: make dev install test
shell: bash
run: |
if [ "${{ matrix.dep-type }}" = "latest" ]; then
make dev-latest test
else
make dev test
fi

- name: Publish test coverage
if: ${{ matrix.dep-type == 'frozen' }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.venv
.venv*
*.
build
dist
Expand All @@ -10,4 +10,5 @@ __pycache__
databricks-sdk-py.iml
.databricks
.coverage
htmlcov
htmlcov
.python-version
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just making sure my usage of pyenv doesn't accidentally pollute the repo.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exclude NEXT_CHANGELOG.md
exclude tagging.py
exclude .package.json
exclude .release_metadata.json
exclude requirements-dev-*.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures the requirements files are not unnecessarily bundled in the source wheel file.

Copy link
Contributor

@renaudhartert-db renaudhartert-db Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame we cannot add a comment in the manifest to make that clear


recursive-exclude docs *
recursive-exclude examples *
Expand Down
48 changes: 44 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
dev:
python3 -m venv .venv
# Detect Python version from the system
PYTHON_VERSION := $(shell python3 -c 'import sys; print(f"{sys.version_info.major}{sys.version_info.minor}")')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually going to comment about not fixing the version but you fixed it already :-)


# Generate requirements filename based on Python version
REQUIREMENTS_FILE = requirements-dev-py$(PYTHON_VERSION).txt

# Testing workflow:
# 1. GitHub Actions runs tests for each Python version (3.8-3.12) on multiple OSes
# 2. For each Python version, tests run in two modes:
# - 'latest': Uses dependencies directly from pyproject.toml
# - 'frozen': Uses version-specific requirements-dev-pyXY.txt
# 3. Each Python version gets its own virtual environment (.venvXY)
# 4. Tests are only blocking in `frozen` mode. Tests run in `latest` mode are
# allowed to fail and serve as a warning that there may have been a breaking
# change in a dependency.
# 5. To run tests locally:
# - make dev test # uses frozen dependencies
# - make dev-latest test # uses latest dependencies
#
# To update dependencies for all Python versions using pyenv:
# rm -rf .venv* requirements-dev-py*.txt
# for v in 3.8 3.9 3.10 3.11 3.12 3.13; do
# pyenv local $v
# make dev-env update-dev-dep-lockfile
# done

dev-env:
python -m venv .venv$(PYTHON_VERSION)
ifeq ($(OS), Windows_NT)
.venv\Scripts\activate
.venv$(PYTHON_VERSION)\Scripts\activate
else
. .venv/bin/activate
. .venv$(PYTHON_VERSION)/bin/activate
endif

dev: dev-env
# Install all dependencies from the version-specific requirements file
# Regenerate this file with `make update-dev-dep-lockfile PYTHON_VERSION=X.Y`
pip install -r $(REQUIREMENTS_FILE)

dev-latest: dev-env
# Install all dependencies from the pyproject.toml file
pip install '.[dev]'

install-pip-tools:
pip install pip-tools

update-dev-dep-lockfile: install-pip-tools
pip-compile pyproject.toml --extra dev --output-file $(REQUIREMENTS_FILE)

install:
pip install .

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ dev = [
"ipywidgets",
"requests-mock",
"pyfakefs",
"databricks-connect",
"pytest-rerunfailures",
"openai",
'langchain-openai; python_version > "3.7"',
Expand Down
231 changes: 231 additions & 0 deletions requirements-dev-py310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements-dev-py310.txt pyproject.toml
#
annotated-types==0.7.0
# via pydantic
anyio==4.9.0
# via
# httpx
# openai
asttokens==3.0.0
# via stack-data
autoflake==2.3.1
# via databricks-sdk (pyproject.toml)
black==25.1.0
# via databricks-sdk (pyproject.toml)
build==1.2.2.post1
# via databricks-sdk (pyproject.toml)
cachetools==5.5.2
# via google-auth
certifi==2025.4.26
# via
# httpcore
# httpx
# requests
charset-normalizer==3.4.2
# via requests
click==8.2.1
# via black
comm==0.2.2
# via ipywidgets
coverage[toml]==7.9.1
# via pytest-cov
decorator==5.2.1
# via ipython
distro==1.9.0
# via openai
exceptiongroup==1.3.0
# via
# anyio
# ipython
# pytest
execnet==2.1.1
# via pytest-xdist
executing==2.2.0
# via stack-data
google-auth==2.40.3
# via databricks-sdk (pyproject.toml)
h11==0.16.0
# via httpcore
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via
# databricks-sdk (pyproject.toml)
# langsmith
# openai
idna==3.10
# via
# anyio
# httpx
# requests
iniconfig==2.1.0
# via pytest
ipython==8.37.0
# via
# databricks-sdk (pyproject.toml)
# ipywidgets
ipywidgets==8.1.7
# via databricks-sdk (pyproject.toml)
isort==6.0.1
# via databricks-sdk (pyproject.toml)
jedi==0.19.2
# via ipython
jiter==0.10.0
# via openai
jsonpatch==1.33
# via langchain-core
jsonpointer==3.0.0
# via jsonpatch
jupyterlab-widgets==3.0.15
# via ipywidgets
langchain-core==0.3.65
# via langchain-openai
langchain-openai==0.3.22 ; python_version > "3.7"
# via databricks-sdk (pyproject.toml)
langsmith==0.3.45
# via langchain-core
matplotlib-inline==0.1.7
# via ipython
mypy-extensions==1.1.0
# via black
openai==1.86.0
# via
# databricks-sdk (pyproject.toml)
# langchain-openai
orjson==3.10.18
# via langsmith
packaging==24.2
# via
# black
# build
# langchain-core
# langsmith
# pytest
# pytest-rerunfailures
parso==0.8.4
# via jedi
pathspec==0.12.1
# via black
pexpect==4.9.0
# via ipython
platformdirs==4.3.8
# via black
pluggy==1.6.0
# via
# pytest
# pytest-cov
prompt-toolkit==3.0.51
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.3
# via stack-data
pyasn1==0.6.1
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.4.2
# via google-auth
pycodestyle==2.13.0
# via databricks-sdk (pyproject.toml)
pydantic==2.11.6
# via
# langchain-core
# langsmith
# openai
pydantic-core==2.33.2
# via pydantic
pyfakefs==5.8.0
# via databricks-sdk (pyproject.toml)
pyflakes==3.3.2
# via autoflake
pygments==2.19.1
# via
# ipython
# pytest
pyproject-hooks==1.2.0
# via build
pytest==8.4.0
# via
# databricks-sdk (pyproject.toml)
# pytest-cov
# pytest-mock
# pytest-rerunfailures
# pytest-xdist
pytest-cov==6.2.1
# via databricks-sdk (pyproject.toml)
pytest-mock==3.14.1
# via databricks-sdk (pyproject.toml)
pytest-rerunfailures==15.1
# via databricks-sdk (pyproject.toml)
pytest-xdist==3.7.0
# via databricks-sdk (pyproject.toml)
pyyaml==6.0.2
# via langchain-core
regex==2024.11.6
# via tiktoken
requests==2.32.4
# via
# databricks-sdk (pyproject.toml)
# langsmith
# requests-mock
# requests-toolbelt
# tiktoken
requests-mock==1.12.1
# via databricks-sdk (pyproject.toml)
requests-toolbelt==1.0.0
# via langsmith
rsa==4.9.1
# via google-auth
sniffio==1.3.1
# via
# anyio
# openai
stack-data==0.6.3
# via ipython
tenacity==9.1.2
# via langchain-core
tiktoken==0.9.0
# via langchain-openai
tomli==2.2.1
# via
# autoflake
# black
# build
# coverage
# pytest
tqdm==4.67.1
# via openai
traitlets==5.14.3
# via
# comm
# ipython
# ipywidgets
# matplotlib-inline
typing-extensions==4.14.0
# via
# anyio
# black
# exceptiongroup
# ipython
# langchain-core
# openai
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.1
# via pydantic
urllib3==2.4.0
# via requests
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.45.1
# via databricks-sdk (pyproject.toml)
widgetsnbextension==4.0.14
# via ipywidgets
zstandard==0.23.0
# via langsmith
Loading
Loading