Skip to content

Commit

Permalink
feat: start move over to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Dec 31, 2024
1 parent c7abcac commit 40920e6
Show file tree
Hide file tree
Showing 9 changed files with 3,095 additions and 3,828 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip==24.0
poetry==1.3.2
virtualenv==20.21.0
uv==0.5.13

18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ jobs:
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Install dbt-core
run: |
poetry add dbt-core==${{ matrix.dbt-version }}
pip install --constraint=.github/workflows/constraints.txt uv
uv --version
- name: Install required packages
run: | # install duckdb extras to be able to parse manifest
poetry install -E duckdb
uv sync --extra duckdb
- name: Install dbt-core
run: |
uv pip install dbt-core==${{ matrix.dbt-version }}
- name: Parse manifest
run: |
poetry run dbt parse --project-dir demo_duckdb --profiles-dir demo_duckdb -t test
uv run dbt parse --project-dir demo_duckdb --profiles-dir demo_duckdb -t test
- name: Run pytest
run: |
poetry run python -m pytest
uv tool run pytest
25 changes: 11 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@ repos:
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: ["--config", "pyproject.toml"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["-sp", "pyproject.toml"]
# TODO: replace with ruff
# - repo: https://github.com/psf/black
# rev: 24.4.2
# hooks:
# - id: black
# args: ["--config", "pyproject.toml"]
# - repo: https://github.com/pycqa/isort
# rev: 5.13.2
# hooks:
# - id: isort
# args: ["-sp", "pyproject.toml"]
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
hooks:
- id: hadolint-docker
# - repo: https://github.com/pycqa/flake8
# rev: 4.0.1
# hooks:
# - id: flake8
Empty file added Makefile
Empty file.
3,754 changes: 0 additions & 3,754 deletions poetry.lock

This file was deleted.

90 changes: 41 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
[tool.poetry]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "dbt-osmosis"
version = "0.14.0"
description = "A dbt server and suite of optional developer tools to make developing with dbt delightful."
authors = ["z3z1ma <[email protected]>"]
license = "Apache-2.0"
description = "A dbt utility for managing YAML to make developing with dbt more delightful."
readme = "README.md"
license = { text = "Apache-2.0" }
authors = [{ name = "z3z1ma", email = "[email protected]" }]
keywords = ["dbt", "yaml", "osmosis"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand All @@ -16,66 +21,53 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = ["dbt", "server", "streamlit", "git", "diff"]
documentation = "https://github.com/z3z1ma/dbt-osmosis"
repository = "https://github.com/z3z1ma/dbt-osmosis"
requires-python = ">=3.9,<3.13"

[tool.poetry.dependencies]
python = ">=3.9,<3.9.7 || >3.9.7,<3.13"
click = ">7"
dbt-core = ">=1.8,<1.10"
"ruamel.yaml" = ">=0.17"
rich = ">=10"
GitPython = ">3,<4"
# Streamlit Workbench Dependencies
streamlit = { version = ">=1.20.0", optional = true }
streamlit-ace = { version = ">=0.1.0", optional = true }
ydata-profiling = { version = ">=3.6.0", optional = true }
feedparser = { version = "^6.0.10", optional = true }
streamlit-elements-fluence = { version = ">=0.1.4", optional = true }
# Testing duckdb + sqlite
dbt-duckdb = { version = ">=1.0.0", optional = true }
dbt-sqlite = { version = ">=1.0.0", optional = true }
dbt-postgres = { version = ">=1.0.0", optional = true }
openai = { version = ">0.28.0", optional = true }
dependencies = [
"click>7",
"dbt-core>=1.8,<1.10",
"ruamel.yaml>=0.17",
"rich>=10",
"GitPython>3,<4",
]

[tool.poetry.extras]
duckdb = ["dbt-duckdb"]
sqlite = ["dbt-sqlite"]
postgres = ["dbt-postgres"]
[project.optional-dependencies]
duckdb = ["dbt-duckdb>=1.0.0"]
sqlite = ["dbt-sqlite>=1.0.0"]
postgres = ["dbt-postgres>=1.0.0"]
workbench = [
"streamlit",
"streamlit-ace",
"ydata-profiling",
"feedparser",
"streamlit-elements-fluence",
"streamlit>=1.20.0",
"streamlit-ace>=0.1.0",
"ydata-profiling>=3.6.0",
"feedparser~=6.0.10",
"streamlit-elements-fluence>=0.1.4",
]

[tool.poetry.group.dev.dependencies]
black = ">=21.9b0"
mypy = ">=0.910"
pylint = ">=2.11.1"
pytest = "^7.4.2"
pre-commit = ">3.0.0"
openai = ["openai>0.28.0"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black] # https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
dev = [
"black>=21.9b0",
"mypy>=0.910",
"pylint>=2.11.1",
"pytest~=7.4.2",
"pre-commit>3.0.0",
]

[project.scripts]
"dbt-osmosis" = "dbt_osmosis.main:cli"

[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311"]
preview = true

[tool.isort] # https://pycqa.github.io/isort/docs/configuration/options.html
[tool.isort]
color_output = true
line_length = 100
profile = "black"
src_paths = ["src"]
include_trailing_comma = true

[tool.ruff] # https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[tool.ruff]
line-length = 100

[tool.poetry.scripts]
dbt-osmosis = 'dbt_osmosis.main:cli'
89 changes: 89 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This file was autogenerated by uv via the following command:
# uv export --no-hashes --extra duckdb --extra sqlite --extra dev
-e .
agate==1.9.1
annotated-types==0.7.0
astroid==3.3.8
attrs==24.3.0
babel==2.16.0
black==24.10.0
certifi==2024.12.14
cfgv==3.4.0
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
daff==1.3.46
dbt-adapters==1.13.0
dbt-common==1.14.0
dbt-core==1.9.1
dbt-duckdb==1.9.1
dbt-extractor==0.5.1
dbt-semantic-interfaces==0.7.4
dbt-sqlite==1.4.0
deepdiff==7.0.1
dill==0.3.9
distlib==0.3.9
duckdb==1.1.3
exceptiongroup==1.2.2 ; python_full_version < '3.11'
filelock==3.16.1
gitdb==4.0.11
gitpython==3.1.43
identify==2.6.4
idna==3.10
importlib-metadata==6.11.0
iniconfig==2.0.0
isodate==0.6.1
isort==5.13.2
jinja2==3.1.5
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
leather==0.4.0
markdown-it-py==3.0.0
markupsafe==3.0.2
mashumaro==3.14
mccabe==0.7.0
mdurl==0.1.2
more-itertools==10.5.0
msgpack==1.1.0
mypy==1.14.1
mypy-extensions==1.0.0
networkx==3.2.1 ; python_full_version < '3.10'
networkx==3.4.2 ; python_full_version >= '3.10'
nodeenv==1.9.1
ordered-set==4.1.0
packaging==24.2
parsedatetime==2.6
pathspec==0.12.1
platformdirs==4.3.6
pluggy==1.5.0
pre-commit==4.0.1
protobuf==5.29.2
pydantic==2.10.4
pydantic-core==2.27.2
pygments==2.18.0
pylint==3.3.3
pytest==7.4.4
python-dateutil==2.9.0.post0
python-slugify==8.0.4
pytimeparse==1.1.8
pytz==2024.2
pyyaml==6.0.2
referencing==0.35.1
requests==2.32.3
rich==13.9.4
rpds-py==0.22.3
ruamel-yaml==0.18.7
ruamel-yaml-clib==0.2.12 ; platform_python_implementation == 'CPython'
six==1.17.0
smmap==5.0.1
snowplow-tracker==1.0.4
sqlparse==0.5.3
text-unidecode==1.3
tomli==2.2.1 ; python_full_version < '3.11'
tomlkit==0.13.2
types-requests==2.32.0.20241016
typing-extensions==4.12.2
tzdata==2024.2 ; sys_platform == 'win32'
urllib3==2.3.0
virtualenv==20.28.0
zipp==3.21.0
1 change: 1 addition & 0 deletions src/dbt_osmosis/core/osmosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
T = t.TypeVar("T")

EMPTY_STRING = ""
"""A null string constant for use in placeholder lists, this is always considered undocumented"""

SKIP_PATTERNS = "_column_ignore_patterns"
"""This key is used to skip certain column name patterns in dbt-osmosis"""
Expand Down
Loading

0 comments on commit 40920e6

Please sign in to comment.