Skip to content

Commit

Permalink
Merge branch 'release-2.12.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvjeets committed May 3, 2024
2 parents 5addbb8 + 76ff36a commit 96de14e
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -13,12 +13,12 @@ repos:
hooks:
- id: seed-isort-config
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
# flake8
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
args: # arguments to configure flake8
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to

## [Unreleased]

## [v2.12.1] - 2024-05-02
### Fixed
- AttributeError when ibond interest rates are fetched.
- Add dependency to latest version of yfinance (removes some warnings that
older version is throwing).

## [v2.12.0] - 2023-11-18
### Fixed
- yfinance threw error while fetching names of tickers from yahoo finance.
Expand Down
3 changes: 2 additions & 1 deletion lakshmi/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,8 @@ def get(self):
if self._interest_rates.is_current():
return self._interest_rates
else:
self._interest_rates = self.get_interest_rates()
self._interest_rates = ibonds.InterestRates(
self.get_interest_rates())
return self._interest_rates

def cache_key(self):
Expand Down
2 changes: 1 addition & 1 deletion lakshmi/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Lakshmi constants."""

NAME = 'lakshmi'
VERSION = '2.12.0'
VERSION = '2.12.1'
4 changes: 2 additions & 2 deletions lakshmi/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class Table():
'str': lambda x: x,
'dollars': lambda x: utils.format_money(x),
'delta_dollars': lambda x: utils.format_money_delta(x),
'percentage': lambda x: f'{round(100*x)}%',
'percentage_1': lambda x: f'{round(100*x,1)}%',
'percentage': lambda x: f'{round(100 * x)}%',
'percentage_1': lambda x: f'{round(100 * x, 1)}%',
'float': lambda x: str(float(x)),
}

Expand Down
82 changes: 43 additions & 39 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
appdirs==1.4.4
backports.entry-points-selectable==1.2.0
beautifulsoup4==4.12.2
backports.entry-points-selectable==1.3.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2023.11.17
certifi==2024.2.2
cffi==1.16.0
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
commonmark==0.9.1
cryptography==41.0.5
distlib==0.3.7
docutils==0.20.1
filelock==3.13.1
frozendict==2.3.8
cryptography==42.0.5
distlib==0.3.8
docutils==0.21.2
filelock==3.14.0
frozendict==2.4.2
html5lib==1.1
ibonds==1.0.3
identify==2.5.32
idna==3.4
importlib-metadata==6.8.0
jaraco.classes==3.3.0
ibonds==1.0.4
identify==2.5.36
idna==3.7
importlib_metadata==7.1.0
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.functools==4.0.1
jeepney==0.8.0
keyring==24.3.0
lxml==4.9.3
keyring==25.2.0
lxml==5.2.1
markdown-it-py==3.0.0
mdurl==0.1.2
more-itertools==10.1.0
more-itertools==10.2.0
multitasking==0.0.11
nh3==0.2.14
nh3==0.2.17
nodeenv==1.8.0
numpy==1.26.2
packaging==23.2
pandas==2.1.3
peewee==3.17.0
pkginfo==1.9.6
platformdirs==3.11.0
pre-commit==3.5.0
pycparser==2.21
Pygments==2.17.0
pyparsing==3.1.1
python-dateutil==2.8.2
pytz==2023.3.post1
pyxirr==0.9.3
numpy==1.26.4
packaging==24.0
pandas==2.2.2
peewee==3.17.3
pkginfo==1.10.0
platformdirs==4.2.1
pre-commit==3.7.0
pycparser==2.22
Pygments==2.17.2
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pytz==2024.1
pyxirr==0.10.3
PyYAML==6.0.1
readme-renderer==42.0
readme_renderer==43.0
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.7.0
rich==13.7.1
SecretStorage==3.3.3
setuptools==69.5.1
six==1.16.0
soupsieve==2.5
tabulate==0.9.0
toml==0.10.2
tqdm==4.66.1
twine==4.0.2
tzdata==2023.3
urllib3==2.1.0
virtualenv==20.24.6
tqdm==4.66.4
twine==5.0.0
tzdata==2024.1
urllib3==2.2.1
virtualenv==20.26.1
webencodings==0.5.1
yfinance==0.2.32
zipp==3.17.0
wheel==0.43.0
yfinance==0.2.38
zipp==3.18.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'PyYAML>=5.4,<7.0',
'requests~=2.25',
'tabulate~=0.8',
'yfinance>=0.2.32,<0.3',
'yfinance>=0.2.38,<0.3',
],
entry_points={
'console_scripts': [
Expand Down
14 changes: 13 additions & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Tests for lakshmi/data directory. Simply checks if the files parses."""
import unittest
from pathlib import Path
from unittest.mock import patch

import ibonds
import yaml

import lakshmi
Expand All @@ -26,7 +28,17 @@ def test_ee_bonds(self):
self.assertIsNotNone(self.parse_dict('lakshmi/data/EEBonds.yaml',
lakshmi.assets.EEBonds.from_dict))

def test_i_bonds(self):
@patch('lakshmi.assets.IBonds._InterestRates.get')
def test_i_bonds(self, mock_get):
INTEREST_RATE_DATA = """
2020-11-01:
- 0.00
- 0.84
2021-05-01:
- 0.00
- 1.77
"""
mock_get.return_value = ibonds.InterestRates(INTEREST_RATE_DATA)
self.assertIsNotNone(self.parse_dict('lakshmi/data/IBonds.yaml',
lakshmi.assets.IBonds.from_dict))

Expand Down

0 comments on commit 96de14e

Please sign in to comment.