Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4.1.1
- uses: actions/setup-python@v5.1.0
with:
python-version: 3.8
python-version: 3.11
architecture: x64
- name: install requirements
run: pip3 install -r tests/requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:

jobs:
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8','3.9','3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-python@v5.1.0
Expand All @@ -21,10 +21,10 @@ jobs:
- name: run tests
run: pytest -v
canpackage:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8','3.9','3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
11 changes: 7 additions & 4 deletions converter/convert_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,12 @@ def map_ELEMENT(*args):

#endregion

def main(input: str, output: str):
def main(input = None, output = None):
if input is None:
input = sys.argv[1]
if output is None:
output = sys.argv[2]

remapped_variables = {} # If any variables had to be renamed, keep track of this mapping

def getName(name: str):
Expand Down Expand Up @@ -1157,8 +1162,6 @@ def cleanup(indent=False):
print(f"Saving to: {output}")

if __name__ == "__main__":
input = sys.argv[1]
output = sys.argv[2]
main(input, output)
main()

# vim: ts=4 sw=4 expandtab fileencoding=utf-8
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[project]
name = "cwms-repgen"
dynamic = ["version"]
dependencies = [
"requests>=2.27.1",
"pytz",
]
requires-python = ">=3.8"
authors = [
{ name = "USACE-HEC" },
]
description = "This is a partial copy of HEC's (Hydrologic Engineering Center) repgen program. The program creates fixed form text reports from a time series database, and textfiles."
readme = "README.md"
license = "MIT"
license-files = [ "LICEN[CS]E.*" ]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
urls = { GitHub = "https://github.com/USACE-WaterManagement/repgen5" }

[project.optional-dependencies]
dateutil = [
"python-dateutil>=2.8.2",
]
dev = [
"sphinx",
"sphinx_rtd_theme",
"sphinx-copybutton",
"myst-parser",
"twine",
"wheel",
]

[project.scripts]
repgen = "repgen.__main__:main"
repgen5 = "repgen.__main__:main"
convert_report = "converter.convert_report:main"

[build-system]
# These are the assumed default build requirements from pip:
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
requires = [ "setuptools>=43.0.0", "wheel" ]
build-backend = "setuptools.build_meta"

[tool.setuptools]
package-dir = { "repgen" = "repgen", "converter" = "converter" }

[tool.setuptools.dynamic]
version = { attr = "repgen.__main__.version" }
2 changes: 1 addition & 1 deletion repgen/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def fill_report(self, output):
newval = data_point.misstr
# Replace every instance in the line *exactly* with the new value
if self.compatibility:
tmp = tmp.replace(v.upper(), newval)
tmp = re.sub(re.escape(v), newval, tmp, flags=re.IGNORECASE)
else:
tmp = tmp.replace(v, newval)
if self.compatibility:
Expand Down
45 changes: 0 additions & 45 deletions setup.py

This file was deleted.