Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyCrypto is always being downloaded and installed #43134

Closed
tsaridas opened this issue Aug 23, 2017 · 3 comments
Closed

PyCrypto is always being downloaded and installed #43134

tsaridas opened this issue Aug 23, 2017 · 3 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. Packaging Related to packaging of Salt, not Salt's support for package management. stale Windows
Milestone

Comments

@tsaridas
Copy link
Contributor

Description of Issue/Question

salt/setup.py

Line 376 in 68c84a2

class InstallPyCryptoWindowsWheel(Command):

shows the package is being downloaded and installed every time.

I suggest there is a lookup first to see if its installed and version matches and then perform the steps.

        import pip
        package_name = 'pycrypto'
        package_version = '2.6.1'
        local_packages = pip.get_installed_distributions(local_only=True)
        for package in local_packages:
            if str(package).startswith(package_name) and str(package).endswith(package_version):
                return

        platform_bits, _ = platform.architecture()
        call_arguments = ['pip', 'install', 'wheel']
        if platform_bits == '64bit':
            call_arguments.append(
                'https://repo.saltstack.com/windows/dependencies/64/{0}-{1}-cp27-none-win_amd64.whl'
                ''.format(package_name, package_version)
            )
        else:
            call_arguments.append(
                'https://repo.saltstack.com/windows/dependencies/32/{0}-{1}-cp27-none-win32.whl'
                ''.format(package_name, package_version)
            )
        with indent_log():
            call_subprocess(call_arguments)

Versions Report

latest

@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 24, 2017

@s0undt3ch looks like you add this class in the setup file. Any problems with adding this logic to check if its already installed first?

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Aug 24, 2017
@Ch3LL Ch3LL added this to the Blocked milestone Aug 24, 2017
@s0undt3ch
Copy link
Collaborator

No issues with first checking if it's installed.

@Ch3LL Ch3LL added Feature new functionality including changes to functionality and code refactors, etc. Packaging Related to packaging of Salt, not Salt's support for package management. Windows and removed Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged labels Aug 28, 2017
@Ch3LL Ch3LL modified the milestones: Approved, Blocked Aug 28, 2017
@stale
Copy link

stale bot commented Dec 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Dec 22, 2018
@stale stale bot closed this as completed Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. Packaging Related to packaging of Salt, not Salt's support for package management. stale Windows
Projects
None yet
Development

No branches or pull requests

3 participants