Skip to content
This repository was archived by the owner on Oct 2, 2018. It is now read-only.
This repository was archived by the owner on Oct 2, 2018. It is now read-only.

[COOK-3903] - python_pip resource will always try and update setuptools #81

Closed

Description

@someara

The python_pip resource uses the pip freeze command to find the currently installed version of a python package (providers/pip.rb line 111). However, pip freeze does not include the pip and setuptools packages, and as a resource installing either package will always assume the package is not installed and reinstall it, even when the latest version of the package is installed. For instance, the supervisor cookbook will always upgrade setuptools (link).

Activity

  1. someara commented on Jan 27, 2014

    @someara
    Author

    silviu dicu added a comment - 07/Nov/13 9:16 AM
    Hi - this is hardcoded into the pip source code - https://github.com/pypa/pip/blob/develop/pip/util.py#L350
    Two solutions
    have pip change the logic
    have a different strategy into the python_pip provider

  2. mal commented on Feb 6, 2014

    @mal
    Contributor

    I gave improving this a shot, but I'm not sure how to:

    1. support virtualenv
    2. prevent unnecessary upgrades

    Commit is here for anyone interested: https://github.com/mal/chef-python/commit/f8651c70c2507e4f082265575d3b982c34d6ace5

    Other approaches include using easy_install --version which will report versions for setuptools and/or distribute.

  3. borntyping commented on Feb 27, 2014

    @borntyping

    The code already has a special case for pip[1] - a very simple (if not particularly elegant) solution might be to also special case setuptools, using something like:

    version_check_cmd = "#{default['python']['binary']} -c \"import setuptools, sys; sys.stdout.write('setuptools==' + str(setuptools.__version__))\""
  4. mal commented on Mar 6, 2014

    @mal
    Contributor

    I found a more generic solution using pip list, should do the job nicely 😀

  5. miketheman commented on Jun 9, 2014

    @miketheman
    Contributor

    Bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy