Skip to content

added script to update gh component header#7

Merged
chenkasirer merged 4 commits intomainfrom
gh_header
Sep 17, 2025
Merged

added script to update gh component header#7
chenkasirer merged 4 commits intomainfrom
gh_header

Conversation

@chenkasirer
Copy link
Copy Markdown
Member

Introduces invoke update-gh-header which let's you set a new minimum library version in the header of all cpython grasshopper components.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Copy link
Copy Markdown
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the duplicated func, otherwise it lgtm

f.write(new_header + "\n")
else:
f.write(line)
print(f"✅ Updated: {file}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you use emoji in source code, I think you need to declare the encoding of the file in the very first line

import os
import shutil
import tempfile
from pathlib import Path
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no, pathlib is spreading :P

Comment thread src/compas_invocations2/grasshopper.py Outdated
ctx.run(f"{yak_exe_path} push {yak_file}")


def _get_version_from_toml() -> str:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function already exists in this file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed! sorry about that

Comment thread src/compas_invocations2/grasshopper.py Outdated
return version


def _get_package_name() -> str:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should follow the existing _get_version_from_toml that takes the toml file as input

Copy link
Copy Markdown
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@chenkasirer chenkasirer merged commit 84fb5b9 into main Sep 17, 2025
11 checks passed
@chenkasirer chenkasirer deleted the gh_header branch September 17, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants