Skip to content

Commit 9decfc3

Browse files
committed
upgrade to v0.3.2; update readme; update setup scripts (fix keywords typo)
1 parent 3f169e5 commit 9decfc3

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ __any caching algorithms__ (beyond FIFO, LRU and LFU) into this library. See [Co
6969
## Installation
7070

7171
```bash
72-
pip install memoization
72+
pip install -U memoization
7373
```
7474

7575

memoization/memoization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Public symbols
1212
__all__ = ['cached', 'CachingAlgorithmFlag']
13-
__version__ = '0.3.1'
13+
__version__ = '0.3.2'
1414

1515

1616
# Insert the algorithm flags to the global namespace for convenience

setup.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1+
import glob
12
from setuptools import setup, find_packages # type: ignore
23
from memoization.memoization import __version__ as memoization_version
34

4-
with open('README.md', 'r', encoding='utf8') as f:
5-
long_description = f.read()
5+
6+
def get_long_description():
7+
with open('README.md', 'r', encoding='utf8') as f:
8+
return f.read()
9+
10+
11+
def get_package_data():
12+
package_data = {
13+
'memoization': ['py.typed', '*.pyi']
14+
}
15+
# include all *.pyi stub files
16+
for filename in glob.iglob('memoization/**/*.pyi', recursive=True):
17+
parts = filename.split('/')
18+
package_name = '.'.join(parts[:-1])
19+
pyi_name = parts[-1]
20+
if package_name not in package_data:
21+
package_data[package_name] = [pyi_name]
22+
else:
23+
package_data[package_name].append(pyi_name)
24+
return package_data
25+
626

727
setup(
828
name='memoization',
929
version=memoization_version,
1030
description='A powerful caching library for Python, with TTL support and multiple algorithm options. '
1131
'(https://github.com/lonelyenvoy/python-memoization)',
12-
long_description=long_description,
32+
long_description=get_long_description(),
1333
long_description_content_type='text/markdown',
14-
keywords='memoization memorization remember decorator cache caching function callable'
34+
keywords='memoization memorization remember decorator cache caching function callable '
1535
'functional ttl limited capacity fast high-performance optimization',
1636
url='https://github.com/lonelyenvoy/python-memoization',
1737
author='lonelyenvoy',
1838
author_email='petrinchor@gmail.com',
1939
license='MIT',
2040
packages=find_packages(),
21-
package_data={
22-
'memoization': ['py.typed'],
23-
},
41+
package_data=get_package_data(),
2442
exclude_package_data={
2543
'': ['examples.py', 'test.py']
2644
},

0 commit comments

Comments
 (0)