diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 238cdfb..2bd2f9c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,17 +25,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Create conda environment - uses: mamba-org/provision-with-micromamba@main + - name: set up conda environment + uses: mamba-org/setup-micromamba@v1 with: - cache-downloads: true - micromamba-version: "latest" environment-file: ci/environment.yml - extra-specs: | + init-shell: >- + bash + cache-environment: true + cache-downloads: true + post-cleanup: "all" + create-args: | python=${{ matrix.python-version }} - name: Install intake-thredds diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 1c3c0d9..aea6a20 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -21,14 +21,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Create conda environment - uses: mamba-org/provision-with-micromamba@main + - name: set up conda environment + uses: mamba-org/setup-micromamba@v1 with: - cache-downloads: true - micromamba-version: "latest" environment-file: ci/environment-upstream-dev.yml - extra-specs: | - python=3.10 + init-shell: >- + bash + cache-environment: true + cache-downloads: true + post-cleanup: "all" + create-args: | + python=3.12 + - name: Install intake-thredds run: | python -m pip install . --no-deps diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index d1d7c68..fca3184 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -32,7 +32,7 @@ jobs: with: user: __token__ password: ${{ secrets.TESTPYPI_PASSWORD }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ verbose: true deploy: @@ -62,5 +62,5 @@ jobs: with: user: ${{ secrets.PYPI_USERNAME }} password: ${{ secrets.PYPI_PASSWORD }} - skip_existing: true + skip-existing: true verbose: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 460b3ed..ad1e103 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ ci: - autoupdate_schedule: quarterly + autoupdate_schedule: monthly repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -15,20 +15,11 @@ repos: - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.9" + rev: "v0.3.0" hooks: - id: ruff args: ["--fix"] - - - repo: https://github.com/psf/black - rev: 23.12.1 - hooks: - - id: black-jupyter - - - repo: https://github.com/keewis/blackdoc - rev: v0.3.9 - hooks: - - id: blackdoc + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 diff --git a/README.md b/README.md index 6525c9b..2d4d3a4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # intake-thredds -| CI | [![GitHub Workflow Status][github-ci-badge]][github-ci-link] [![Code Coverage Status][codecov-badge]][codecov-link] | -| :---------- | :-----------------------------------------------------------------------------------------------------------------: | -| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] | -| **Package** | [![Conda][conda-badge]][conda-link] [![PyPI][pypi-badge]][pypi-link] | -| **License** | [![License][license-badge]][repo-link] | +| CI | [![GitHub Workflow Status][github-ci-badge]][github-ci-link] [![Code Coverage Status][codecov-badge]][codecov-link] [![pre-commit.ci status][pre-commit.ci-badge]][pre-commit.ci-link] | +| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] | +| **Package** | [![Conda][conda-badge]][conda-link] [![PyPI][pypi-badge]][pypi-link] | +| **License** | [![License][license-badge]][repo-link] | Intake interface to [THREDDS](https://www.unidata.ucar.edu/software/tds/current/catalog/) data catalogs. @@ -24,15 +24,17 @@ conda install -c conda-forge intake-thredds See [documentation](https://intake-thredds.readthedocs.io) for more information. -[github-ci-badge]: https://img.shields.io/github/workflow/status/intake/intake-thredds/CI?label=CI&logo=github&style=for-the-badge -[github-ci-link]: https://github.com/intake/intake-thredds/actions?query=workflow%3ACI -[codecov-badge]: https://img.shields.io/codecov/c/github/intake/intake-thredds.svg?logo=codecov&style=for-the-badge +[github-ci-badge]: https://github.com/intake/intake-thredds/actions/workflows/ci.yaml/badge.svg +[github-ci-link]: https://github.com/intake/intake-thredds/actions/workflows/ci.yaml +[codecov-badge]: https://img.shields.io/codecov/c/github/intake/intake-thredds.svg?logo=codecov [codecov-link]: https://codecov.io/gh/intake/intake-thredds -[rtd-badge]: https://img.shields.io/readthedocs/intake-thredds/latest.svg?style=for-the-badge +[rtd-badge]: https://readthedocs.org/projects/intake-thredds/badge/?version=latest [rtd-link]: https://intake-thredds.readthedocs.io/en/latest/?badge=latest -[pypi-badge]: https://img.shields.io/pypi/v/intake-thredds?logo=pypi&style=for-the-badge +[pypi-badge]: https://img.shields.io/pypi/v/intake-thredds?logo=pypi [pypi-link]: https://pypi.org/project/intake-thredds -[conda-badge]: https://img.shields.io/conda/vn/conda-forge/intake-thredds?logo=anaconda&style=for-the-badge +[conda-badge]: https://img.shields.io/conda/vn/conda-forge/intake-thredds?logo=anaconda [conda-link]: https://anaconda.org/conda-forge/intake-thredds -[license-badge]: https://img.shields.io/github/license/intake/intake-thredds?style=for-the-badge +[license-badge]: https://img.shields.io/github/license/intake/intake-thredds [repo-link]: https://github.com/intake/intake-thredds +[pre-commit.ci-badge]: https://results.pre-commit.ci/badge/github/intake/intake-thredds/main.svg +[pre-commit.ci-link]: https://results.pre-commit.ci/latest/github/intake/intake-thredds/main diff --git a/ci/environment-docs.yml b/ci/environment-docs.yml index 2f2971b..7b46262 100644 --- a/ci/environment-docs.yml +++ b/ci/environment-docs.yml @@ -12,7 +12,7 @@ dependencies: - myst-nb - netcdf4 - pip - - python=3.9 + - python=3.11 - siphon - sphinx - tqdm diff --git a/pyproject.toml b/pyproject.toml index cbf49fc..ea258e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,4 @@ -[tool.black] -line-length = 100 -target-version = ['py39'] -skip-string-normalization = true + [build-system] requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] @@ -9,7 +6,8 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] [tool.ruff] line-length = 100 -target-version = "py39" +target-version = "py310" + builtins = ["ellipsis"] # Exclude a variety of commonly ignored directories. exclude = [ @@ -17,27 +15,36 @@ exclude = [ ".direnv", ".eggs", ".git", + ".git-rewrite", ".hg", + ".ipynb_checkpoints", ".mypy_cache", ".nox", ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", + ".vscode", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", + "site-packages", "venv", ] +[tool.ruff.lint] per-file-ignores = {} -# E402: module level import not at top of file -# E501: line too long - let black worry about that -# E731: do not assign a lambda expression, use a def -ignore = ["E402", "E501", "E731"] +ignore = [ + "E721", # Comparing types instead of isinstance + "E741", # Ambiguous variable names + "E501", # Conflicts with ruff format +] select = [ # Pyflakes "F", @@ -50,13 +57,19 @@ select = [ "UP", ] - -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 18 -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["intake_thredds"] +[tool.ruff.format] +quote-style = "single" +docstring-code-format = true + +[tool.ruff.lint.pydocstyle] +convention = "numpy" + [tool.pytest.ini_options] console_output_style = "count" diff --git a/requirements.txt b/requirements.txt index f0fef06..18f0cc1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ aiohttp >=3.7 fsspec >=0.8.5 h5netcdf >=0.8.1 intake-xarray >=0.3 -intake >=0.6.0 +intake>=0.6.6,<2 pydap siphon tqdm diff --git a/setup.py b/setup.py index 6f4fb66..11d8b96 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,14 @@ """The setup script.""" +import pathlib from setuptools import find_packages, setup with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') -with open('README.md') as f: - long_description = f.read() - - +long_description = pathlib.Path('README.md').read_text() CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: Apache Software License', @@ -19,9 +17,9 @@ 'Intended Audience :: Science/Research', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering', ] @@ -31,7 +29,7 @@ description='Intake interface to THREDDS data catalogs.', long_description=long_description, long_description_content_type='text/markdown', - python_requires='>=3.9', + python_requires='>=3.10', maintainer='NCAR XDev Team', maintainer_email='xdev@ucar.edu', url='https://github.com/intake/intake-thredds',