Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
rnicholus committed Sep 28, 2024
2 parents 1c48ad3 + 8fd63ec commit b55485b
Show file tree
Hide file tree
Showing 121 changed files with 2,237 additions and 2,940 deletions.
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
skip: ["eslint"]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.6.8
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -16,7 +16,7 @@ repos:
require_serial: true
additional_dependencies:
- "[email protected]"
- "[email protected].6"
- "[email protected].7"
- "[email protected]"
- id: stylelint
name: stylelint
Expand All @@ -26,12 +26,14 @@ repos:
require_serial: true
additional_dependencies:
- "[email protected]"
- "[email protected].0"
- "[email protected].1"
- "[email protected]"
- "[email protected]"
- id: eslint
name: eslint
language: node
entry: ./frontend/node_modules/eslint/bin/eslint.js --max-warnings 0
entry:
./frontend/node_modules/eslint/bin/eslint.js --config
frontend/eslint.config.mjs --fix --max-warnings 0
require_serial: true
files: frontend/.*\.(js|ts|svelte)$
files: frontend/.*\.(js|mjs|ts|svelte)$
36 changes: 19 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FRONTEND_SOURCES := $(shell find frontend/src frontend/css -type f)

all: src/fava/static/app.js

# Compile the frontend.
src/fava/static/app.js: $(FRONTEND_SOURCES) frontend/build.ts frontend/node_modules
cd frontend; npm run build
Expand All @@ -9,12 +11,11 @@ frontend/node_modules: frontend/package-lock.json
cd frontend; npm install --no-progress
touch -m frontend/node_modules

.PHONY: dev
dev: .venv
# Create and sync a dev environment.
.venv: constraints.txt requirements.txt pyproject.toml
uv venv --allow-existing
uv pip sync requirements.txt

.venv:
uv venv
touch -m .venv

# Remove the generated frontend and translations in addition to mostlyclean (see below).
.PHONY: clean
Expand All @@ -40,8 +41,8 @@ mostlyclean:
.PHONY: lint
lint: frontend/node_modules
pre-commit run -a
cd frontend; npx tsc
cd frontend; npx svelte-check
cd frontend; npm exec tsc
cd frontend; npm exec svelte-check
tox -e lint

# Run tests.
Expand All @@ -60,8 +61,8 @@ update-snapshots:
# Update the constraints file for Python dependencies
.PHONY: update-constraints
update-constraints:
uv pip compile --quiet --extra excel --extra dev --upgrade --output-file constraints.txt pyproject.toml
uv pip compile --quiet --extra excel --extra old_deps_pins --resolution=lowest --upgrade --output-file constraints-old.txt pyproject.toml
uv pip compile --quiet --extra excel --extra dev --python-version 3.8 --upgrade --output-file constraints.txt pyproject.toml
uv pip compile --quiet --extra excel --extra old_deps_pins --resolution=lowest --python-version 3.8 --upgrade --output-file constraints-old.txt pyproject.toml

# Update the frontend dependencies.
.PHONY: update-frontend-deps
Expand Down Expand Up @@ -93,8 +94,9 @@ run-example:

# Generate the bql-grammar json file used by the frontend.
.PHONY: bql-grammar
bql-grammar:
tox exec -e lint -- python contrib/scripts.py generate-bql-grammar-json
bql-grammar: .venv contrib/scripts.py constraints.txt
uv run --no-sync python contrib/scripts.py generate-bql-grammar-json
-pre-commit run prettier --files frontend/src/codemirror/bql-grammar.ts

# Build the distribution (sdist and wheel).
.PHONY: dist
Expand All @@ -110,20 +112,20 @@ before-release: bql-grammar translations-push translations-fetch

# Extract translation strings.
.PHONY: translations-extract
translations-extract:
pybabel extract -F src/fava/translations/babel.conf -o src/fava/translations/messages.pot .
translations-extract: .venv
uv run --no-sync pybabel extract -F src/fava/translations/babel.conf -o src/fava/translations/messages.pot .

# Extract translation strings and upload them to POEditor.com.
# Requires the environment variable POEDITOR_TOKEN to be set to an API token
# for POEditor.
.PHONY: translations-push
translations-push: translations-extract
tox exec -e lint -- python contrib/scripts.py upload-translations
translations-push: .venv translations-extract
uv run --no-sync python contrib/scripts.py upload-translations

# Download translations from POEditor.com. (also requires POEDITOR_TOKEN)
.PHONY: translations-fetch
translations-fetch:
tox exec -e lint -- python contrib/scripts.py download-translations
translations-fetch: .venv
uv run --no-sync python contrib/scripts.py download-translations

