mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 19:45:22 +00:00
make it work with python3
This commit is contained in:
parent
15208540da
commit
b0423cdfe6
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""pipreqs - Generate pip requirements.txt file based on imports
|
"""pipreqs - Generate pip requirements.txt file based on imports
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ Options:
|
|||||||
--clean <file> Clean up requirements.txt by removing modules
|
--clean <file> Clean up requirements.txt by removing modules
|
||||||
that are not imported in project.
|
that are not imported in project.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function, absolute_import
|
# from __future__ import print_function, absolute_import
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -46,7 +46,10 @@ import requests
|
|||||||
from yarg import json2package
|
from yarg import json2package
|
||||||
from yarg.exceptions import HTTPError
|
from yarg.exceptions import HTTPError
|
||||||
|
|
||||||
from pipreqs import __version__
|
try:
|
||||||
|
from pipreqs import __version__
|
||||||
|
except ImportError:
|
||||||
|
from __init__ import __version__
|
||||||
|
|
||||||
REGEXP = [
|
REGEXP = [
|
||||||
re.compile(r'^import (.+)$'),
|
re.compile(r'^import (.+)$'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user