Skip to content

Commit

Permalink
Fixes readme generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed Jun 25, 2024
1 parent a00849e commit 97deb65
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 109 deletions.
2 changes: 1 addition & 1 deletion dockerfiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ bump-%:
tbump --no-tag --no-push $(shell pysemver bump $* $(shell tbump current-version)) && make changelog && git add changelog.md && git commit -m "Updates changelog"

readme:
docker run -it --rm --entrypoint python -v $(PWD):/host -w /host $(NAMESPACE)/$(REPOSITORY):$(VERSION) /host/generate.py $(ENVIRONMENT_FILE)
docker run -it --rm --entrypoint python -v $(PWD)/../:/host -w /host $(NAMESPACE)/$(REPOSITORY):$(VERSION) /host/generate.py $(REPOSITORY)/$(ENVIRONMENT_FILE) $(REPOSITORY)
2 changes: 1 addition & 1 deletion dockerfiles/climate-notebook-gpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
| ML packages |
| ----------- |
| rapids 0.0.1 |
| cupy 13.2.0 |
| cupy 13.2.0 |
3 changes: 2 additions & 1 deletion dockerfiles/climate-notebook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
| netcdf4 1.6.5 | gsw-xarray 0.4.0 | seaborn 0.13.2 |
| s3fs 2024.6.0 | | cartopy 0.23.0 |
| zarr 2.18.2 | | datashader 0.16.2 |

| Computing packages | Discovery packages |
| ------------------ | ------------------ |
| dask-gateway 2024.1.0 | intake-esm 2024.2.6 |
| | intake-stac 0.4.0 |
| | intake-xarray 0.7.0 |
| | intake-xarray 0.7.0 |
104 changes: 0 additions & 104 deletions dockerfiles/climate-notebook/generate.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import json
import re
import subprocess
Expand All @@ -8,6 +9,7 @@
def main():
parser = argparse.ArgumentParser()
parser.add_argument("file", help="Conda environment file")
parser.add_argument("output-path", help="Output directory")

kwargs = vars(parser.parse_args())

Expand Down Expand Up @@ -48,15 +50,17 @@ def main():
]
rows = "\n".join(f"| {x} |" for x in rows)

table.append(f"{header}\n{rows}")
table.append(f"{header}\n{rows}\n")

table = "\n".join(table)

data = f"""# Packages
{table}"""

with open("README.md", "w") as fd:
output_path = os.path.join(kwargs["output-path"], "README.md")

with open(output_path, "w") as fd:
fd.write(data)


Expand Down

0 comments on commit 97deb65

Please sign in to comment.