Skip to content

Commit

Permalink
Enable UV support in template (#52)
Browse files Browse the repository at this point in the history
* Enable UV support in template

* Update changelog

* Fix test

* Add tool.dso to pyproject.toml
grst authored Nov 11, 2024
1 parent 0929573 commit 87b6338
Showing 6 changed files with 69 additions and 47 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ repos:
rev: "2.2.4"
hooks:
- id: pyproject-fmt
exclude: "^src/dso/templates/.*"
- repo: local
hooks:
- id: forbid-to-commit
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -12,11 +12,13 @@ and this project adheres to [Semantic Versioning][].

### Template updates
- Improve instruction text in quarto template to get users started more quickly ([#40](https://github.com/Boehringer-Ingelheim/dso/pull/40))
- Add `.gitignore` catch-all clauses for `output` and `report` folders in stages to not pick up data and repots being tracked via git ([#46](https://github.com/Boehringer-Ingelheim/dso/issues/46)).
- Every dso project is now also a [uv project](https://docs.astral.sh/uv/concepts/projects/#building-projects) declaring Python dependencies in `pyproject.toml`. This makes it possible to
use a different dso version per project and makes it easy to work with virtual Python environments ([#52](https://github.com/Boehringer-Ingelheim/dso/pull/52))

### Fixes
- Remove vendored `hiyapyco` code since required changes were released upstream in v0.7.0 ([#45](https://github.com/Boehringer-Ingelheim/dso/pull/45)).
- `None` values in `params.in.yaml` can now be used to override anything, e.g. to disable watermarking only in a specific stage ([#45](https://github.com/Boehringer-Ingelheim/dso/pull/45)).
- Add `.gitignore` catch-all clauses for `output` and `report` folders in stages to not pick up data and repots being tracked via git ([#46](https://github.com/Boehringer-Ingelheim/dso/issues/46)).

## v0.9.0

3 changes: 3 additions & 0 deletions src/dso/templates/init/default/.gitignore
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
.dso.jso
params.yaml

# uv
.venv

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

This file was deleted.

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

[tool.dso]
use_dso_mgr = true

[tool.uv]
package = false

[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" ]
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
@@ -55,9 +55,9 @@ def test_git_list_files(dso_project):
".gitattributes",
".gitignore",
".pre-commit-config.yaml",
".ruff.toml",
"README.md",
"dvc.yaml",
"params.in.yaml",
"pyproject.toml",
]
]

0 comments on commit 87b6338

Please sign in to comment.