Skip to content

Commit

Permalink
Configure project
Browse files Browse the repository at this point in the history
  • Loading branch information
druzhinin-kirill committed Feb 22, 2024
1 parent fbe21e1 commit 3713325
Show file tree
Hide file tree
Showing 9 changed files with 1,318 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# PyCharm
.idea

# VisualStudioCode
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# PyBuilder
.pybuilder/
target/

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# ruff
.ruff_cache/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
args: [ --fix ]
description: Run linter with fixes enabled
- id: ruff-format
description: Run formatter
- repo: local
hooks:
- id: tox
name: tox
description: Run tox
entry: pdm run tox
language: system
pass_filenames: false
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Welcome to dbt-score
8 changes: 8 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
site_name: dbt-score
theme:
name: material
plugins:
- search
- mkdocstrings
nav:
- Home: index.md
1,063 changes: 1,063 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[project]
name = "dbt-score"
dynamic = ["version"]

description = "Linter for dbt model metadata."
authors = [
{name = "Kirill Druzhinin", email = "[email protected]"},
{name = "Jochem van Dooren", email = "[email protected]"},
{name = "Matthieu Caneill ", email = "[email protected]"},
]
dependencies = [
"dbt>=1.0.0.36.4",
]
requires-python = ">=3.8"
readme = "README.md"
license = {text = "MIT"}

[tool.pdm]
[tool.pdm.dev-dependencies]
dev = [
"tox-pdm~=0.7.2",
"tox~=4.13",
]
lint = [
"ruff~=0.2.2",
"mypy~=1.8",
]
test = [
"pytest~=8.0",
"coverage[toml]~=7.4"
]
docs = [
"mkdocs-material~=9.5",
"mkdocstrings[python]~=0.24.0"
]

[tool.pdm.version]
source = "scm"

### Mypy ###

[tool.mypy]
strict = true

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false

### Ruff ###

[tool.ruff]
line-length = 88

[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.lint.pydocstyle]
convention = "google"

### Coverage ###

[tool.coverage.run]
source = [
"tests",
"src"
]

[tool.coverage.report]
show_missing = true
fail_under = 80
Empty file added src/dbt_score/__init__.py
Empty file.
Empty file added tests/__init__.py
Empty file.
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
env_list = py38,py39,py310,py311,lint,docs

skip_missing_interpreters = true

[testenv]
description = Run tests
groups = test
commands =
pytest
coverage run -m pytest

[testenv:lint]
description = Run lint
groups = lint
commands =
ruff check .
mypy .

[testenv:docs]
description = Build docs
groups = docs
commands =
mkdocs build --clean

0 comments on commit 3713325

Please sign in to comment.