Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Support older pythons #56

@manfredsc

Description

@manfredsc

With the switch from CDS to CDS-Beta, the python module cads-api-client has become an operational
component of the API interface, it is unconditionally needed when downloading data from CDS-Beta.

In cdsapi/api.py, there is the following code:

        if ":" in token:
            return super().__new__(cls)
        import cads_api_client.legacy_api_client
        return super().__new__(cads_api_client.legacy_api_client.LegacyApiClient)

Tokens for CDS-Beta have no colons, and therefore cads_api_client.legacy_api_client.LegacyApiClient is executed.

So far cdsapi was happily running on python 3.6. However, cads-api-client does not work with python 3.6:

[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/catalogue.py", line 1
[   22s] SyntaxError: future feature annotations is not defined
[   22s] 
[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/legacy_api_client.py", line 1
[   22s] SyntaxError: future feature annotations is not defined
[   22s] 
[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/processing.py", line 95
[   22s]     if not (content := message.get("content")):
[   22s]                     ^
[   22s] SyntaxError: invalid syntax

It seems it would be not a lot of effort to make cads-api-client run on python 3.6. On some older Linux
distributions, including enterprise distributions, python 3.6 is all one can get, and doing a local, private installation of
the whole python stack is not really attractive.

Please keep your API code as generic as possible, cdsapi is the only possibility to do automated requests from CDS.

I also posted this request on the cdsapi project page to increase awareness.
Thanks for consideration!

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