JulianKarlBauer / JulianKarlBauer/python_template

Migrate to uv / ruff

未关闭
#4 1 条评论 0 个 reaction 已指派 2 人 已被 @JulianKarlBauer 认领 在 GitHub 查看
enhancement
主要语言
Python
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

Use uv and ruff. This can be done along the following lines:

1 .Initiate a new packaged project using

```bash
uv init --python 3.12 --package
```

Environments are created automatically.

2. Add a license.

3. Add tests:

```bash
uv add --dev pytest
mkdir tests
touch tests/test_basic.py
```

Write a simple test, e.g.
```python
# tests/test_basic.py
from my_package import __version__

def test_version():
assert isinstance(__version__, str)
```

Run test
```bash
uv run pytest
```

4. Add pre-commit and other desired dependencies
```bash
uv add --dev pre-commit ruff mypy
```

5. Specify `pre-commit-config.yaml`.

6. Consider the following ideas:

Modern projects also share *folder settings* for VS-code in a `.vscode` folder with `settings.json`. VS Code add-ons can be recommended as well.

7. Add documentation.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。