Skip to content

Commit

Permalink
switch from rye to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Nov 24, 2024
1 parent f2bc7cc commit 1fd7e70
Show file tree
Hide file tree
Showing 9 changed files with 1,444 additions and 315 deletions.
7 changes: 3 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM ubuntu:24.04
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN apt-get update && apt-get install -y \
zsh git make curl \
zsh git make \
npm

# chromium dependencies
RUN apt-get install -y fonts-noto-color-emoji libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxdamage1 libpango-1.0-0 libcairo2 libasound2t64

USER ubuntu
RUN curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION=--yes bash

ENV LC_ALL="en_US.UTF-8"
USER ubuntu
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.2
3.12
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ deps-js-update:
cd frontend; npx npm-check-updates -i

deps-py:
rye sync
uv sync

deps-py-update:
rye lock --update-all
uv lock --upgrade

deps: deps-js deps-py

Expand All @@ -34,27 +34,30 @@ test: test-js

## Utils
run:
cd example; rye run fava example.beancount
cd example; uv run fava example.beancount

run-debug:
cd example; rye run fava --debug example.beancount
cd example; uv run fava --debug example.beancount

lint:
cd frontend; npx tsc --noEmit
rye run mypy src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
rye run pylint src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
uv run mypy src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
uv run pylint src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py

format:
cd frontend; npx prettier -w . ../src/fava_dashboards/templates/*.css
rye run black src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
find example -name '*.beancount' -exec rye run bean-format -c 59 -o "{}" "{}" \;
uv run black src/fava_dashboards/__init__.py scripts/format_js_in_dashboard.py
find example -name '*.beancount' -exec uv run bean-format -c 59 -o "{}" "{}" \;
./scripts/format_js_in_dashboard.py example/dashboards.yaml

ci:
make lint
make build
make run &
make test

make format

# https://github.com/astral-sh/uv/issues/7533
git restore uv.lock

git diff --exit-code
2 changes: 1 addition & 1 deletion example/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ dashboards:
years.map((year) =>
ext.api.get("query", {
bql: `SELECT currency,
CONVERT(SUM(position), '${ledger.ccy}') as market_value
CONVERT(SUM(position), '${ledger.ccy}', ${year}-12-31) as market_value
FROM CLOSE ON ${year + 1}-01-01
WHERE account_sortkey(account) ~ '^[01]'
GROUP BY currency`,
Expand Down
1 change: 1 addition & 0 deletions frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
dependencies = [
"fava>=1.26.1",
"pyyaml>=6.0.1",
"beanquery>=0.1.dev0",
"beanquery>=0.1.0",
]
readme = "README.md"
requires-python = ">= 3.8"
Expand All @@ -21,9 +21,8 @@ Source = "https://github.com/andreasgerstmayr/fava-dashboards"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
[dependency-groups]
dev = [
"black>=24.3.0",
"mypy>=1.9.0",
"pylint>=3.1.0",
Expand Down
161 changes: 0 additions & 161 deletions requirements-dev.lock

This file was deleted.

135 changes: 0 additions & 135 deletions requirements.lock

This file was deleted.

Loading

0 comments on commit 1fd7e70

Please sign in to comment.