-
Notifications
You must be signed in to change notification settings - Fork 3
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
update framework #77
update framework #77
Changes from 11 commits
28a176b
13ce71f
a57a443
7e5d3bc
0a356eb
df36485
28ee6bc
107cbd7
339f16d
c321b8c
29cf08d
4ba9d8e
4e918e6
756ea95
f3ca0dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# GitHub Actions | ||
|
||
## Building the Conda Package: [conda_build_and_publish.yml](https://github.com/paskino/qt-elements/blob/main/.github/workflows/conda_build_and_publish.yml) | ||
This github action builds and tests the conda package, by using the [conda-package-publish-action](https://github.com/paskino/conda-package-publish-action) | ||
Runs automatically on every commit via [test.yml](./test.yml). | ||
|
||
When pushing to main *all* variants are built and tested. | ||
## Testing | ||
|
||
When making an [annotated](https://git-scm.com/book/en/v2/Git-Basics-Tagging) tag, *all* variants are built, tested and published to the [paskino conda channel for qt-elements](https://anaconda.org/paskino/eqt/files). This package is noarch. | ||
Runs `pytest`. | ||
|
||
When opening or modifying a pull request to main, a single variant is built and tested, but not published. This variant is `python=3.7` and `numpy=1.18`. | ||
## Building | ||
|
||
## Building the PyPi Package: [pypi_publish.yml](https://github.com/paskino/qt-elements/blob/main/.github/workflows/pypi_publish.yml) | ||
This github action builds the pypi package, by using the [deploy-pypi action](https://github.com/casperdcl/deploy-pypi). | ||
Runs automatically after tests (above) succeed. | ||
|
||
When pushing to main it is built and checked. | ||
Builds binary (`*.whl`) & source (`*.tar.gz`) distributions. | ||
|
||
When making an [annotated](https://git-scm.com/book/en/v2/Git-Basics-Tagging) tag, it is built and published to the [PyPi](https://pypi.org/project/eqt/#description). | ||
## Releasing | ||
|
||
Runs automatically -- when a [tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) is pushed -- after builds (above) succeed. | ||
|
||
Publishes to [PyPI](https://pypi.org/project/eqt) and drafts changelog (release notes) at <https://github.com/paskino/qt-elements/releases>. | ||
|
||
:warning: The draft notes above need to be manually tidied & approved by a maintainer. |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test | ||
on: | ||
push: | ||
pull_request: | ||
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we not need to specify the branch (main)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's better not to |
||
jobs: | ||
test: | ||
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association) | ||
name: py${{ matrix.python }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.7, 3.11] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will the binaries built be only available for Python 3.7 and 3.11? In such a case, I'd like to be sure that these are available for all Python versions compatible with CIL, which are from 3.8 to 3.10! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, binaries are built for all python versions. CI unit tests are only run for min & max supported versions. |
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- run: pip install -U .[dev] | ||
- run: pytest | ||
deploy: | ||
needs: [test] | ||
name: PyPI Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- id: dist | ||
uses: casperdcl/deploy-pypi@v2 | ||
casperdcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
build: true | ||
password: ${{ secrets.EQT_SECRET_TOKEN }} | ||
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | ||
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
name: Release | ||
run: | | ||
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD) | ||
tag="${GITHUB_REF#refs/tags/}" | ||
gh release create --title "Version $tag" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }} dist/${{ steps.dist.outputs.targz }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this automatically create the version description from the git logs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes but as per the updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the concept here is that we use I like the automation, however I feel that the release text is related to a GitHub feature rather than an integral part of the software. Often I find myself editing the changelog differently than the commit messages. Maybe it is a good practice to write the commit messages better! My real argument against deleting the As I understand it, there will still be the chance to edit the draft text, but how can we find the final text not on GitHub? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's not about automation. Automation is merely a happy bonus side-effect. It's about DRY/SSoT (see full explanation, including bugs I had to manually fix in the old release noted).
Still possible here. I do the same. The commit messages injected in the draft ensure:
Annotated tags & (merge) commit messages. Finally, overall harsh truth:
I really believe there is zero frustration if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @paskino as discussed, I've now updated all git tags to have annotations containing the release notes. You can git config --global alias.changelog 'for-each-ref --sort=-*authordate --format="# %(contents:subject)%0a%(contents:body)" refs/tags'
git changelog next step is to https://github.com/paskino/qt-elements/transfer to @TomographicImaging FootnotesThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added instructions & tests for annotated tags: 4e918e6 |
||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
eqt/version.py | ||
*.py[cod] | ||
__pycache__/ | ||
/eqt/_dist_ver.py | ||
/*.egg*/ | ||
/build/ | ||
/dist/ | ||
/.coverage* | ||
/coverage.xml | ||
/.pytest_cache/ |
This file was deleted.
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 could rename this and the filename to reflect that it both tests and possibly deploys?
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.