zooniverse / panoptes-python-client

Apache License 2.0
30 stars 27 forks source link

Broken installs due to strict version constraints with requests and idna in python 3 #276

Closed camallen closed 2 years ago

camallen commented 2 years ago

A collaborator is reporting that they can't use the currently released version of panoptes-client with latter versions of the idna package on python 3.

It appears this strict dependency constraint has been relaxed in https://github.com/zooniverse/panoptes-python-client/commit/efebca50447d4665e6511b461216f30887242261 and in more so in #272

This will be fixed by releasing the latest changes on master to v1.5.0 https://github.com/zooniverse/panoptes-python-client/compare/1.4.0...535d38b2ff37e01223b2e5045bd30a6a77b9d8d8

---------------------------------------------------------------------------
ContextualVersionConflict                 Traceback (most recent call last)
Input In [5], in <cell line: 2>()
      1 # Log into Zooniverse
----> 2 import panoptes_client

File ~/.local/lib/python3.8/site-packages/panoptes_client/__init__.py:1, in <module>
----> 1 from panoptes_client.classification import Classification
      2 from panoptes_client.collection import Collection
      3 from panoptes_client.collection_role import CollectionRole

File ~/.local/lib/python3.8/site-packages/panoptes_client/classification.py:3, in <module>
      1 from __future__ import absolute_import, division, print_function
----> 3 from panoptes_client.panoptes import LinkResolver, PanoptesObject
      6 class Classification(PanoptesObject):
      7     _api_slug = 'classifications'

File ~/.local/lib/python3.8/site-packages/panoptes_client/panoptes.py:25, in <module>
     21 if os.environ.get('PANOPTES_DEBUG'):
     22     logging.basicConfig(level=logging.DEBUG)
---> 25 class Panoptes(object):
     26     """
     27     The low-level Panoptes HTTP client class. Use this class to log into the
     28     API. In most cases you can just call :py:meth:`.Panoptes.connect` once and
   (...)
     52     be used for each action.
     53     """
     55     _http_headers = {
     56         'default': {
     57             'Accept': 'application/vnd.api+json; version=1',
   (...)
     69         },
     70     }

File ~/.local/lib/python3.8/site-packages/panoptes_client/panoptes.py:58, in Panoptes()
     25 class Panoptes(object):
     26     """
     27     The low-level Panoptes HTTP client class. Use this class to log into the
     28     API. In most cases you can just call :py:meth:`.Panoptes.connect` once and
   (...)
     52     be used for each action.
     53     """
     55     _http_headers = {
     56         'default': {
     57             'Accept': 'application/vnd.api+json; version=1',
---> 58             'User-Agent': 'panoptes-python-client/version=' + pkg_resources.require('panoptes_client')[0].version
     59         },
     60         'GET': {},
     61         'PUT': {
     62             'Content-Type': 'application/json',
     63         },
     64         'POST': {
     65             'Content-Type': 'application/json',
     66         },
     67         'DELETE': {
     68             'Content-Type': 'application/json',
     69         },
     70     }
     72     _endpoint_client_ids = {
     73         'default': (
     74             'ce310d45f951de68c4cc8ef46ca38cc0a008f607a2026680295757bfef99f43c'
   (...)
     78         ),
     79     }
     81     _local = threading.local()

File /opt/lsst/software/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/lib/python3.8/site-packages/pkg_resources/__init__.py:891, in WorkingSet.require(self, *requirements)
    882 def require(self, *requirements):
    883     """Ensure that distributions matching `requirements` are activated
    884 
    885     `requirements` must be a string or a (possibly-nested) sequence
   (...)
    889     included, even if they were already activated in this working set.
    890     """
--> 891     needed = self.resolve(parse_requirements(requirements))
    893     for dist in needed:
    894         self.add(dist)

File /opt/lsst/software/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/lib/python3.8/site-packages/pkg_resources/__init__.py:782, in WorkingSet.resolve(self, requirements, env, installer, replace_conflicting, extras)
    779 if dist not in req:
    780     # Oops, the "best" so far conflicts with a dependency
    781     dependent_req = required_by[req]
--> 782     raise VersionConflict(dist, req).with_context(dependent_req)
    784 # push the new requirements onto the stack
    785 new_requirements = dist.requires(req.extras)[::-1]

ContextualVersionConflict: (idna 3.3 (/opt/lsst/software/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/lib/python3.8/site-packages), Requirement.parse('idna<3,>=2.5'), {'requests'})
yuenmichelle1 commented 2 years ago

I will reach out to Cliff to see if we are ready to release. Either way: new changes should be released within the next 2 weeks and will close the issue at that point.