diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a9cd36..d7866a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: push: branches: - - main + - master paths-ignore: - 'docs/**' @@ -18,14 +18,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [ "3.8", "3.9", "3.10", "3.11" ] + python: [ "3.10", "3.11" ] steps: - uses: actions/checkout@v4 - name: Set up PDM uses: pdm-project/setup-pdm@v3 with: - python-version: '3.8' + python-version: '3.10' - name: Install dependencies run: | diff --git a/README.md b/README.md index dcb5dfd..1fcef50 100644 --- a/README.md +++ b/README.md @@ -1 +1,65 @@ # dbt-score + +Linter for dbt model metadata. + +## Development + +### Prerequisites + +You'll need the following prerequisites: + +* Any Python version starting from 3.10 +* [pre-commit](https://pre-commit.com/) +* [PDM](https://pdm-project.org/2.12/) + +Configure development environment running these commands from the project's root: + +```shell +pre-commit install +pdm install --group :all +``` + +### Lint + +`dbt_score` uses: +* [ruff](https://docs.astral.sh/ruff/) for fast linting and formatting. +* [mypy](https://mypy.readthedocs.io/en/stable/) for type checking. +* [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks). + +Cheatsheet: + +```shell +pdm run ruff check . +pdm run ruff check --fix +pdm run mypy . +pre-commit run --all-files +pdm run tox -e lint +``` + +### Test + +`dbt_score` uses: +* [pytest](https://docs.pytest.org/) as a main test framework. +* [coverage](https://coverage.readthedocs.io/en/latest/index.html) for test coverage. +* [tox](https://tox.wiki/en/latest/) for testing against multiple Python versions. + +Cheatsheet: + +```shell +pdm run tox -e py +pdm run pytest +pdm run coverage run -m pytest +``` + +### Docs + +`dbt_score` uses: +* [mkdocs](https://www.mkdocs.org/) for docs generation. +* [mkdocstrings](https://mkdocstrings.github.io/) for automatic docs from sources. + +Cheatsheet: + +```shell +pdm run mkdocs build +pdm run mkdocs serve +``` diff --git a/pdm.lock b/pdm.lock index a257bcf..67e98ec 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "docs", "lint", "test"] strategy = ["cross_platform"] lock_version = "4.4.1" -content_hash = "sha256:5ea94bd4c525d60c69d2de9d0019ca844218904d72097f82d2798a7bde9649fc" +content_hash = "sha256:21c983e967500b34040e0a82ce405cf6ac45c67f417783d76bde67a25f28f562" [[package]] name = "agate" @@ -29,9 +29,6 @@ name = "annotated-types" version = "0.6.0" requires_python = ">=3.8" summary = "Reusable constraint types to use with typing.Annotated" -dependencies = [ - "typing-extensions>=4.0.0; python_version < \"3.9\"", -] files = [ {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, @@ -52,9 +49,6 @@ name = "babel" version = "2.14.0" requires_python = ">=3.7" summary = "Internationalization utilities" -dependencies = [ - "pytz>=2015.7; python_version < \"3.9\"", -] files = [ {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, @@ -528,19 +522,6 @@ files = [ {file = "importlib_metadata-6.11.0.tar.gz", hash = "sha256:1231cf92d825c9e03cfc4da076a16de6422c863558229ea0b22b675657463443"}, ] -[[package]] -name = "importlib-resources" -version = "6.1.1" -requires_python = ">=3.8" -summary = "Read resources from Python packages" -dependencies = [ - "zipp>=3.1.0; python_version < \"3.10\"", -] -files = [ - {file = "importlib_resources-6.1.1-py3-none-any.whl", hash = "sha256:e8bf90d8213b486f428c9c39714b920041cb02c184686a3dee24905aaa8105d6"}, - {file = "importlib_resources-6.1.1.tar.gz", hash = "sha256:3893a00122eafde6894c59914446a512f728a0c1a45f9bb9b63721b6bacf0b4a"}, -] - [[package]] name = "iniconfig" version = "2.0.0" @@ -583,9 +564,7 @@ requires_python = ">=3.8" summary = "An implementation of JSON Schema validation for Python" dependencies = [ "attrs>=22.2.0", - "importlib-resources>=1.4.0; python_version < \"3.9\"", "jsonschema-specifications>=2023.03.6", - "pkgutil-resolve-name>=1.3.10; python_version < \"3.9\"", "referencing>=0.28.4", "rpds-py>=0.7.1", ] @@ -600,7 +579,6 @@ version = "2023.12.1" requires_python = ">=3.8" summary = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry" dependencies = [ - "importlib-resources>=1.4.0; python_version < \"3.9\"", "referencing>=0.31.0", ] files = [ @@ -630,9 +608,6 @@ name = "markdown" version = "3.5.2" requires_python = ">=3.8" summary = "Python implementation of John Gruber's Markdown." -dependencies = [ - "importlib-metadata>=4.4; python_version < \"3.10\"", -] files = [ {file = "Markdown-3.5.2-py3-none-any.whl", hash = "sha256:d43323865d89fc0cb9b20c75fc8ad313af307cc087e84b657d9eec768eddeadd"}, {file = "Markdown-3.5.2.tar.gz", hash = "sha256:e1ac7b3dc550ee80e602e71c1d168002f062e49f1b11e26a36264dafd4df2ef8"}, @@ -746,7 +721,6 @@ dependencies = [ "click>=7.0", "colorama>=0.4; platform_system == \"Windows\"", "ghp-import>=1.0", - "importlib-metadata>=4.3; python_version < \"3.10\"", "jinja2>=2.11.1", "markdown>=3.2.1", "markupsafe>=2.0.1", @@ -820,12 +794,10 @@ dependencies = [ "Markdown>=3.3", "MarkupSafe>=1.1", "click>=7.0", - "importlib-metadata>=4.6; python_version < \"3.10\"", "mkdocs-autorefs>=0.3.1", "mkdocs>=1.4", "platformdirs>=2.2.0", "pymdown-extensions>=6.3", - "typing-extensions>=4.1; python_version < \"3.10\"", ] files = [ {file = "mkdocstrings-0.24.0-py3-none-any.whl", hash = "sha256:f4908560c10f587326d8f5165d1908817b2e280bbf707607f601c996366a2264"}, @@ -1032,16 +1004,6 @@ files = [ {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, ] -[[package]] -name = "pkgutil-resolve-name" -version = "1.3.10" -requires_python = ">=3.6" -summary = "Resolve a name to an object." -files = [ - {file = "pkgutil_resolve_name-1.3.10-py3-none-any.whl", hash = "sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e"}, - {file = "pkgutil_resolve_name-1.3.10.tar.gz", hash = "sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174"}, -] - [[package]] name = "platformdirs" version = "4.2.0" diff --git a/pyproject.toml b/pyproject.toml index d5d1a95..5d61411 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,9 +11,9 @@ authors = [ {name = "Picnic Analyst Development Platform", email = "analyst-development-platform@teampicnic.com"} ] dependencies = [ - "dbt-core~=1.7", + "dbt-core>=1.5", ] -requires-python = ">=3.8" +requires-python = ">=3.10" readme = "README.md" license = {text = "MIT"} diff --git a/tox.ini b/tox.ini index 7272d7c..b13b2e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -env_list = py{38,39,310,311},lint,docs +env_list = py{310,311},lint,docs skip_missing_interpreters = true