Skip to content

Commit

Permalink
Update-pre-commit-hooks (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 authored Mar 1, 2024
1 parent 991758c commit acf0005
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 58 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -62,5 +62,5 @@ jobs:
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
skip_existing: true
skip-existing: true
verbose: true
15 changes: 3 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ci:
autoupdate_schedule: quarterly
autoupdate_schedule: monthly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -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
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
2 changes: 1 addition & 1 deletion ci/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- myst-nb
- netcdf4
- pip
- python=3.9
- python=3.11
- siphon
- sphinx
- tqdm
Expand Down
37 changes: 25 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
[tool.black]
line-length = 100
target-version = ['py39']
skip-string-normalization = true


[build-system]
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 = [
".bzr",
".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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@

"""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',
'Operating System :: OS Independent',
'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',
]

Expand All @@ -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='[email protected]',
url='https://github.com/intake/intake-thredds',
Expand Down

0 comments on commit acf0005

Please sign in to comment.