Skip to content

Commit

Permalink
move to rye
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Mar 20, 2024
1 parent a7e639a commit 3024228
Show file tree
Hide file tree
Showing 10 changed files with 400 additions and 1,468 deletions.
6 changes: 4 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM ubuntu:23.10
RUN apt-get update && apt-get install -y \
zsh git make \
python3-setuptools pipenv \
zsh git make curl \
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 libasound2

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

ENV LC_ALL="en_US.UTF-8"
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
build
dist
__pycache__
# python generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# venv
.venv
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.2
16 changes: 8 additions & 8 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:
pipenv install -d
rye sync

deps-py-update:
pipenv update
rye lock --update-all

deps: deps-js deps-py

Expand All @@ -34,20 +34,20 @@ test: test-js

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

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

lint:
cd frontend; npx tsc --noEmit
pipenv run mypy src/fava_portfolio_returns/__init__.py
pipenv run pylint src/fava_portfolio_returns/__init__.py
rye run mypy src/fava_portfolio_returns/__init__.py
rye run pylint src/fava_portfolio_returns/__init__.py

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

ci:
make lint
Expand Down
15 changes: 0 additions & 15 deletions Pipfile

This file was deleted.

1,412 changes: 0 additions & 1,412 deletions Pipfile.lock

This file was deleted.

41 changes: 38 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
[project]
name = "fava-portfolio-returns"
dynamic = ["version"]
description = "fava-portfolio-returns shows portfolio returns in Fava"
authors = [
{ name = "Andreas Gerstmayr", email = "[email protected]" }
]
dependencies = [
"fava>=1.26",
"beangrow @ git+https://github.com/beancount/beangrow",
"protobuf<3.21",
]
readme = "README.md"
requires-python = ">= 3.8"
license = {text = "GPL-2.0"}

[project.urls]
Source = "https://github.com/andreasgerstmayr/fava-portfolio-returns"

[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"black>=24.3.0",
"mypy>=1.9.0",
"pylint>=3.1.0",
"types-PyYAML>=6.0.12.20240311",
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.version]
source = "vcs"

[tool.setuptools_scm]
[tool.hatch.build.targets.wheel]
packages = ["src/fava_portfolio_returns"]

[tool.pylint.'messages control']
disable = [
Expand Down
183 changes: 183 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false

-e file:.
astroid==3.1.0
# via pylint
babel==2.14.0
# via fava
# via flask-babel
beancount==2.3.6
# via beangrow
# via fava
beangrow @ git+https://github.com/beancount/beangrow
# via fava-portfolio-returns
beautifulsoup4==4.12.3
# via beancount
black==24.3.0
blinker==1.7.0
# via flask
bottle==0.12.25
# via beancount
cachetools==5.3.3
# via google-auth
certifi==2024.2.2
# via requests
chardet==5.2.0
# via beancount
charset-normalizer==3.3.2
# via requests
cheroot==10.0.0
# via fava
click==8.1.7
# via black
# via fava
# via flask
contourpy==1.2.0
# via matplotlib
cycler==0.12.1
# via matplotlib
dill==0.3.8
# via pylint
fava==1.27.3
# via fava-portfolio-returns
flask==3.0.2
# via fava
# via flask-babel
flask-babel==4.0.0
# via fava
fonttools==4.50.0
# via matplotlib
google-api-core==2.17.1
# via google-api-python-client
google-api-python-client==2.122.0
# via beancount
google-auth==2.29.0
# via google-api-core
# via google-api-python-client
# via google-auth-httplib2
google-auth-httplib2==0.2.0
# via google-api-python-client
googleapis-common-protos==1.63.0
# via google-api-core
httplib2==0.22.0
# via google-api-python-client
# via google-auth-httplib2
idna==3.6
# via requests
iniconfig==2.0.0
# via pytest
isort==5.13.2
# via pylint
itsdangerous==2.1.2
# via flask
jaraco-functools==4.0.0
# via cheroot
jinja2==3.1.3
# via fava
# via flask
# via flask-babel
kiwisolver==1.4.5
# via matplotlib
lxml==5.1.0
# via beancount
markdown2==2.4.13
# via fava
markupsafe==2.1.5
# via jinja2
# via werkzeug
matplotlib==3.8.3
# via beangrow
mccabe==0.7.0
# via pylint
more-itertools==10.2.0
# via cheroot
# via jaraco-functools
mypy==1.9.0
mypy-extensions==1.0.0
# via black
# via mypy
numpy==1.26.4
# via beangrow
# via contourpy
# via matplotlib
# via pandas
# via scipy
packaging==24.0
# via black
# via matplotlib
# via pytest
pandas==2.2.1
# via beangrow
pathspec==0.12.1
# via black
pdfminer2==20151206
# via beancount
pillow==10.2.0
# via matplotlib
platformdirs==4.2.0
# via black
# via pylint
pluggy==1.4.0
# via pytest
ply==3.11
# via beancount
# via fava
protobuf==3.20.3
# via fava-portfolio-returns
# via google-api-core
# via googleapis-common-protos
pyasn1==0.5.1
# via pyasn1-modules
# via rsa
pyasn1-modules==0.3.0
# via google-auth
pylint==3.1.0
pyparsing==3.1.2
# via httplib2
# via matplotlib
pytest==8.1.1
# via beancount
python-dateutil==2.9.0.post0
# via beancount
# via matplotlib
# via pandas
python-magic==0.4.27
# via beancount
pytz==2024.1
# via flask-babel
# via pandas
requests==2.31.0
# via beancount
# via google-api-core
rsa==4.9
# via google-auth
scipy==1.12.0
# via beangrow
simplejson==3.19.2
# via fava
six==1.16.0
# via pdfminer2
# via python-dateutil
soupsieve==2.5
# via beautifulsoup4
tomlkit==0.12.4
# via pylint
types-pyyaml==6.0.12.20240311
typing-extensions==4.10.0
# via mypy
tzdata==2024.1
# via pandas
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.1
# via requests
werkzeug==3.0.1
# via fava
# via flask
Loading

0 comments on commit 3024228

Please sign in to comment.