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

Change __version__ on release #529

Merged
merged 6 commits into from
Oct 10, 2023
Merged

Conversation

Yang-33
Copy link
Contributor

@Yang-33 Yang-33 commented Oct 6, 2023

#526

To make release easier, this pull request

  1. Stop embedding version. Instead, code reads __version__ defined in linebot/__about__.py.
  2. Add github acitions that commits generated code to master branch directly.
  3. Replace __verison__ with ${{ github.event.release.tag_name }} before uploading python package on release. (ref: line-bot-java-sdk)

If this change is merged, all we have to do can be

  • creating release
  • fixing unexpected error in CI

@Yang-33 Yang-33 changed the title Don't change __version__ in source code Change __version__ on release Oct 6, 2023
@Yang-33 Yang-33 force-pushed the read-package-version branch from e1978cf to ca638b8 Compare October 6, 2023 16:30
@Yang-33 Yang-33 force-pushed the read-package-version branch from ca638b8 to 53ea5b9 Compare October 6, 2023 16:34
@@ -15,7 +15,7 @@
"""Meta data of line-bot-sdk."""


__version__ = '3.5.0'
__version__ = "__LINE_BOT_SDK_PYTHON_VERSION__"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(check point)

python generate-code.py
- name: Update version in linebot/__about__.py
run: |
sed -i 's/__version__ = "__LINE_BOT_SDK_PYTHON_VERSION__"/__version__ = "12.34.5"/g' linebot/__about__.py
Copy link
Contributor

Choose a reason for hiding this comment

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

What's 12.34.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should have written why this uses 12.34.5...
Tox (test library) rejects running test if version is illegal. As a workaround, this embeds dummy version.

@Yang-33 Yang-33 requested a review from tokuhirom October 10, 2023 08:31
Copy link
Contributor

@tokuhirom tokuhirom left a comment

Choose a reason for hiding this comment

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

LGTM

@Yang-33 Yang-33 merged commit e9e1ce1 into line:master Oct 10, 2023
@Yang-33 Yang-33 deleted the read-package-version branch October 10, 2023 09:03
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