-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from databricks/new-branch-for-files
Setup pyproject and CI
- Loading branch information
Showing
3 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements/lint-requirements.txt | ||
- name: Lint Python code with ruff | ||
run: | | ||
ruff check . | ||
ruff format --check . | ||
- name: Lint YAML files with yamllint | ||
run: yamllint . | ||
|
||
core_test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10'] | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install .[dev] | ||
- name: Run tests | ||
run: | | ||
pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Setting up dev environment | ||
|
||
Create a conda environement and install dev requirements | ||
|
||
``` | ||
conda create --name databricks-ai-dev-env python=3.10 | ||
conda activate databricks-ai-dev-env | ||
pip install -e ".[databricks-dev]" | ||
pip install -r requirements/lint-requirements.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[project] | ||
name = "databricks-ai-bridge" | ||
version = "0.0.1" | ||
description = "Official Python library for Databricks AI support" | ||
authors = [ | ||
{ name="Prithvi Kannan", email="[email protected]" }, | ||
] | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"typing_extensions", | ||
"pydantic" | ||
] | ||
|
||
[project.license] | ||
file = "LICENSE.txt" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build] | ||
include = [ | ||
"src/*" | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/databricks_ai_bridge"] | ||
|
||
[project.optional-dependencies] | ||
databricks = [ | ||
"databricks-sdk>=0.34.0", | ||
"pandas", | ||
] | ||
databricks-dev = [ | ||
"hatch", | ||
"pytest", | ||
"databricks-sdk>=0.34.0", | ||
"pandas", | ||
"ruff==0.6.4", | ||
] | ||
dev = [ | ||
"hatch", | ||
"pytest", | ||
"databricks-sdk>=0.34.0", | ||
"pandas", | ||
"ruff==0.6.4", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
target-version = "py39" | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
# isort | ||
"I", | ||
# bugbear rules | ||
"B", | ||
# remove unused imports | ||
"F401", | ||
# bare except statements | ||
"E722", | ||
# print statements | ||
"T201", | ||
"T203", | ||
# misuse of typing.TYPE_CHECKING | ||
"TCH004", | ||
# import rules | ||
"TID251", | ||
# undefined-local-with-import-star | ||
"F403", | ||
] | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = true | ||
docstring-code-line-length = 88 | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = ["src"] |