File: pickle_env.py

package info (click to toggle)
python-pipdeptree 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 176 kB
  • sloc: python: 713; makefile: 35; sh: 19
file content (24 lines) | stat: -rwxr-xr-x 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

# This is a small tool to create a pickle file for a set of packages for the
# purposes of writing tests

import pickle
import sys

try:
    from pip._internal.utils.misc import get_installed_distributions
except ImportError:
    from pip import get_installed_distributions


def main():
    default_skip = ['setuptools', 'pip', 'python', 'distribute']
    skip = default_skip + ['pipdeptree']
    pkgs = get_installed_distributions(local_only=True, skip=skip)
    pickle.dump(pkgs, sys.stdout)
    return 0


if __name__ == '__main__':
    sys.exit(main())