Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate setup.cfg to pyproject.toml #263

Merged
merged 7 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip Sphinx furo
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_nwis_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_nwm_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_nwm_client_new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_rest_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_slow_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_svi_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
48 changes: 43 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"pip"
]
requires = ["setuptools>=70"]
build-backend = "setuptools.build_meta"

[project]
name = "hydrotools"
authors = [
{ name = "Jason A. Regina", email = "[email protected]" },
{ name = "Austin Raney", email = "[email protected]" },
]
description = "Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data."
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: Free To Use But Restricted",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Hydrology",
"Operating System :: OS Independent",
]
dependencies = [
"hydrotools.nwis_client>=3.2.1",
"hydrotools.nwm_client[gcp]>=5.0.3",
"hydrotools.events>=1.1.5",
"hydrotools.metrics>=1.2.3",
]
dynamic = ["version"]

[tool.setuptools.dynamic]
version = { attr = "hydrotools._version.__version__" }

[project.optional-dependencies]
develop = ["pytest"]

[project.urls]
Homepage = "https://github.com/NOAA-OWP/hydrotools"
Documentation = "https://noaa-owp.github.io/hydrotools"
Repository = "https://github.com/NOAA-OWP/hydrotools"
"Bug Tracker" = "https://github.com/NOAA-OWP/hydrotools/issues"
43 changes: 40 additions & 3 deletions python/_restclient/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
[build-system]
requires = ["setuptools>=70"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=42",
"wheel",

[project]
name = "hydrotools._restclient"
authors = [{ name = "Austin Raney", email = "[email protected]" }]
description = "General REST api client with built in request caching and retries."
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: Free To Use But Restricted",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Hydrology",
"Operating System :: OS Independent",
]
dependencies = [
"aiohttp",
"aiohttp_client_cache[sqlite]>=0.9.0",
"python-forge",
"aiosqlite",
"pandas",
]
dynamic = ["version"]

[tool.setuptools.dynamic]
version = { attr = "hydrotools._restclient._version.__version__" }

[project.optional-dependencies]
develop = ["pytest", "pytest-aiohttp"]

[project.urls]
Homepage = "https://github.com/NOAA-OWP/hydrotools"
Documentation = "https://noaa-owp.github.io/hydrotools/hydrotools._restclient.html"
Repository = "https://github.com/NOAA-OWP/hydrotools/tree/main/python/_restclient"
"Bug Tracker" = "https://github.com/NOAA-OWP/hydrotools/issues"
47 changes: 0 additions & 47 deletions python/_restclient/setup.cfg

This file was deleted.

12 changes: 5 additions & 7 deletions python/_restclient/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ async def test_get_check_cache(basic_test_server):
assert r2.from_cache is True


def test_get_non_async(basic_test_server, loop):
with pytest.warns(DeprecationWarning):
# throws DeprecationWarning b.c. session not create in async func
session = ClientSession()
resp_coro = session.get(basic_test_server["uri"])
resp = loop.run_until_complete(resp_coro)
assert loop.run_until_complete(resp.json()) == basic_test_server["data"]
def test_get_non_async(basic_test_server, event_loop):
session = ClientSession(loop=event_loop)
resp_coro = session.get(basic_test_server["uri"])
resp = event_loop.run_until_complete(resp_coro)
assert event_loop.run_until_complete(resp.json()) == basic_test_server["data"]


@pytest.fixture
Expand Down
40 changes: 35 additions & 5 deletions python/caches/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"pip"
]
requires = ["setuptools>=70"]
build-backend = "setuptools.build_meta"

[project]
name = "hydrotools.caches"
authors = [{ name = "Jason A. Regina", email = "[email protected]" }]
description = "Variety of object caching utilities for OWPHydroTools."
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: Free To Use But Restricted",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Hydrology",
"Operating System :: OS Independent",
]
dependencies = ["numpy<2; python_version<'3.10'", "pandas", "tables"]
dynamic = ["version"]

[tool.setuptools.dynamic]
version = { attr = "hydrotools.caches._version.__version__" }

[project.optional-dependencies]
develop = ["pytest"]

[project.urls]
Homepage = "https://github.com/NOAA-OWP/hydrotools"
Documentation = "https://noaa-owp.github.io/hydrotools/hydrotools.caches.html"
Repository = "https://github.com/NOAA-OWP/hydrotools/tree/main/python/caches"
"Bug Tracker" = "https://github.com/NOAA-OWP/hydrotools/issues"
Loading