Python pip.operations.freeze.freeze() Examples

The following are 28 code examples of pip.operations.freeze.freeze(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pip.operations.freeze , or try the search function .
Example #1
Source File: freeze.py    From jbox with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #2
Source File: freeze.py    From CTFCrackTools with GNU General Public License v3.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #3
Source File: freeze.py    From Hands-On-Deep-Learning-for-Games with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #4
Source File: freeze.py    From CTFCrackTools-V2 with GNU General Public License v3.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #5
Source File: freeze.py    From syntheticmass with Apache License 2.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #6
Source File: freeze.py    From PhonePi_SampleServer with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #7
Source File: utils.py    From flambe with MIT License 6 votes vote down vote up
def get_commit_hash() -> str:
    """Get the commit hash of the current flambe development package.

    This will only work if flambe was install from github in dev mode.

    Returns
    -------
    str
        The commit hash

    Raises
    ------
    Exception
        In case flambe was not installed in dev mode.

    """
    x = freeze.freeze()
    for pkg in x:
        if "flambe" in pkg:
            if pkg.startswith("-e"):
                git_url = pkg.split(" ")[-1]
                commit = git_url.split("@")[-1].split("#")[0]
                return commit

    raise Exception("Tried to lookup commit hash in NOT development mode.") 
Example #8
Source File: utils.py    From flambe with MIT License 6 votes vote down vote up
def is_dev_mode() -> bool:
    """Detects if flambe was installed in editable mode.

    For more information:
    https://pip.pypa.io/en/latest/reference/pip_install/#editable-installs

    Returns
    -------
    bool

    """
    x = freeze.freeze()
    for pkg in x:
        if pkg.startswith("-e") and pkg.endswith("egg=flambe"):
            return True

    return False 
Example #9
Source File: misc.py    From python-sasctl with Apache License 2.0 6 votes vote down vote up
def installed_packages():
    """List Python packages installed in the current environment.

    Returns
    -------

    Notes
    -----
    Uses pip freeze functionality so pip module must be present.

    """
    try:
        from pip._internal.operations import freeze
    except ImportError:
        try:
            from pip.operations import freeze
        except ImportError:
            freeze = None

    if freeze is not None:
        return list(freeze.freeze()) 
Example #10
Source File: freeze.py    From Ansible with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #11
Source File: freeze.py    From python2017 with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #12
Source File: freeze.py    From planespotter with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #13
Source File: freeze.py    From python with Apache License 2.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #14
Source File: freeze.py    From Financial-Portfolio-Flask with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #15
Source File: freeze.py    From telegram-robot-rss with Mozilla Public License 2.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #16
Source File: freeze.py    From Safejumper-for-Desktop with GNU General Public License v2.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #17
Source File: freeze.py    From anpr with Creative Commons Attribution 4.0 International 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #18
Source File: freeze.py    From vnpy_crypto with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #19
Source File: freeze.py    From kobo-predict with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #20
Source File: freeze.py    From python-netsurv with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #21
Source File: freeze.py    From python-netsurv with MIT License 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #22
Source File: freeze.py    From recruit with Apache License 2.0 6 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        skip = set(stdlib_pkgs)
        if not options.freeze_all:
            skip.update(DEV_PKGS)

        freeze_kwargs = dict(
            requirement=options.requirements,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache,
            skip=skip)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #23
Source File: freeze.py    From Flask-P2P with MIT License 5 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #24
Source File: freeze.py    From ImageFusion with MIT License 5 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #25
Source File: freeze.py    From ImageFusion with MIT License 5 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #26
Source File: freeze.py    From datafari with Apache License 2.0 5 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #27
Source File: freeze.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def run(self, options, args):
        format_control = pip.index.FormatControl(set(), set())
        wheel_cache = WheelCache(options.cache_dir, format_control)
        freeze_kwargs = dict(
            requirement=options.requirement,
            find_links=options.find_links,
            local_only=options.local,
            user_only=options.user,
            skip_regex=options.skip_requirements_regex,
            isolated=options.isolated_mode,
            wheel_cache=wheel_cache)

        for line in freeze(**freeze_kwargs):
            sys.stdout.write(line + '\n') 
Example #28
Source File: utils.py    From flambe with MIT License 5 votes vote down vote up
def get_frozen_deps() -> Iterable[str]:
    """Get the frozen dependencies that are locally installed.

    This should yield the same results as runnning 'pip freeze'.

    Returns
    -------
    Iterable[str]
        The frozen dependencies as strings.

    """
    return freeze.freeze()