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

import firecloud.api broken in Python 3.10 #170

Closed
amstilp opened this issue Feb 9, 2022 · 2 comments · Fixed by #175
Closed

import firecloud.api broken in Python 3.10 #170

amstilp opened this issue Feb 9, 2022 · 2 comments · Fixed by #175

Comments

@amstilp
Copy link

amstilp commented Feb 9, 2022

Python 3.10 changed the collections module, which breaks the firecloud/api.py file.

In a new venv with Python 3.10.2:

python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install firecloud
python -c 'import firecloud.api as fapi'

gives this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/amstilp/venv310/lib/python3.10/site-packages/firecloud/api.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

import firecloud.api as fapi works without error in Python 3.9.10.

@DailyDreaming
Copy link
Contributor

I'm also having this issue. Seems like an easy fix. Since FISS seems to no longer be maintained, I may just move off of the FISS dependency and call the API directly then.

@dheiman
Copy link
Collaborator

dheiman commented Jul 1, 2022 via email

dheiman added a commit that referenced this issue Jul 25, 2022
* Changed Dockerfile base image to python 3.10
* Fixed Python 3.10 incompatibility issues (fixes #170)
* pylint set to minimum version 2.0.0 (fixes #168)

api.py:
* added `__patch()` helper to simplify adding wrappers for `PATCH` API
calls
* enhanced error checking to use the more robust json decoder in the
`requests` module
* `upload_entities()`: added `delete_empty` parameter
* `get_entities_query()`: added `filter_operator` and `fields`
parameters
* `create_submission()`: added `deleteIntermediateOutputFiles`,
`useReferenceDisks`, `memoryRetryMultiplier`, `workflowFailureMode`, and
`userComment` fields (fixes #165, #169)
* `create_workspace()`: added `noWorkspaceOwner` and `bucketLocation`
fields and enabled use of multiple authorization domains (fixes #171)
* new helper functions: `_attr_vlcreate()` and `_attr_erlcreate()` for
creating list attribute via `update_workspace_attributes()` and
`update_entity()` (resolves #99)
* fixed bugs in existing helper functionss `_attr_ladd()` and
`_attr_lrem()`
* new functions:
   - `delete_entities_of_type()`
   - `rename_entity()`
   - `rename_entity_type()`
   - `rename_entity_type_attribute()`
* updated and cleaned up documentation for multiple functions

`fiss.py`:
* new functions:
   - `entity_rename()`
   - `attr_rename()`
* function updates:
   - helper `_entity_paginator()` updated to take advantage of the
`fields` parameter to speed up queries
   - `config_start()` updated to use new `api.create_submission()`
fields
   - `attr_get()` now returns formatted arrays for list attributes in
workspaces
   - `attr_set()` updated to enable creation of value and reference list
attributes
   - `attr_delete()` updated to be completely type agnostic (previously
only guaranteed to work on entity types in the firecloud model)
   - `space_new()` updated to allow multiple authorization domains and
set the bucket region for the new workspace
* Cleaned up return of Terra errors to be more human-readable

`highlevel_tests.py`:
* updated include new rename functions
* fixed bugs that were due to inaccurate API docs

`lowlevel_tests.py`:
* added test for `get_entities_query()`.
dheiman pushed a commit that referenced this issue Jul 26, 2022
@dheiman dheiman mentioned this issue Jul 26, 2022
dheiman added a commit that referenced this issue Jul 26, 2022
* Changed Dockerfile base image to python 3.10
* Fixed Python 3.10 incompatibility issues (fixes #170)
* pylint set to minimum version 2.0.0 (fixes #168)

### `api.py`:
* added `__patch()` helper to simplify adding wrappers for `PATCH` API calls
* enhanced error checking to use the more robust json decoder in the `requests` module
* `upload_entities()`: added `delete_empty` parameter
* `get_entities_query()`: added `filter_operator` and `fields` parameters
* `create_submission()`: added `delete_intermediate_output_files`, `use_reference_disks`, `memory_retry_multiplier`, `workflow_failure_mode`, and `user_comment` fields (fixes #165, fixes #169)
* `create_workspace()`: added `noWorkspaceOwner` and `bucketLocation` fields and enabled use of multiple authorization domains (fixes #171)
* new helper functions: `_attr_vlcreate()` and `_attr_erlcreate()` for creating list attributes via `update_workspace_attributes()` and `update_entity()` (resolves #99)
* fixed bugs in existing helper functions `_attr_ladd()` and `_attr_lrem()`
* new functions:
   - `delete_entities_of_type()`
   - `rename_entity()`
   - `rename_entity_type()`
   - `rename_entity_type_attribute()`
   - `get_proxy_group()`
   - `get_storage_cost()`
   - `get_bucket_usage()`
   - `get_workflow_cost()` (resolves #144)
* updated and cleaned up documentation for multiple functions

### `fiss.py`:
* new functions:
   - `entity_rename()`
   - `attr_rename()`
* function updates:
   - helper `_entity_paginator()` updated to take advantage of the `fields` parameter to speed up queries
   - `config_start()` updated to use new `api.create_submission()` fields
   - `attr_get()` now returns formatted arrays for list attributes in workspaces
   - `attr_set()` updated to enable creation of value and reference list attributes
   - `attr_delete()` updated to be completely type agnostic (previously only guaranteed to work on entity types in the firecloud model)
   - `space_new()` updated to allow multiple authorization domains and set the bucket region for the new workspace
   - `mop()`:
      * Added submission ID filtering (resolves #158)
      * Now uses `google-cloud-storage` API for file listing rather than `gsutil` CLI
* Cleaned up return of Terra errors to be more human-readable

### `highlevel_tests.py`:
* updated include new rename functions
* fixed bugs that were due to inaccurate API docs

### `lowlevel_tests.py`:
* added test for `get_entities_query()`.
* added test for `get_proxy_group()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants