-
Notifications
You must be signed in to change notification settings - Fork 48
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
Build Wheel Action #105
Build Wheel Action #105
Conversation
/retest |
9847340
to
e659341
Compare
7a6bede
to
6a83db9
Compare
OK this GHA works, building the wheel file and pushing up to PyPI. Some questions remain:
|
@z103cb Please advice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this PR is ok. We should consider perhaps having this triggered from "Create release" page in GITHUB. An example from RH library I have collaborated on can be found here: https://github.com/opendatahub-io/caikit-nlp-client/blob/main/.github/workflows/release.yml
- name: Replace release-version with provided input value | ||
run: | | ||
export RELEASE_VERSION=${{ github.event.inputs.release-version }} | ||
sed -i "s/^version = \"[0-9.]*\"$/version = \"${RELEASE_VERSION}\"/g" pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should commit this change to the file or conversely, do it in the way, it's done the here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could not find version =
is matched in pyproject.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may find version =
in this pyproject.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we go with git release, then I think we won't need to do this sed
here ? (since we would do it on tags)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - working on this... thanks for the advice, reviews!
I would prefer it be done automatically, when a new "GitHub release" is created. In the example I have provided, believe that the version is derived from the tag on the release. The relevant bits are in: [build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=60",
"setuptools-scm>=8.0",
]
[project]
name = "caikit_nlp_client"
dynamic = ["version"]
description = "caikit-nlp client"
license = { text = "Apache License 2.0" }
readme = "README.md"
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
I would ask the owners of the repo
I would not worry too much to about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nitty gritty for the GH action part
- name: Replace release-version with provided input value | ||
run: | | ||
export RELEASE_VERSION=${{ github.event.inputs.release-version }} | ||
sed -i "s/^version = \"[0-9.]*\"$/version = \"${RELEASE_VERSION}\"/g" pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could not find version =
is matched in pyproject.toml
Update @jbusche I'v tested with those changes in a repo. I believe these are changes you need in
This example would publish the package with 0.0.1rc-2 release in pypi Update: The setuptools_scm actually writes to the _version.py file. |
- name: Replace release-version with provided input value | ||
run: | | ||
export RELEASE_VERSION=${{ github.event.inputs.release-version }} | ||
sed -i "s/^version = \"[0-9.]*\"$/version = \"${RELEASE_VERSION}\"/g" pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we go with git release, then I think we won't need to do this sed
here ? (since we would do it on tags)
2cd7ba4
to
5e6f1a5
Compare
@gkumbhat and @tedhtchang, thanks for the suggestions, I got it to work on
I think the only thing perhaps left is that people didn't want it set to just python 3.9, so I added a matrix that added all three in a manor like I saw in caitkit-nlp However having 3.9, 3.10 and 3.11 ended up launching three identical workflows which isn't what I wanted, so I've made it just 3.11. Is that sufficient? |
d051df3
to
4ccd221
Compare
Signed-off-by: James Busche <jbusche@us.ibm.com> release version in build workflow Signed-off-by: James Busche <jbusche@us.ibm.com> release version in build workflow Signed-off-by: James Busche <jbusche@us.ibm.com> fix build workflow for version Signed-off-by: James Busche <jbusche@us.ibm.com> space fix in build workflow for version Signed-off-by: James Busche <jbusche@us.ibm.com> Add publish to pypi Signed-off-by: James Busche <jbusche@us.ibm.com> condense publish to pypi Signed-off-by: James Busche <jbusche@us.ibm.com> cleanup build yaml Signed-off-by: James Busche <jbusche@us.ibm.com> Switch publish to release or tag Signed-off-by: James Busche <jbusche@us.ibm.com> adding py311 and fix dependencies Signed-off-by: James Busche <jbusche@us.ibm.com> remove version from setup.py and add debugging Signed-off-by: James Busche <jbusche@us.ibm.com> adding PiPY publish Signed-off-by: James Busche <jbusche@us.ibm.com>
Signed-off-by: James Busche <jbusche@us.ibm.com>
Signed-off-by: James Busche <jbusche@us.ibm.com>
41fc9fb
to
10fad2d
Compare
PR 105 is looking good in testing from my main branch, testing creating a new release. It builds the wheel now without source (thanks for the tip @ted CHANG on how to only build the wheel file) and publishes up to PiPY. Can see that only the wheel file is published: https://pypi.org/project/fms-hf-tuning/0.0.1rc6/#files Tried on a fresh python environment, and it's looking good:
and the install looks good:
and I was successfully able to run the twitter_complaints test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM Thanks.
Description of the change
This PR adds build and publish Github Actions that will allow extra testing of the build and wheel files with tox and then ultimately publish the library out on the production PyPI when we get the token figured out.
Related issue number
Closes issue 671 and external issue #57
How to verify the PR
From my github repo, I synced my branch with main and then am able to manually run the GHA successfully, giving it the input version, for example
1.0.dev3
in this run: https://github.com/jbusche/fms-hf-tuning/actions/runs/8547067789I tried then installing from a new python env:
Was the PR tested
Yes, by running the GHA in my fork. (The GHA won't run in the upstream repo until it's synced with main branch)