Skip to content

Commit

Permalink
🩹 prevent lock update with tools and uv setup guide (#254)
Browse files Browse the repository at this point in the history
* 🐛 prevent lock update during tool runs

* 📝 `uv` in the contribution guide

* 📝 fix the `uv` guidelines
  • Loading branch information
miloth authored Dec 3, 2024
1 parent 16986c0 commit 9291222
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,11 @@ Enhancement suggestions are tracked as [GitHub issues][bug].

### Your First Code Contribution

Ensure you have [`poetry`](https://python-poetry.org/docs/#installation) and
[`poe`](https://poethepoet.natn.io/installation.html) installed.
Now you can install the dev dependencies:
Ensure you have [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installed.
Now you can install the project with the dev dependencies:

```bash
poetry install
uv sync --frozen
```

### pre-commit
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ lint = ["check", "format"]
pre-commit = "pre-commit run --all-files"

_test_bpr = "basedpyright tests"
_test_mypy = "uv run --no-editable --isolated mypy --config-file=pyproject.toml tests"
_test_mypy = "uv run --frozen --no-editable --isolated mypy --config-file=pyproject.toml tests"
typetest = ["_test_bpr", "_test_mypy"]

[tool.poe.tasks.pyright]
cmd = "basedpyright $path"
args = [{name = "path", positional = true, multiple = true, default = "scipy-stubs codegen"}]

[tool.poe.tasks.mypy]
cmd = "uv run --no-editable --isolated mypy --config-file=pyproject.toml $path"
cmd = "uv run --frozen --no-editable --isolated mypy --config-file=pyproject.toml $path"
args = [{name = "path", positional = true, multiple = true, default = "scipy-stubs codegen"}]

[tool.poe.tasks.stubtest]
cmd = """
uv run --no-editable --isolated
uv run --frozen --no-editable --isolated
stubtest
--mypy-config-file=pyproject.toml
--allowlist=.mypyignore
Expand Down

0 comments on commit 9291222

Please sign in to comment.