diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 595bfeb..d3f2ab6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,13 +14,13 @@ repos: files: requirements-dev.txt - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black language_version: python3 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.4.1 hooks: - id: mypy exclude: docs/source/conf.py @@ -40,7 +40,7 @@ repos: args: [--config=pyproject.toml] - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.5 hooks: - id: codespell exclude: > @@ -51,17 +51,17 @@ repos: - --ignore-words-list=pres - repo: https://github.com/asottile/add-trailing-comma - rev: v2.4.0 + rev: v3.0.1 hooks: - id: add-trailing-comma - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.270 + rev: v0.0.284 hooks: - id: ruff - repo: https://github.com/tox-dev/pyproject-fmt - rev: 0.11.2 + rev: 0.13.0 hooks: - id: pyproject-fmt diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4fccefb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: minimal - -env: - global: - # Doctr deploy key for ioos/gliderpy - - secure: "Z+q3ksUzicSSnONR1BQjIKaUQG6wWWu0SkuZT9jnSkBxpbf9g6DJlBAq2jeThe895jtGwQYatrprzBAbnxz11GkL2loj5fQkYSZenDsIUE1Ah9duT+Y2Oy1dsXCanvG4WOVDnYEOp/S/sq7KijD6aSokoZnti2e3LHFp/jTPOwo+7mjBfjC0y0OHIf5BuZxR8LvD6ft/EVQegD1DcuBM8Jv7gornZXW459Pxx9UG151VAHKbpNyqj+jQYIH/p8Bz8lxC9njRxdnUtfqEx3hzj66VXUlP6PbSa6G6g1MW4hekSE9cV0g6e8U9/EceKHLla5zu+h2ZOXHXYZKkqj/HsYOUOhepFNktusPIb8/j8A22mupad9t1FkO2z/cFpRD5IcIuanQYRHaU8Bnlvzx/rpc4MfMhT+TLrBS/E48swbBh5a1qyv7CnwPoBbFzRC8lrqlceQ8Vkag48rEHRZBLDUiMl3/+P0JxrOHwQcf+ymBGMgaUewOvsdhTsggEjsw/f9FPpwL58j/FK3w5x7thwo6BmLpLjX2Ab2AQ4xa0KSFLjX0LpLvQmHkEA+vcEOFVs5sYU9NPyVx2OYf+614ELjIQlQUhMjjknVpif7d5sssREGP+OOxHvTIhJ2mjcbROfEs4dZxg7cQHKHH1TZ4iF1E9TxtzLKQJAprshgZWcwA=" - -before_install: - # Install micromamba and create TEST env. - - | - wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba --strip-components=1 - ./micromamba shell init -s bash -p ~/micromamba - export MAMBA_ROOT_PREFIX=~/micromamba - export MAMBA_EXE=$(pwd)/micromamba - . ${MAMBA_ROOT_PREFIX}/etc/profile.d/mamba.sh - - echo "micromamba version $(micromamba --version)" - micromamba create --yes --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge - micromamba activate TEST - -install: - - pip install -e . --no-deps --force-reinstall - -script: - - | - set -e - travis_wait jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=quick_intro-output.ipynb - travis_wait jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=plotting.ipynb-output.ipynb - mv notebooks/*-output.ipynb docs/source/ - pushd docs - make clean html linkcheck - popd - if [[ -z "$TRAVIS_TAG" ]]; then - python -m doctr deploy --build-tags --key-path github_deploy_key_ioos_gliderpy.enc --built-docs docs/build/html dev - else - python -m doctr deploy --build-tags --key-path github_deploy_key_ioos_gliderpy.enc --built-docs docs/build/html "version-$TRAVIS_TAG" - python -m doctr deploy --build-tags --key-path github_deploy_key_ioos_gliderpy.enc --built-docs docs/build/html . - fi diff --git a/gliderpy/fetchers.py b/gliderpy/fetchers.py index 64cc2f2..427d11c 100644 --- a/gliderpy/fetchers.py +++ b/gliderpy/fetchers.py @@ -168,5 +168,4 @@ def get_ids(self): raise ValueError(f"The {self.e.server} does not supported this operation.") # TODO: List the platform_deployment variable # if self.e.server == "https://erddap.ifremer.fr/erddap": - # dataset_id = OceanGlidersGDACTrajectories # platform_deployment diff --git a/gliderpy/servers.py b/gliderpy/servers.py index 646955a..bc02ee2 100644 --- a/gliderpy/servers.py +++ b/gliderpy/servers.py @@ -8,7 +8,7 @@ "National Glider Data Assembly Center": "https://gliders.ioos.us/erddap", "NGDAC": "https://gliders.ioos.us/erddap", "IOOS": "https://gliders.ioos.us/erddap", - "Ocean Observatories Initiative": "https://erddap.dataexplorer.oceanobservatories.org/erddap/index.html", # noqa + "Ocean Observatories Initiative": "https://erddap.dataexplorer.oceanobservatories.org/erddap/index.html", "OOI": "https://erddap.dataexplorer.oceanobservatories.org/erddap/index.html", "Institut français de recherche pour l'exploitation de la mer": "https://www.ifremer.fr/erddap", "ifremer": "https://www.ifremer.fr/erddap", @@ -54,10 +54,10 @@ def server_select(server_string): """ Attempts to match the supplied string to a known ERDDAP server by address or alias """ - if server_string in server_vars.keys(): + if server_string in server_vars: # If string matches exactly, return unchanged return server_string - for server in server_vars.keys(): + for server in server_vars: # If string contains base ERDDAP address, return base ERDDAP address if server in server_string: return server diff --git a/pyproject.toml b/pyproject.toml index d409063..2951087 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,13 +46,6 @@ write_to = "gliderpy/_version.py" write_to_template = "__version__ = '{version}'" tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" -[tool.pytest.ini_options] -filterwarnings = [ - "error:::gliderpy.*", - "ignore::UserWarning", - "ignore::RuntimeWarning", -] - [tool.ruff] select = [ "A", # flake8-builtins @@ -62,6 +55,13 @@ select = [ "I", # import sorting "T20", # flake8-print "UP", # upgrade + "ERA", # flake8-eradicate/eradicate (remove commented out code) + "PIE", # flake8-pie (misc lints) + "SIM", # flake8-simplify (reduce code complexity) + "TID", # flake8-tidy-imports + "TCH", # flake8-type-checking + "N", # pep8-naming + "RUF", # Ruff-specific rules ] target-version = "py38" line-length = 79 @@ -70,6 +70,14 @@ line-length = 79 "docs/source/conf.py" = [ "E402", "A001", + "ERA001", +] + +[tool.pytest.ini_options] +filterwarnings = [ + "error:::gliderpy.*", + "ignore::UserWarning", + "ignore::RuntimeWarning", ] [tool.check-manifest]