Skip to content

new gax breaks pip installed console scripts #1979

Closed

Description

@fdr

I was doing some work on https://github.com/wal-e/wal-e and it was going smoothly until I decided to delete my tox test environment. Now pip install of this program crashes from the load_entry_point import with:

$ .tox/py27/bin/wal-e version
Traceback (most recent call last):
  File ".tox/py27/bin/wal-e", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 834, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-gax 0.12.3 (/home/fdr/code/wal-e/.tox/py27/lib/python2.7/site-packages), Requirement.parse('google-gax==0.12.2'), set(['gax-google-logging-v2', 'gax-google-pubsub-v1']))

Rather suspiciously, google-gax 0.12.3 was released today.

Activity

  1. changed the title [-]new gax breaks pip install?[/-] [+]new gax breaks pip installed console scripts[/+] on Jul 13, 2016
  2. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 13, 2016
  3. daspecster commented on Jul 13, 2016

    @daspecster
    Contributor

    gcloud-python looks for google-gax >= 0.12.1 so you should be able to install 0.12.2 first to avoid the issue.

    A fresh install for me works just fine. pip install gcloud.
    Is it possible that something else you're using is causing the conflict, pulling in other versions of google-gax?

    @tseaver WDYT?

  4. fdr commented on Jul 13, 2016

    @fdr
    Author

    It may be more a problem in google-gax, or other related dependencies:

    $ fgrep -RIi '0.12.2'
    lib64/python2.7/site-packages/gax_google_logging_v2-0.7.11.dist-info/METADATA:Requires-Dist: google-gax (==0.12.2)
    lib64/python2.7/site-packages/gax_google_logging_v2-0.7.11.dist-info/metadata.json:{"classifiers": ["Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython"], "extensions": {"python.details": {"contacts": [{"email": "googleapis-packages@google.com", "name": "Google Inc", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/googleapis/googleapis"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "Apache-2.0", "metadata_version": "2.0", "name": "gax-google-logging-v2", "run_requires": [{"requires": ["google-gax (==0.12.2)", "googleapis-common-protos (>=1.1.0)", "grpc-google-logging-v2 (>=0.7.11)", "oauth2client (>=1.4.11)"]}], "summary": "GAX library for the Google Logging API", "version": "0.7.11"}
    lib64/python2.7/site-packages/gax_google_pubsub_v1-0.7.11.dist-info/METADATA:Requires-Dist: google-gax (==0.12.2)
    lib64/python2.7/site-packages/gax_google_pubsub_v1-0.7.11.dist-info/metadata.json:{"classifiers": ["Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython"], "extensions": {"python.details": {"contacts": [{"email": "googleapis-packages@google.com", "name": "Google Inc", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/googleapis/googleapis"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "Apache-2.0", "metadata_version": "2.0", "name": "gax-google-pubsub-v1", "run_requires": [{"requires": ["google-gax (==0.12.2)", "googleapis-common-protos (>=1.1.0)", "grpc-google-pubsub-v1 (>=0.7.11)", "oauth2client (>=1.4.11)"]}], "summary": "GAX library for the Google Pubsub API", "version": "0.7.11"}
    lib/python2.7/site-packages/gax_google_logging_v2-0.7.11.dist-info/METADATA:Requires-Dist: google-gax (==0.12.2)
    lib/python2.7/site-packages/gax_google_logging_v2-0.7.11.dist-info/metadata.json:{"classifiers": ["Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython"], "extensions": {"python.details": {"contacts": [{"email": "googleapis-packages@google.com", "name": "Google Inc", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/googleapis/googleapis"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "Apache-2.0", "metadata_version": "2.0", "name": "gax-google-logging-v2", "run_requires": [{"requires": ["google-gax (==0.12.2)", "googleapis-common-protos (>=1.1.0)", "grpc-google-logging-v2 (>=0.7.11)", "oauth2client (>=1.4.11)"]}], "summary": "GAX library for the Google Logging API", "version": "0.7.11"}
    lib/python2.7/site-packages/gax_google_pubsub_v1-0.7.11.dist-info/METADATA:Requires-Dist: google-gax (==0.12.2)
    lib/python2.7/site-packages/gax_google_pubsub_v1-0.7.11.dist-info/metadata.json:{"classifiers": ["Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython"], "extensions": {"python.details": {"contacts": [{"email": "googleapis-packages@google.com", "name": "Google Inc", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/googleapis/googleapis"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "Apache-2.0", "metadata_version": "2.0", "name": "gax-google-pubsub-v1", "run_requires": [{"requires": ["google-gax (==0.12.2)", "googleapis-common-protos (>=1.1.0)", "grpc-google-pubsub-v1 (>=0.7.11)", "oauth2client (>=1.4.11)"]}], "summary": "GAX library for the Google Pubsub API", "version": "0.7.11"}
    

    Perhaps they pushed an incomplete release for a series of related packages?

  5. daspecster commented on Jul 15, 2016

    @daspecster
    Contributor

    @fdr did you have any luck resolving this? Installing gcloud locally works for me.

  6. fdr commented on Jul 15, 2016

    @fdr
    Author

    It's enough enough to install it, for me, that works fine. The tests run fine as well. What breaks is creating after creating a "console script" in setup.py, it'll crash with the stack trace I reported.

  7. fdr commented on Jul 15, 2016

    @fdr
    Author

    The problem is definitely some of these packages requiring older gax, such as. https://pypi.python.org/pypi/gax-google-logging-v2 and https://pypi.python.org/pypi/gax-google-pubsub-v1. I don't know how this dependency is getting pulled in, but anything that does recursively pull these in along with the newer google-gax package cannot create a setuptools console program that works.

  8. tseaver commented on Jul 15, 2016

    @tseaver
    Contributor

    We are pinning google-gax >= 0.12.1, but google-gax-pubsub-v1 and google-gax-logging-v2 pin google-gax == 0.12.1. Those pins need to be relaxed.

    /cc @bjwatson, @tbetbetbe

  9. theacodes commented on Jul 15, 2016

    @theacodes
    Contributor

    GoogleCloudPlatform/psq is affected by this as well.

  10. bjwatson commented on Jul 15, 2016

    @bjwatson

    @tseaver This was done deliberately, since we are still pre-beta and changes to google-gax could still be breaking for the generated surfaces. I believe the google-gax 0.12.3 changes might be mildly breaking, since @geigerj changed how timeouts work a bit. I suggest that gcloud-python also do hard pins for now, at least until we declare beta.

    @geigerj When you get a chance, can you push new versions of gax-google-pubsub-v1 and gax-google-logging-v2 that depend on google-gax 0.12.3? Thanks.

  11. tseaver commented on Jul 16, 2016

    @tseaver
    Contributor

    @bjwatson ISTM that semver would imply that 0.12.3 should not break anything that worked on 0.12.2: a breaking change should bump to 0.13.0. If that pattern were in place, we could be pinning something like google-gax >= 0.12.1, < 0.13.dev.

  12. bjwatson commented on Jul 16, 2016

    @bjwatson

    @tseaver Semver actually says nothing about 0.x version ("4. Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable."). However, we discussed this and decided to do exactly as you're proposing while we remain in 0.x. We were going to propose that you use exactly that compound version dependency, and we will use the same.

  13. geigerj commented on Jul 18, 2016

    @geigerj
    Contributor

    I've uploaded new versions of gax-google-{pubsub-v1,logging-v2} that are pegged to google-gax 0.12.3 -- that at least should let the tox environment create correctly (for now). I'm still finishing up some work on our packaging tool that will include relaxing the version requirement to >= 0.{x}.{y}, < 0.{x+1}.0, so that should be coming soon.

  14. tseaver commented on Jul 18, 2016

    @tseaver
    Contributor

    @fdr can you check that @geigerj has fixed your issue with the new releases?

  15. fdr commented on Jul 21, 2016

    @fdr
    Author

    Can confirm that a fresh installation works.

  16. removed their assignment
    on Feb 2, 2021
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

    grpcpackagingtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions