Skip to content

Commit

Permalink
Merge branch 'release-3.0.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvjeets committed Oct 25, 2024
2 parents 54a9fb9 + de58a53 commit 23bff1a
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 40 deletions.
4 changes: 2 additions & 2 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.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -18,7 +18,7 @@ repos:
- id: isort
# flake8
- repo: /~https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
args: # arguments to configure flake8
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to

## [Unreleased]

## [v3.0.1] - 2024-10-25
### Fixed
- Fixed crash when a portfolio consists of only ManualAssets.


## [v3.0.0] - 2024-07-05
### Changed
- `lak list performance` and `lak info performance` commands will print
Expand Down
5 changes: 2 additions & 3 deletions lakshmi/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,5 @@ def prefetch_add(class_obj):
def prefetch():
"""Fetch all cached methods of objects added earlier via the prefetch_add()
call in parallel threads."""
assert _prefetch_obj is not None, (
'prefetch_add must be called before calling prefetch')
_prefetch_obj.fetch()
if _prefetch_obj is not None:
_prefetch_obj.fetch()
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 = '3.0.0'
VERSION = '3.0.1'
68 changes: 34 additions & 34 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,67 @@ appdirs==1.4.4
backports.entry-points-selectable==1.3.0
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.7.4
cffi==1.16.0
certifi==2024.8.30
cffi==1.17.1
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==42.0.8
cryptography==43.0.1
distlib==0.3.8
docutils==0.21.2
filelock==3.15.4
filelock==3.16.1
frozendict==2.4.4
html5lib==1.1
ibonds==1.0.4
identify==2.5.36
idna==3.7
importlib_metadata==8.0.0
identify==2.6.1
idna==3.10
importlib_metadata==8.5.0
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.functools==4.0.1
jaraco.context==6.0.1
jaraco.functools==4.1.0
jeepney==0.8.0
keyring==25.2.1
lxml==5.2.2
keyring==25.4.1
lxml==5.3.0
markdown-it-py==3.0.0
mdurl==0.1.2
more-itertools==10.3.0
more-itertools==10.5.0
multitasking==0.0.11
nh3==0.2.17
nh3==0.2.18
nodeenv==1.9.1
numpy==2.0.0
numpy==2.1.1
packaging==24.1
pandas==2.2.2
peewee==3.17.5
pkginfo==1.10.0
platformdirs==4.2.2
pre-commit==3.7.1
pandas==2.2.3
peewee==3.17.6
pkginfo==1.11.1
platformdirs==4.3.6
pre-commit==3.8.0
pycparser==2.22
Pygments==2.18.0
pyparsing==3.1.2
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pytz==2024.1
pyxirr==0.10.4
PyYAML==6.0.1
readme_renderer==43.0
pytz==2024.2
pyxirr==0.10.5
PyYAML==6.0.2
readme_renderer==44.0
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.7.1
rich==13.8.1
SecretStorage==3.3.3
setuptools==70.2.0
setuptools==75.1.0
six==1.16.0
soupsieve==2.5
soupsieve==2.6
tabulate==0.9.0
toml==0.10.2
tqdm==4.66.4
tqdm==4.66.5
twine==5.1.1
tzdata==2024.1
urllib3==2.2.2
virtualenv==20.26.3
tzdata==2024.2
urllib3==2.2.3
virtualenv==20.26.6
webencodings==0.5.1
wheel==0.43.0
yfinance==0.2.40
zipp==3.19.2
wheel==0.44.0
yfinance==0.2.43
zipp==3.20.2
5 changes: 5 additions & 0 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def get_long_cached_value(self):
class CacheTest(unittest.TestCase):
def setUp(self):
# Reset cache dir setting.
cache._prefetch_obj = None
cache._ctx.pop(cache._CACHE_STR, None)
cache.set_force_refresh(False)
cache.set_cache_miss_func(None)
Expand Down Expand Up @@ -306,6 +307,10 @@ def test_force_refresh_with_prefetch(
self.assertEqual(2, write_bytes.call_count)
read_bytes.assert_not_called()

def test_prefetch_add_not_called(self):
# Do not fail if there are no functions to be prefetched.
cache.prefetch()


if __name__ == '__main__':
unittest.main()

0 comments on commit 23bff1a

Please sign in to comment.