Skip to content

Commit

Permalink
Include release date in extension table (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
vprivat-ads authored Jul 12, 2024
1 parent b000f8f commit ea9d4df
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python/__pycache__

6 changes: 3 additions & 3 deletions python/README_TEMPLATE.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Below you can also find a list of extensions grouped by [maturity](#grouped-by-m

### Alphabetical list

| Title | Field Name Prefix | Scope | [Maturity](https://github.com/radiantearth/stac-spec/tree/master/extensions#extension-maturity) | Version | Description |
| ----- | ----------------- | ----- | ----------------------------------------------------------------------------------------------- | ------- | ----------- |
| Title | Field Name Prefix | Scope | [Maturity](https://github.com/radiantearth/stac-spec/tree/master/extensions#extension-maturity) | Version | Release Date | Description |
| ----- | ----------------- | ----- | ----------------------------------------------------------------------------------------------- | ------- | ------------ | ----------- |
{%- for e in extensions %}
| [{{e.title}}]({{e.url}}){% if e.external %}*{% endif %} | {{e.prefix}} | {{e.scope}} | {{e.maturity}} | {{e.version}} | {{e.description}} |
| [{{e.title}}]({{e.url}}){% if e.external %}*{% endif %} | {{e.prefix}} | {{e.scope}} | {{e.maturity}} | {{e.version}} | {{e.releasedate}} | {{e.description}} |
{%- endfor %}

* **Last updated:** {{updated}}
Expand Down
Binary file removed python/__pycache__/config.cpython-311.pyc
Binary file not shown.
Binary file removed python/__pycache__/config.cpython-312.pyc
Binary file not shown.
10 changes: 9 additions & 1 deletion python/create_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ def get_extensions() -> list:
tags = tags.json()
if len(tags) > 0:
src["version"] = re.sub(r"^v", "", tags[0]["name"])
try:
with requests.get(tags[0]["commit"]["url"], headers=headers) as commit:
src["releasedate"] = commit.json()["commit"]["author"]["date"][:10]
except error as e:
logger.error(f"commit not available: {e}")
else:
src["version"] = "**Unreleased**"
src["releasedate"] = "N/A"
if "maturity" not in src:
src["maturity"] = wip
except error as e:
Expand Down Expand Up @@ -131,6 +137,8 @@ def get_extensions() -> list:
src["maturity"] = unknown
if "scope" not in src:
src["scope"] = unknown
if "releasedate" not in src:
src["releasedate"] = unknown

return data

Expand Down Expand Up @@ -159,7 +167,7 @@ def main() -> bool:
count = len(data)

if count < 45:
logger.error("Something likely went wrong as there are not enough repos listed, don't overrride README")
logger.error("Something likely went wrong as there are not enough repos listed, don't override README")
sys.exit(1)

now = datetime.utcnow().strftime("%b %d %Y, %H:%M %Z")
Expand Down

0 comments on commit ea9d4df

Please sign in to comment.