Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.backend.python
Commits
9e96012a
Commit
9e96012a
authored
Apr 21, 2016
by
André Anjos
💬
Browse files
[describe] Remove package listing (slow and incomplete)
parent
91996aac
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/backend/python/scripts/describe.py
View file @
9e96012a
...
...
@@ -26,18 +26,13 @@
###############################################################################
import
os
import
sys
import
pip
import
platform
import
collections
import
simplejson
def
main
():
packages
=
dict
(
Python
=
'.'
.
join
(
str
(
k
)
for
k
in
sys
.
version_info
[:
3
]))
for
dist
in
pip
.
get_installed_distributions
():
packages
[
dist
.
project_name
]
=
dist
.
version
# resolve package name
name
=
'environment'
...
...
@@ -47,19 +42,8 @@ def main():
version
=
'1'
if
len
(
sys
.
argv
)
>
2
:
version
=
sys
.
argv
[
2
]
# checks for OpenCV bindings
try
:
import
cv2
packages
[
'OpenCV'
]
=
'available'
except
:
pass
# order packages
packages
=
collections
.
OrderedDict
([(
k
,
packages
[
k
])
for
k
in
sorted
(
packages
)])
retval
=
collections
.
OrderedDict
()
retval
[
'name'
]
=
name
retval
[
'version'
]
=
version
retval
[
'os'
]
=
platform
.
uname
()
retval
[
'packages'
]
=
packages
print
(
simplejson
.
dumps
(
retval
,
indent
=
2
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment