mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 20:15:22 +00:00
feat(pipreqs): Add ImportName -> PackageName mapping, fix for #5
This commit is contained in:
parent
d5b182e445
commit
a0c796bc6b
@ -8,4 +8,4 @@ recursive-include tests *
|
|||||||
recursive-exclude * __pycache__
|
recursive-exclude * __pycache__
|
||||||
recursive-exclude * *.py[co]
|
recursive-exclude * *.py[co]
|
||||||
|
|
||||||
recursive-include docs *.rst conf.py Makefile make.bat stdlib
|
recursive-include docs *.rst conf.py Makefile make.bat stdlib mapping
|
||||||
|
102
pipreqs/mapping
Normal file
102
pipreqs/mapping
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
Testing:Zope2
|
||||||
|
uwsgidecorators:uWSGI
|
||||||
|
OpenGL:PyOpenGL
|
||||||
|
zmq:pyzmq
|
||||||
|
TreeDisplay:DocumentTemplate
|
||||||
|
Signals:Zope2
|
||||||
|
chef:PyChef
|
||||||
|
odf:odfpy
|
||||||
|
enum:enum34
|
||||||
|
bpdb:bpython
|
||||||
|
ctff:tff
|
||||||
|
dogshell:dogapi
|
||||||
|
S3:s3cmd
|
||||||
|
fdpexpect:pexpect
|
||||||
|
gabbi:tiddlyweb
|
||||||
|
pybloomfilter:pybloomfiltermmap
|
||||||
|
ZTUtils:Zope2
|
||||||
|
dns:dnspython
|
||||||
|
ZServer:Zope2
|
||||||
|
example:adrest
|
||||||
|
requests:Requests
|
||||||
|
faker:Faker
|
||||||
|
greplin:scales
|
||||||
|
couchdb:CouchDB
|
||||||
|
OpenSSL:pyOpenSSL
|
||||||
|
shapefile:pyshp
|
||||||
|
s2repoze:pysaml2
|
||||||
|
pyximport:Cython
|
||||||
|
encutils:cssutils
|
||||||
|
yaml:PyYAML
|
||||||
|
funtests:librabbitmq
|
||||||
|
reStructuredText:Zope2
|
||||||
|
sqlalchemy:SQLAlchemy
|
||||||
|
rosdep2:rosdep
|
||||||
|
em:empy
|
||||||
|
HelpSys:Zope2
|
||||||
|
bson:pymongo
|
||||||
|
wsmeext:WSME
|
||||||
|
pysideuic:PySide
|
||||||
|
jwt:PyJWT
|
||||||
|
cups:pycups
|
||||||
|
validate:configobj
|
||||||
|
hgext:mercurial
|
||||||
|
libfuturize:future
|
||||||
|
scss:pyScss
|
||||||
|
sx:pisa
|
||||||
|
MethodObject:ExtensionClass
|
||||||
|
ZPublisher:Zope2
|
||||||
|
bs4:beautifulsoup4
|
||||||
|
flvscreen:vnc2flv
|
||||||
|
pylab:matplotlib
|
||||||
|
colors:ansicolors
|
||||||
|
wikklytext:tiddlywebwiki
|
||||||
|
pwiz:peewee
|
||||||
|
fabfile:Fabric
|
||||||
|
xdg:pyxdg
|
||||||
|
OFS:Zope2
|
||||||
|
Products:Zope2
|
||||||
|
playhouse:peewee
|
||||||
|
qs:qserve
|
||||||
|
xmlenc:pysaml2
|
||||||
|
enchant:pyenchant
|
||||||
|
libgenerateDS:generateDS
|
||||||
|
screen:pexpect
|
||||||
|
solr:solrpy
|
||||||
|
portalocker:ConcurrentLogHandler
|
||||||
|
robot:robotframework
|
||||||
|
stubout:mox
|
||||||
|
pxssh:pexpect
|
||||||
|
pilot:BigJob
|
||||||
|
ANSI:pexpect
|
||||||
|
demo:webunit
|
||||||
|
gridfs:pymongo
|
||||||
|
App:Zope2
|
||||||
|
fuse:fusepy
|
||||||
|
BeautifulSoupTests:BeautifulSoup
|
||||||
|
coordination:BigJob
|
||||||
|
Globals:Zope2
|
||||||
|
PIL:Pillow
|
||||||
|
hamcrest:PyHamcrest
|
||||||
|
FSM:pexpect
|
||||||
|
cloghandler:ConcurrentLogHandler
|
||||||
|
google:protobuf
|
||||||
|
examples:tweepy
|
||||||
|
xmldsig:pysaml2
|
||||||
|
Crypto:pycrypto
|
||||||
|
paste:PasteScript
|
||||||
|
usb:pyusb
|
||||||
|
QtCore:PySide
|
||||||
|
ComputedAttribute:ExtensionClass
|
||||||
|
Shared:Zope2
|
||||||
|
webdav:Zope2
|
||||||
|
emlib:empy
|
||||||
|
git:GitPython
|
||||||
|
ho:pisa
|
||||||
|
atom:gdata
|
||||||
|
github:PyGithub
|
||||||
|
curl:pycurl
|
||||||
|
saml2:pysaml2
|
||||||
|
depot:filedepot
|
||||||
|
concurrent:futures
|
||||||
|
serial:pyserial
|
@ -62,7 +62,7 @@ def get_all_imports(start_path):
|
|||||||
'Found third-party packages: {0}'.format(third_party_packages))
|
'Found third-party packages: {0}'.format(third_party_packages))
|
||||||
with open(os.path.join(os.path.dirname(__file__), "stdlib"), "r") as f:
|
with open(os.path.join(os.path.dirname(__file__), "stdlib"), "r") as f:
|
||||||
data = [x.strip() for x in f.readlines()]
|
data = [x.strip() for x in f.readlines()]
|
||||||
return sorted(list(set(third_party_packages) - set(data)))
|
return get_pkg_names_from_import_names(sorted(list(set(third_party_packages) - set(data))))
|
||||||
|
|
||||||
|
|
||||||
def generate_requirements_file(path, imports):
|
def generate_requirements_file(path, imports):
|
||||||
@ -115,6 +115,19 @@ def get_import_local(imports):
|
|||||||
result.append(local[item])
|
result.append(local[item])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def get_pkg_names_from_import_names(pkgs):
|
||||||
|
result = []
|
||||||
|
with open(os.path.join(os.path.dirname(__file__), "mapping"), "r") as f:
|
||||||
|
data = [x.strip().split(":") for x in f.readlines()]
|
||||||
|
for pkg in pkgs:
|
||||||
|
toappend = pkg
|
||||||
|
for item in data:
|
||||||
|
if item[0] == pkg:
|
||||||
|
toappend = item[1]
|
||||||
|
break
|
||||||
|
result.append(toappend)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def init(args):
|
def init(args):
|
||||||
print("Looking for imports")
|
print("Looking for imports")
|
||||||
|
2
setup.py
2
setup.py
@ -36,7 +36,7 @@ setup(
|
|||||||
package_dir={'pipreqs':
|
package_dir={'pipreqs':
|
||||||
'pipreqs'},
|
'pipreqs'},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
package_data={'': ['stdlib']},
|
package_data={'': ['stdlib','mapping']},
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
license="Apache License",
|
license="Apache License",
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user