cloud-custodian / poetry-plugin-freeze

poetry plugin to freeze dependency versions in wheels
23 stars 4 forks source link

fails when given a dependency specification for a non installed version #18

Open kapilt opened 8 months ago

kapilt commented 8 months ago
freezing wheels                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
Dependency walk failed at urllib3 (>=1.25.4,<1.27) 

with traceback

Traceback (most recent call last):                                                                                                                            
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 44, in handle                 
    return self._handle()                                                                                                                                                                                                                                                                                                    
           ^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                    
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 63, in _handle                                                                                                                                                                               
    for w in iced.freeze():                                                                                                                                                                                                                                                                                                  
             ^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                   
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 135, in freeze                                                                                                                                                                               
    self.freeze_wheel(w, dep_package_map)                                                                                                                     
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 305, in freeze_wheel                                                                                                                                                                         
    dep_lines = self.get_frozen_deps(deps, self.exclude_packages)                                                                                                                                                                                                                                                            
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                            
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 222, in get_frozen_deps                                                                                                                                                                      
    dependency_sources = self.get_dependency_sources()                                                                                                                                                                                                                                                                       
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                       
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_freeze/app.py", line 180, in get_dependency_sources                                                                                                                                                               
    base_nested_dependencies = walk_dependencies(                                                                                                                                                                                                                                                                            
                               ^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                            
  File "/Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_export/walker.py", line 155, in walk_dependencies                                                                                                                                                                 
    raise RuntimeError(f"Dependency walk failed at {requirement}")                                                                                                                                                                                                                                                           
RuntimeError: Dependency walk failed at urllib3 (>=1.25.4,<1.27)                                                                                                                                                                                                                                                             
> /Users/kapilt/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry_plugin_export/walker.py(155)walk_dependencies()                                                                                                                                                                                
-> raise RuntimeError(f"Dependency walk failed at {requirement}")                                                                                                                                                                                                                                                            
(Pdb) l                                                                                                                                                                                                                                                                                                                      
150             locked_package = get_locked_package(                                                                                                          
151                 requirement, packages_by_name, nested_dependencies                                                                                                                                                                                                                                                       
152             )                                                                                                                                                                                                                                                                                                            
153                                                                                                                                                                                                                                                                                                                          
154             if not locked_package:                                                                                                                                                                                                                                                                                       
155  ->             raise RuntimeError(f"Dependency walk failed at {requirement}")                                                                            
156                                                                                                                                                           
157             if requirement.extras:                                                                                                                        
158                 locked_package = locked_package.with_features(requirement.extras)                                                                                                                                                                                                                                        
159                                                                                                                                                                                                                                                                                                                          
160             # create dependency from locked package to retain dependency metadata   

the dependency arises from botocore which uses these markers

    'urllib3>=1.25.4,<1.27 ; python_version < "3.10"',
    'urllib3>=1.25.4,<2.1 ; python_version >= "3.10"',