From 937f09f6150cf45f386e58d51d70e71b660eab57 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 27 Oct 2026 09:16:40 -0300 Subject: [PATCH 1/3] move to a pypi only solution --- .github/dependabot.yml | 13 +++++++++++++ .github/workflows/tests.yml | 34 +++++++++++++++++----------------- .pre-commit-config.yaml | 8 +++----- ctd/read.py | 8 ++++---- pyproject.toml | 26 +++++++++++++++++++++++++- requirements-dev.txt | 12 ------------ requirements.txt | 7 ------- 7 files changed, 62 insertions(+), 46 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 65897cd..441d5c7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,19 @@ version: 2 updates: - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + labels: + - "Bot" + groups: + github-actions: + patterns: + - '*' + cooldown: + default-days: 7 + + - package-ecosystem: "pre-commit" directory: "/" schedule: interval: "daily" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5d75ba3..44bb334 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,34 +13,34 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.11", "3.12", "3.13", "3.14" ] - os: [ windows-latest, ubuntu-latest, macos-latest ] + python-version: [ "3.11", "3.15" ] + os: [ ubuntu-latest ] + include: + - os: windows-latest + python-version: "3.15" + - os: macos-latest + python-version: "3.15" + - os: macos-15-intel + python-version: "3.15" fail-fast: false + permissions: + actions: none steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - name: Setup Micromamba Python ${{ matrix.python-version }} - uses: mamba-org/setup-micromamba@f457c30a868e4760d3a6fcea5f25dc655b8edf39 # v3.2.1 + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - environment-name: TEST - init-shell: bash - create-args: >- - python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge + python-version: ${{ matrix.python-version }} - - name: Install ctd - shell: bash -l {0} + - name: Install library run: | - python -m pip install -e . --no-deps --force-reinstall - - - name: Tests - shell: bash -l {0} - run: | - python -m pytest -rxs tests + pip install --group dev + pip install -e . - name: Doctests - shell: bash -l {0} run: | python -m pytest -s -rxs --doctest-modules -vv ctd diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5278b8a..8dfed52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,8 +10,6 @@ repos: - id: check-docstring-first - id: check-added-large-files - id: requirements-txt-fixer - - id: file-contents-sorter - files: requirements-dev.txt - repo: https://github.com/econchick/interrogate rev: 1.7.0 @@ -29,7 +27,7 @@ repos: - --ignore-words-list=pres,nd,te,afe,ue,wil,tey,te,ot,fo - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.10 + rev: v0.17.3 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -52,12 +50,12 @@ repos: - id: nb-strip-paths - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.30.1 + rev: v2.30.3 hooks: - id: pyproject-fmt - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.30.1 + rev: v1.31.1 hooks: - id: zizmor diff --git a/ctd/read.py b/ctd/read.py index 34b48da..5cfbc4d 100644 --- a/ctd/read.py +++ b/ctd/read.py @@ -4,7 +4,7 @@ import bz2 import collections -import datetime +import datetime as dt import gzip import linecache import re @@ -175,10 +175,10 @@ def _parse_seabird(lines: list, ftype: str) -> dict: # noqa: C901, PLR0912, PLR if "NMEA UTC (Time)" in line: time = line.split("=")[-1].strip() # Should use some fuzzy datetime parser to make this more robust. - time = datetime.datetime.strptime( + time = dt.datetime.strptime( time, "%b %d %Y %H:%M:%S", - ).astimezone(datetime.UTC) + ).astimezone(dt.UTC) # cnv file header ends with *END* while if ftype == "cnv": @@ -229,7 +229,7 @@ def from_bl(fname: str | Path) -> pd.DataFrame: >>> data_path = Path(__file__).parents[1].joinpath("tests", "data") >>> df = ctd.from_bl(str(data_path.joinpath("bl", "bottletest.bl"))) >>> df._metadata["time_of_reset"] - datetime.datetime(2018, 6, 25, 20, 8, 55) + dt.datetime(2018, 6, 25, 20, 8, 55) """ f = _read_file(fname) diff --git a/pyproject.toml b/pyproject.toml index 60ee09b..953816e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,10 +19,34 @@ classifiers = [ "Programming Language :: Python :: 3.15", ] dynamic = [ - "dependencies", "readme", "version", ] +dependencies = [ + "chardet<7", + "gsw>=3.3", + "matplotlib", + "numpy>=2", + "pandas>=0.24", + "pandas-flavor>=0.1.2", + "scipy", +] + +[dependency-groups] +dev = [ + "check-manifest", + "mypy", + "nbclassic", + "nbconvert", + "nbsphinx", + "pooch", + "pre-commit", + "pytest", + "pytest-cov", + "setuptools-scm", + "sphinx", + "twine", +] urls.documentation = "https://pyoceans.github.io/python-ctd" urls.homepage = "https://github.com/pyoceans/python-ctd" urls.repository = "https://github.com/pyoceans/python-ctd" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 1a84fe8..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,12 +0,0 @@ -check-manifest -mypy -nbclassic -nbconvert -nbsphinx -pooch -pre-commit -pytest -pytest-cov -setuptools_scm -sphinx -twine diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e2f463d..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -chardet<7 -gsw>=3.3.0 -matplotlib -numpy>=2 -pandas>=0.24.0 -pandas-flavor>=0.1.2 -scipy From 39bb33851cfb6f32e5336775305817f7fb3c0ae8 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 27 Oct 2026 09:20:43 -0300 Subject: [PATCH 2/3] missed one --- .github/workflows/deploy-docs.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 28b1e62..deedb04 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -25,21 +25,20 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Setup Micromamba Python - uses: mamba-org/setup-micromamba@f457c30a868e4760d3a6fcea5f25dc655b8edf39 # v3.2.1 + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - environment-name: TEST - init-shell: bash - create-args: >- - python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge + python-version: "3.x" - - name: Install ctd - shell: bash -l {0} + - name: Install erddapy run: | - python -m pip install -e . --no-deps --force-reinstall + pip install --group dev + pip install -e . + + - name: Install pandoc + uses: pandoc/actions/setup@86321b6dd4675f5014c611e05088e10d4939e09e # v1.1.1 - name: Build documentation - shell: bash -l {0} run: > set -e && jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=quick_intro-output.ipynb From e437681867adaaceacaf1b06d10f015e98c710b4 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 27 Oct 2026 09:23:53 -0300 Subject: [PATCH 3/3] convention not adopted everywhere, right?! --- ctd/read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctd/read.py b/ctd/read.py index 5cfbc4d..17c8eab 100644 --- a/ctd/read.py +++ b/ctd/read.py @@ -229,7 +229,7 @@ def from_bl(fname: str | Path) -> pd.DataFrame: >>> data_path = Path(__file__).parents[1].joinpath("tests", "data") >>> df = ctd.from_bl(str(data_path.joinpath("bl", "bottletest.bl"))) >>> df._metadata["time_of_reset"] - dt.datetime(2018, 6, 25, 20, 8, 55) + datetime.datetime(2018, 6, 25, 20, 8, 55) """ f = _read_file(fname)