Skip to content

Commit

Permalink
Enable UV support in template
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Nov 11, 2024
1 parent 0929573 commit 852216a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 45 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ repos:
rev: "2.2.4"
hooks:
- id: pyproject-fmt
exclude: "^src/dso/templates/.*"
- repo: local
hooks:
- id: forbid-to-commit
Expand Down
3 changes: 3 additions & 0 deletions src/dso/templates/init/default/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.dso.jso
params.yaml

# uv
.venv

# Editors
*.code-workspace
.vscode
Expand Down
45 changes: 0 additions & 45 deletions src/dso/templates/init/default/.ruff.toml

This file was deleted.

55 changes: 55 additions & 0 deletions src/dso/templates/init/default/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[project]
name = "dsoproj"
version = "0.1.0dev"
description = "{{ project_description }}"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"dso-core>=0.9",
]

[tool.ruff]
line-length = 120
extend-include = [ "*.ipynb" ]

lint.select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # Error detected by Pycodestyle
"F", # Errors detected by Pyflakes
"I", # isort
"RUF100", # Report unused noqa directives
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # Warning detected by Pycodestyle
]
lint.ignore = [
# Errors from function calls in argument defaults. These are fine when the result is immutable.
"B008",
# Missing docstring in public module
"D100",
# Missing docstring in public package
"D104",
# __magic__ methods are are often self-explanatory, allow missing docstrings
"D105",
# Missing docstring in __init__
"D107",
## Disable one in each pair of mutually incompatible rules
# We don’t want a blank line before a class docstring
"D203",
# We want docstrings to start immediately after the opening triple quote
"D213",
# first line should end with a period [Bug: doesn't work with single-line docstrings]
"D400",
# First line should be in imperative mood; try rephrasing
"D401",
# line too long -> we accept long comment lines; black gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix
"E741",
]
lint.unfixable = [ "F841" ]

0 comments on commit 852216a

Please sign in to comment.