-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from 3DBAG/uv-setup
Uv setup
- Loading branch information
Showing
30 changed files
with
5,964 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
version=$(bumpver show --no-fetch | cut -d' ' -f3) | ||
if ! grep -q "\[${version}\]" CHANGELOG.md; then | ||
echo "Error: CHANGELOG.md has not been updated for version ${version}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import re | ||
import sys | ||
from typing import Optional | ||
|
||
|
||
def parse_changelog(version: str) -> Optional[str]: | ||
"""Parse CHANGELOG.md and return the content for the specified version. | ||
Args: | ||
version: Version string to find in the changelog (e.g. "2024.12.16") | ||
Returns: | ||
String containing the changelog entry for the specified version, | ||
or None if version not found | ||
""" | ||
with open("CHANGELOG.md", "r") as f: | ||
content = f.read() | ||
|
||
# Pattern to match version headers | ||
version_header_pattern = r"## \[([\d.]+)\]" | ||
|
||
# Find all version headers and their positions | ||
version_matches = list(re.finditer(version_header_pattern, content)) | ||
|
||
# Find the index of our target version | ||
target_index = None | ||
for i, match in enumerate(version_matches): | ||
if match.group(1) == version: | ||
target_index = i | ||
break | ||
|
||
if target_index is None: | ||
print(f"No changelog entry found for version {version}") | ||
return None | ||
|
||
# Get the start position (right after the version header) | ||
start_pos = version_matches[target_index].end() | ||
|
||
# Get the end position (start of next version or end of file) | ||
if target_index + 1 < len(version_matches): | ||
end_pos = version_matches[target_index + 1].start() | ||
else: | ||
end_pos = len(content) | ||
|
||
# Extract the content between these positions | ||
changelog_content = content[start_pos:end_pos] | ||
|
||
# Clean up the content | ||
# Remove leading/trailing whitespace and empty lines while preserving internal formatting | ||
cleaned_lines = [] | ||
for line in changelog_content.split('\n'): | ||
if line.strip() or cleaned_lines: # Keep empty lines only after we've started collecting content | ||
cleaned_lines.append(line) | ||
|
||
# Remove trailing empty lines | ||
while cleaned_lines and not cleaned_lines[-1].strip(): | ||
cleaned_lines.pop() | ||
|
||
return '\n'.join(cleaned_lines) | ||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 2: | ||
print("Usage: python parse_changelog.py VERSION") | ||
sys.exit(1) | ||
|
||
version = sys.argv[1] | ||
changelog_content = parse_changelog(version) | ||
|
||
if changelog_content: | ||
with open("RELEASE_NOTES.md", "w") as f: | ||
f.write(changelog_content) | ||
print("Successfully extracted changelog content") | ||
else: | ||
print("Failed to extract changelog content") | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Release | ||
description: Create a new release for the 3dbag-pipeline with the specified version, use the release notes from the CHANGELOG.md file and create a pull request to merge the changes back to the develop branch. | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- master | ||
inputs: | ||
version: | ||
description: '3dbag-pipeline release version (YYYY.MM.DD)' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release: | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install bumpver | ||
run: pip install bumpver | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- name: Update version | ||
run: | | ||
bumpver update --set-version=${{ github.event.inputs.version }} --no-fetch | ||
- name: Parse Changelog | ||
run: | | ||
python .github/scripts/parse_changelog.py ${{ github.event.inputs.version }} | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: v${{ github.event.inputs.version }} | ||
name: 3DBAG ${{ github.event.inputs.version }} | ||
body_path: RELEASE_NOTES.md | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Create Pull Request to develop | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
branch: merge-release-back-to-develop | ||
base: develop | ||
title: 'Merge release ${{ github.event.inputs.version }} back to develop' | ||
body: | | ||
This PR merges the changes from release ${{ github.event.inputs.version }} back to the develop branch. | ||
Changes included in this release: | ||
``` | ||
$(cat RELEASE_NOTES.md) | ||
``` | ||
labels: | | ||
release | ||
automated pr | ||
delete-branch: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ docs/reference | |
# Tools | ||
.tox | ||
.coverage | ||
*.ruff_cache | ||
*.ruff_cache | ||
*.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changelog | ||
All notable changes to the 3dbag-pipeline are documented in this file. | ||
For the changes in the 3DBAG data set, see the [3DBAG release notes](https://docs.3dbag.nl/en/overview/release_notes/). | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
## [2024.12.16] | ||
|
||
Release that produced the 3DBAG data set version 2024.12.16. | ||
|
||
### Added | ||
- Documentation for deploying the 3dbag-pipeline, contributor guidelines and the project layout. | ||
- Docker-based deployment. | ||
- CI pipeline for testing and docker image builds. | ||
|
||
### Changed | ||
- Major refactoring of the project structure for easier maintenance and deployment. | ||
|
||
### Docker images | ||
|
||
The docker images for this release: | ||
- `3dgi/3dbag-pipeline-dagster:2024.12.16` | ||
- `3dgi/3dbag-pipeline-core:2024.12.16` | ||
- `3dgi/3dbag-pipeline-floors-estimation:2024.12.16` | ||
- `3dgi/3dbag-pipeline-party-walls:2024.12.16` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.