Skip to content

Commit

Permalink
Merge pull request #256 from akrherz/no_setup
Browse files Browse the repository at this point in the history
Try living without a setup.py file
  • Loading branch information
akrherz authored Oct 18, 2024
2 parents 0b73233 + d1cd5ec commit 090ed56
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
cp pywwa_settings.json-example pywwa_settings.json
# This is a bit brittle, but loads some data
python util/ugcs_update.py fz08mr23 2023 3 08
python util/merge_hvtec_nwsli.py hvtec.list.20240221.csv
python util/merge_hvtec_nwsli.py hvtec.list.20241009.csv
python util/copy_iem_network.py MN_ASOS
python util/copy_iem_network.py NY_COOP
python util/copy_iem_network.py NWSCLI
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ repos:
types: [python]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.9"
rev: "v0.7.0"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/tox-dev/pyproject-fmt
rev: '2.2.4'
rev: '2.4.3'
hooks:
- id: pyproject-fmt

1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
# geoplot usage
- pillow
- pint
- pip
- psycopg
# Transient via pyIEM
- pyarrow
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ authors = [
]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [
"version",
Expand Down
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

16 changes: 9 additions & 7 deletions util/merge_hvtec_nwsli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ def main(argv) -> int:
return 1

dbconn, cursor = get_dbconnc("postgis")
LOG.info(" - Connected to database: postgis")
LOG.warning(" - Connected to database: postgis")

fn = argv[1]
uri = f"https://www.weather.gov/media/vtec/{fn}"

LOG.info(" - Fetching file: %s", uri)
LOG.warning(" - Fetching file: %s", uri)
req = httpx.get(uri, timeout=30)
if req.status_code != 200:
LOG.info("Got status_code %s for %s", req.status_code, uri)
LOG.warning("Got status_code %s for %s", req.status_code, uri)
return 1
updated = 0
new = 0
Expand All @@ -54,7 +54,7 @@ def main(argv) -> int:
continue
tokens = line.strip().split(",")
if len(tokens) != 7:
LOG.info(
LOG.warning(
" + Linenum %s had %s tokens, instead of 7\n%s",
linenum + 1,
len(tokens),
Expand All @@ -64,7 +64,7 @@ def main(argv) -> int:
continue
(nwsli, river_name, proximity, name, state, lat, lon) = tokens
if "\\N" in [lat, lon] or "" in [lat, lon]:
LOG.info(
LOG.warning(
" + Linenum %s [%s] had a null lat/lon\n%s",
linenum + 1,
nwsli,
Expand All @@ -73,7 +73,7 @@ def main(argv) -> int:
bad += 1
continue
if len(nwsli) != 5:
LOG.info(
LOG.warning(
' + Linenum %s had a NWSLI "%s" not of 5 character length\n%s',
linenum + 1,
nwsli,
Expand Down Expand Up @@ -103,7 +103,9 @@ def main(argv) -> int:

cursor.close()
dbconn.commit()
LOG.info(" - DONE! %s updated %s new, %s bad entries", updated, new, bad)
LOG.warning(
" - DONE! %s updated %s new, %s bad entries", updated, new, bad
)
return 0


Expand Down

0 comments on commit 090ed56

Please sign in to comment.