diff --git a/.github/workflows/check-and-publish.yml b/.github/workflows/check-and-publish.yml index 2582386..24972d1 100644 --- a/.github/workflows/check-and-publish.yml +++ b/.github/workflows/check-and-publish.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: platform: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] exclude: - platform: macos-latest python-version: "3.8" @@ -58,8 +58,8 @@ jobs: - name: Tests env: - CDSAPI_URL: https://cds.climate.copernicus.eu/api/v2 - CDSAPI_KEY: ${{ secrets.CDSAPI_KEY }} + CDSAPI_URL: https://cds.climate.copernicus.eu/api + CDSAPI_KEY: ${{ secrets.CDSAPI_KEY_2024 }} run: | pip install setuptools python setup.py develop diff --git a/cdsapi/api.py b/cdsapi/api.py index 9b47e55..a8ea1a9 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -13,8 +13,8 @@ import os import time import uuid +from importlib.metadata import version -import pkg_resources import requests try: @@ -347,8 +347,7 @@ def __init__( self.session = session self.session.auth = tuple(self.key.split(":", 2)) self.session.headers = { - "User-Agent": "cdsapi/%s" - % pkg_resources.get_distribution("cdsapi").version, + "User-Agent": f"cdsapi/{version('cdsapi')}", } assert len(self.session.auth) == 2, ( diff --git a/setup.py b/setup.py index e1a47ad..573bf39 100644 --- a/setup.py +++ b/setup.py @@ -44,8 +44,9 @@ def read(fname): long_description=read("README.rst"), packages=setuptools.find_packages(), include_package_data=True, + python_requires=">=3.8", install_requires=[ - "cads-api-client>=1.3.2", + "cads-api-client>=1.4.7", "requests>=2.5.0", "tqdm", ], @@ -60,6 +61,7 @@ def read(fname): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Operating System :: OS Independent",