Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PEP 621 compliant pyproject.toml #38

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ There are three related scripts:
side-product. This script can read that file and fetch those missing dates,
which you can insert in your ledger and then rerun compute_returns.py for a
more precise calculation.

## Example

To run the example:
```
cd example
uv run beangrow-returns ledger.beancount config.pbtxt ./reports
```

The reports are available at `example/reports/groups`.
File renamed without changes.
32 changes: 15 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ['setuptools']
build-backend = 'setuptools.build_meta'

[tool.poetry]
[project]
name = "beangrow"
version = '1.0.1'
description = 'Returns calculations on portfolios in Beancount Resources'
Expand All @@ -26,26 +26,24 @@ classifiers = [
'Programming Language :: SQL',
'Topic :: Office/Business :: Financial :: Accounting',
]
packages = [
{ include = "beangrow", from = "." },
requires-python = '>= 3.10'
dependencies = [
'numpy >= 1.26.4',
'pandas >= 2.2.2',
'matplotlib >= 3.9.0',
'beancount >= 2.3.6',
'scipy >= 1.13.1',
'beanprice >= 1.2.1',
'pandas-stubs >= 2.2.2.240514',
'matplotlib-stubs >= 0.2.0',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pandas-stubs and matplotlib-stubs are required only for type checking, not at runtime, therefore it is not necessary for users to install them. I'll leave these out or I'll add them to a dev extra dependencies group. My preference would be to leave them out as other development dependencies are not listed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM @dnicolodi I'll merge this quick and try it out though, can be done later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I overlooked this when I converted it from poetry to PEP 621.
I've created a follow-up PR #39 to fix this and also added ruff and mypy to the dev dependencies.

"protobuf >= 5.29.3",
]

[tool.poetry.scripts]
[project.scripts]
beangrow-returns = "beangrow.compute_returns:main"
beangrow-prices = "beangrow.download_prices:main"
beangrow-prices-file = "beangrow.download_prices_from_file:main"

[tool.poetry.dependencies]
python = ">=3.10"
numpy = "^1.26.4"
pandas = "^2.2.2"
matplotlib = "^3.9.0"
beancount = "^2.3.6"
scipy = "^1.13.1"
beanprice = "^1.2.1"
pandas-stubs = "^2.2.2.240514"
matplotlib-stubs = "^0.2.0"

[tool.black]
line-length = 88

Expand Down