-
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
Conversation
4224fa5
to
29cf08d
Compare
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.
Thanks, it looks great! Please see my comments 😄
Nice work on tidying the tests!
@@ -1,66 +0,0 @@ | |||
|
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 we need to keep the CHANGELOG.
The way we use it is, when anything is merged to master, we add a description of the changes to the change log, for version x.x.x, this continues until we decide to release. Then when we release we copy over the contents of the change log.
So we use it as we go along, before releases.
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.
Committed CHANGELOG.txt
files were indeed standard in the days of mercurial & subversion, but are becoming less common. A few reasons I can think of:
- adhering to SSoT/DRY principles, i.e. no duplication across
CHANGELOG.txt
andgithub.com/OWNER/REPO/releases
- btw they were out of sync in this repo - I had to update some of the release notes & add a few missing releases in https://github.com/paskino/qt-elements/releases
- not bloating repo size & reducing download time
- triggering CI
- GHA can run workflows
on.release
- it's far less common & more complex/error-prone to use
on.push.paths
- GHA can run workflows
- webscrapers, automated parsing, webhooks & external tools
- e.g. zenodo.org picks up changelogs from GH releases' notes rather than changelog files
Meanwhile, for progressively building pre-release notes, you could use one of the following places:
- pull request descriptions
- commit messages
- draft (unpublished) releases
Note that (for the lazy) the latter 2 options are combined as per this1, though personally I find it best to put effort into the first option2.
Always happy to discuss alternatives though :)
Footnotes
-
which is a lightweight version of GH's IMO-too-verbose-eyecandy autogenerated notes ↩
-
e.g. https://github.com/NiftyPET/NIMPA/pull/28#issue-1732872191 -> https://github.com/NiftyPET/NIMPA/releases/tag/v2.6.0 ↩
LICENSE
Outdated
Copyright 2020 Edoardo Pasca | ||
|
||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
1. Definitions. | ||
http://www.apache.org/licenses/LICENSE-2.0 |
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.
We need to discuss with @paskino about the licensing, headers, etc. but all contributors should be listed and it's copyright to the institution:
Copyright 2020 United Kingdom Research and Innovation
Then the authors list is separate
Authors:
Edoardo Pasca
etc.
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.
Updated.
Also worth a follow-up issue/discussion I think.
@@ -1,36 +0,0 @@ | |||
package: | |||
name: eqt |
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.
My understanding is that the conda build will happen somehow with conda-forge but will we not need any of these files for 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.
no, it won't be needed :)
pyproject.toml
Outdated
[project.urls] | ||
documentation = "https://github.com/paskino/qt-elements#readme" | ||
repository = "https://github.com/paskino/qt-elements" | ||
changelog = "https://github.com/paskino/qt-elements/releases" |
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.
When/if we reinstate the changelog.md, we can change the link here
.github/workflows/test.yml
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Does this automatically create the version description from the git logs?
I think we would prefer to use the change log we manually write in CHANGELOG.md
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.
yes but as per the updated .github/workflows/README.md
instructions; it only creates a --draft
release. Manual copyediting & approval of said draft is always required to make it public.
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.
So the concept here is that we use git log
to create the draft of the release text, taking from the commit messages. This text accompanies a GitHub draft release and will then be manually edited once we make the actual release.
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 CHANGELOG.md
is that we tend to cluster changes on topic rather than commit.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
I like the automation
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).
I feel that the release text is related to a GitHub feature rather than an integral part of the software.
- the GH release text was already being used before this PR
- dev metadata (version history) is NOT meant to be an "integral part of software" (that's the whole point of git commits as well as commit messages)
- best practice is to put release notes as comments in annotated tags or merge commits if you want them in a place where a dev will find them easily sans GH web interface
- release notes should link to relevant issues & PRs (for context & discussion), which is distinctly inherently a GH-only (non-local-codebase) use case.
Often I find myself editing the changelog differently than the commit messages. Maybe it is a good practice to write the commit messages better!
Still possible here. I do the same. The commit messages injected in the draft ensure:
- I don't forget to mention something important
- I'm embarrassed by poorly-written unfit-for-purpose messages (which I delete), inspiring me to write better in future
My real argument against deleting the
CHANGELOG.md
is that we tend to cluster changes on topic rather than commit.
- that's what merge commits & tags are for, ergo what should be described in merge commit messages & annotated tags
- the changelog was mirrored in two places, I'm simply proposing we delete one of those places
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?
Annotated tags & (merge) commit messages.
Finally, overall harsh truth:
- high-level end users: only look at web material (PyPI, GH Readme, GH releases)
- devs: only look at git commits & git blame
- nobody: wants changelog file checked out in-repo
I really believe there is zero frustration if changelog.txt
simply links to GH releases.
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.
@paskino as discussed, I've now updated all git tags to have annotations containing the release notes.
You can git fetch --tags -f
to get the updated annotations. To view a changelog without an internet connection1:
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
Footnotes
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.
added instructions & tests for annotated tags: 4e918e6
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.
It looks great. Please keep the changelog as it is a file which belongs to the repository.
I'd like to understand how to use pytest in the future.
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.7, 3.11] |
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.
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 comment
The 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.
.github/workflows/test.yml
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
So the concept here is that we use git log
to create the draft of the release text, taking from the commit messages. This text accompanies a GitHub draft release and will then be manually edited once we make the actual release.
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 CHANGELOG.md
is that we tend to cluster changes on topic rather than commit.
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?
@@ -82,8 +72,7 @@ def rejected(self): | |||
|
|||
class DialogTest(unittest.TestCase): | |||
'''Test the margarita mixer GUI''' | |||
|
|||
@unittest.skipIf(skip_as_conda_build, "On conda builds do not do any test with interfaces") | |||
@skip_ci |
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.
How does a decorator work?
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.
It was a decorator before too - I just tidied it up so the condition & message aren't repeated a hundred times in the code.
70c2eff
to
4e918e6
Compare
Part of #76, closes #11, closes #54, fixes #56
setup.py
=>pyproject.toml
sphinx
dependencyunittest
=>pytest
conda-forge
repo instead)test/test__formUI_status_test.py
qdarkstyle
dependencyfollow-up issues for separate PRs