# Create a binary using pyinstaller
dist/fava: src/fava/static/app.js
Expand Down
7 changes: 6 additions & 1 deletion constraints-old.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --extra excel --extra old_deps_pins --resolution=lowest --output-file constraints-old.txt pyproject.toml
# uv pip compile --extra excel --extra old_deps_pins --resolution=lowest --python-version 3.8 --output-file constraints-old.txt pyproject.toml
anyio==3.0.0
# via watchfiles
attrs==19.2.0
Expand All @@ -26,6 +26,8 @@ click==8.0.0
# flask
et-xmlfile==1.0.0
# via openpyxl
exceptiongroup==1.0.0
# via pytest
flask==2.2.0
# via
# fava (pyproject.toml)
Expand All @@ -41,6 +43,7 @@ idna==2.8
importlib-metadata==3.6.0
# via
# fava (pyproject.toml)
# flask
# pluggy
iniconfig==0.1
# via pytest
Expand Down Expand Up @@ -133,6 +136,8 @@ sniffio==1.1.0
# via anyio
texttable==0.8.3
# via pyexcel
tomli==1.0.0
# via pytest
watchfiles==0.20.0
# via fava (pyproject.toml)
werkzeug==2.2.0
Expand Down
98 changes: 67 additions & 31 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --extra excel --extra dev --output-file constraints.txt pyproject.toml
alabaster==1.0.0
# uv pip compile --extra excel --extra dev --python-version 3.8 --output-file constraints.txt pyproject.toml
alabaster==0.7.13
# via sphinx
altgraph==0.17.4
# via pyinstaller
anyio==4.4.0
anyio==4.5.0
# via watchfiles
astroid==3.2.4
# via pylint
Expand All @@ -13,6 +13,8 @@ babel==2.16.0
# fava (pyproject.toml)
# flask-babel
# sphinx
backports-tarfile==1.2.0
# via jaraco-context
beancount==2.3.6
# via fava (pyproject.toml)
beautifulsoup4==4.12.3
Expand Down Expand Up @@ -58,13 +60,17 @@ dill==0.3.8
# via pylint
distlib==0.3.8
# via virtualenv
docutils==0.21.2
docutils==0.20.1
# via
# readme-renderer
# sphinx
et-xmlfile==1.1.0
# via openpyxl
filelock==3.16.0
exceptiongroup==1.2.2
# via
# anyio
# pytest
filelock==3.16.1
# via
# tox
# virtualenv
Expand All @@ -76,11 +82,11 @@ flask-babel==4.0.0
# via fava (pyproject.toml)
furo==2024.8.6
# via fava (pyproject.toml)
google-api-core==2.19.2
google-api-core==2.20.0
# via google-api-python-client
google-api-python-client==2.145.0
google-api-python-client==2.147.0
# via beancount
google-auth==2.34.0
google-auth==2.35.0
# via
# google-api-core
# google-api-python-client
Expand All @@ -102,7 +108,18 @@ idna==3.10
imagesize==1.4.1
# via sphinx
importlib-metadata==8.5.0
# via twine
# via
# build
# flask
# keyring
# pyinstaller
# pyinstaller-hooks-contrib
# sphinx
# twine
importlib-resources==6.4.5
# via
# keyring
# tox-uv
iniconfig==2.0.0
# via pytest
isort==5.13.2
Expand All @@ -127,7 +144,7 @@ jinja2==3.1.4
# flask
# flask-babel
# sphinx
keyring==25.3.0
keyring==25.4.1
# via twine
lml==0.1.0
# via
Expand Down Expand Up @@ -179,7 +196,7 @@ pdfminer2==20151206
# via beancount
pkginfo==1.10.0
# via twine
platformdirs==4.3.3
platformdirs==4.3.6
# via
# pylint
# tox
Expand All @@ -192,11 +209,11 @@ ply==3.11
# via
# fava (pyproject.toml)
# beancount
pre-commit==3.8.0
pre-commit==3.5.0
# via fava (pyproject.toml)
proto-plus==1.24.0
# via google-api-core
protobuf==5.28.1
protobuf==5.28.2
# via
# google-api-core
# googleapis-common-protos
Expand Down Expand Up @@ -236,7 +253,7 @@ pylint==3.2.7
# via fava (pyproject.toml)
pyparsing==3.1.4
# via httplib2
pyproject-api==1.7.1
pyproject-api==1.8.0
# via tox
pyproject-hooks==1.1.0
# via build
Expand All @@ -252,10 +269,12 @@ python-dateutil==2.9.0.post0
python-magic==0.4.27
# via beancount
pytz==2024.2
# via flask-babel
# via
# babel
# flask-babel
pyyaml==6.0.2
# via pre-commit
readme-renderer==44.0
readme-renderer==43.0
# via twine
requests==2.32.3
# via
Expand All @@ -274,7 +293,7 @@ rsa==4.9
# via google-auth
secretstorage==3.3.3
# via keyring
setuptools==75.0.0
setuptools==75.1.0
# via
# fava (pyproject.toml)
# pyinstaller
Expand All @@ -291,55 +310,70 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.6
# via beautifulsoup4
sphinx==8.0.2
sphinx==7.1.2
# via
# fava (pyproject.toml)
# furo
# sphinx-autodoc-typehints
# sphinx-basic-ng
sphinx-autodoc-typehints==2.4.1
sphinx-autodoc-typehints==2.0.1
# via fava (pyproject.toml)
sphinx-basic-ng==1.0.0b2
# via furo
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==2.0.0
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
texttable==1.7.0
# via pyexcel
tomli==2.0.1
# via
# build
# coverage
# mypy
# pylint
# pyproject-api
# pytest
# tox
tomlkit==0.13.2
# via pylint
tox==4.18.1
tox==4.20.0
# via
# fava (pyproject.toml)
# tox-uv
tox-uv==1.11.3
tox-uv==1.13.0
# via fava (pyproject.toml)
twine==5.1.1
# via fava (pyproject.toml)
types-setuptools==74.1.0.20240907
types-setuptools==75.1.0.20240917
# via fava (pyproject.toml)
types-simplejson==3.19.0.20240801
# via fava (pyproject.toml)
typing-extensions==4.12.2
# via mypy
# via
# anyio
# astroid
# mypy
# pylint
# rich
# tox-uv
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.3
# via
# requests
# twine
uv==0.4.10
uv==0.4.16
# via tox-uv
virtualenv==20.26.4
virtualenv==20.26.5
# via
# pre-commit
# tox
Expand All @@ -350,4 +384,6 @@ werkzeug==3.0.4
# fava (pyproject.toml)
# flask
zipp==3.20.2
# via importlib-metadata
# via
# importlib-metadata
# importlib-resources
Loading

0 comments on commit b55485b

Please sign in to comment.