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

Add changelog script #544

Merged
merged 3 commits into from
Sep 12, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ examples/notebooks/*.tif
examples/**/*.tif
examples/html/
docs/cache/
docs/changelog_update.md
# docs/*.html
cache/
testing/
Expand Down
18 changes: 18 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## v0.24.2 - Sep 10, 2023

**What's Changed**

- Change tms_to_geotiff to map_tiles_to_geotiff by @giswqs in [#536](https://github.com/opengeos/leafmap/pull/536)
- Fix MosaicJSON bug in add_stac_layer by @giswqs in [#538](https://github.com/opengeos/leafmap/pull/538)

**Full Changelog**: [v0.24.1...v0.24.2](https://github.com/opengeos/leafmap/compare/v0.24.1...v0.24.2)

## v0.24.1 - Sep 6, 2023

**What's Changed**

- Update GitHub Actions by @giswqs in [#532](https://github.com/opengeos/leafmap/pull/532)
- Add support fot Google Solar API by @giswqs in [#534](https://github.com/opengeos/leafmap/pull/534)

**Full Changelog**: [v0.24.0...v0.24.1](https://github.com/opengeos/leafmap/compare/v0.24.0...v0.24.1)

## v0.24.0 - Sep 4, 2023

## What's Changed
Expand Down
44 changes: 44 additions & 0 deletions docs/changelog_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import re

# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Change tms_to_geotiff to map_tiles_to_geotiff by @giswqs in https://github.com/opengeos/leafmap/pull/536
* Fix MosaicJSON bug in add_stac_layer by @giswqs in https://github.com/opengeos/leafmap/pull/538


**Full Changelog**: https://github.com/opengeos/leafmap/compare/v0.24.1...v0.24.2
"""

# Regular expression pattern to match the Markdown hyperlinks
pattern = r"https://github\.com/opengeos/leafmap/pull/(\d+)"


# Function to replace matched URLs with the desired format
def replace_url(match):
pr_number = match.group(1)
return f"[#{pr_number}](https://github.com/opengeos/leafmap/pull/{pr_number})"


# Use re.sub to replace URLs with the desired format
formatted_text = re.sub(pattern, replace_url, markdown_text)

for line in formatted_text.splitlines():
if "Full Changelog" in line:
prefix = line.split(": ")[0]
link = line.split(": ")[1]
version = line.split("/")[-1]
formatted_text = (
formatted_text.replace(line, f"{prefix}: [{version}]({link})")
.replace("## What's Changed", "**What's Changed**")
.replace("## New Contributors", "**New Contributors**")
)


with open("docs/changelog_update.md", "w") as f:
f.write(formatted_text)

# Print the formatted text
print(formatted_text)

# Copy the formatted text and paste it to the CHANGELOG.md file
2 changes: 1 addition & 1 deletion leafmap/basemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import xyzservices
from .common import check_package, planet_tiles

GOOGLE_MAPS_API_KEY = os.environ.get("GOOGLE_MAPS_API_KEY", "")
GOOGLE_MAPS_API_KEY = os.environ.get("GOOGLE_MAPS_API_KEY", "YOUR-API-KEY")

XYZ_TILES = {
"OpenStreetMap": {
Expand Down