Skip to content

Commit 39e955a

Browse files
authored
Merge pull request winpython#825 from stonebig/master
remove the need to update package.ini step1
2 parents e8ddd29 + 57d9016 commit 39e955a

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

winpython/data/packages.ini

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ description=tools for machine learning and data mining in Astronomy
104104
[astropy]
105105
description=Community-developed python astronomy tools
106106
107+
[astunparse]
108+
description=An AST unparser for Python
109+
107110
[async_generator]
108111
description=Async generators and context managers for Python 3.5+
109112
@@ -488,15 +491,18 @@ description=Removes commented-out code.
488491
[falcon]
489492
description=An unladen web framework for building APIs and app backends.
490493
491-
[fastcache]
492-
description=C implementation of Python 3 functools.lru_cache
494+
[fast-histogram]
495+
description=Fast 1D and 2D histogram functions in Python
493496
494497
[fastai]
495498
description=fastai makes deep learning with PyTorch faster, more accurate, and easier
496499
497500
[fastapi]
498501
description=FastAPI framework, high performance, easy to learn, fast to code, ready for production
499502
503+
[fastcache]
504+
description=C implementation of Python 3 functools.lru_cache
505+
500506
[fasteners]
501507
description=A python package that provides useful locks.
502508
@@ -509,8 +515,8 @@ description=A nested progress with plotting options for fastai
509515
[fastrlock]
510516
description=A fast RLock implementation for CPython
511517
512-
[fast-histogram]
513-
description=Fast 1D and 2D histogram functions in Python
518+
[fastscript]
519+
description=A fast way to turn your python function into a script
514520
515521
[fbprophet]
516522
description=Automatic Forecasting Procedure
@@ -1139,6 +1145,9 @@ description=Converting Jupyter Notebooks
11391145
[nbconvert_reportlab]
11401146
description=Convert notebooks to PDF using Reportlab
11411147
1148+
[nbdev]
1149+
description=Writing a library entirely in notebooks
1150+
11421151
[nbdime]
11431152
description=Tools for diffing and merging of Jupyter notebooks
11441153
@@ -1160,6 +1169,9 @@ description=Dynamic types for data description and in-memory computations
11601169
[netcdftime]
11611170
description=Time-handling functionality from netcdf4-python
11621171
1172+
[nest_asyncio]
1173+
description=Patch asyncio to allow nested event loops
1174+
11631175
[netcdf4]
11641176
description=Provides an object-oriented python interface to the netCDF version 4 library
11651177
@@ -2213,6 +2225,9 @@ description=TensorFlow is an open source machine learning framework for everyone
22132225
[tensorflow_estimator]
22142226
description=TensorFlow Estimator.
22152227

2228+
[tensorflow-plugin-wit]
2229+
description=What-If Tool TensorBoard plugin.
2230+
22162231
[tensorflow-probability]
22172232
description=Probabilistic modeling and statistical inference in TensorFlow
22182233

winpython/wppm.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@
2828
from argparse import ArgumentParser
2929
from winpython import py3compat
3030

31-
31+
# import information reader
32+
# importlib_metadata before Python 3.8
33+
try:
34+
from importlib import metadata as metadata # Python-3.8
35+
metadata = metadata.metadata
36+
except:
37+
try:
38+
from importlib_metadata import metadata # <Python-3.8
39+
except:
40+
metadata = None # nothing available
41+
3242
# Workaround for installing PyVISA on Windows from source:
3343
os.environ['HOME'] = os.environ['USERPROFILE']
3444

@@ -43,11 +53,11 @@ def get_package_metadata(database, name):
4353
# machine which is not connected to the internet
4454
db = cp.ConfigParser()
4555
db.readfp(open(osp.join(DATA_PATH, database)))
46-
metadata = dict(
56+
my_metadata = dict(
4757
description='',
4858
url='https://pypi.org/project/' + name,
4959
)
50-
for key in metadata:
60+
for key in my_metadata:
5161
name1 = name.lower()
5262
# wheel replace '-' per '_' in key
5363
for name2 in (
@@ -58,11 +68,17 @@ def get_package_metadata(database, name):
5868
normalize(name),
5969
):
6070
try:
61-
metadata[key] = db.get(name2, key)
71+
my_metadata[key] = db.get(name2, key)
6272
break
6373
except (cp.NoSectionError, cp.NoOptionError):
6474
pass
65-
return metadata
75+
if my_metadata.get('description') == '' and metadata: # nothing in package.ini
76+
try:
77+
my_metadata['description']=(
78+
metadata(name)['Summary']+'\n').splitlines()[0]
79+
except:
80+
pass
81+
return my_metadata
6682

6783

6884
class BasePackage(object):

0 commit comments

Comments
 (0)