-
Notifications
You must be signed in to change notification settings - Fork 388
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
ci: Minor reorganizations #1190
Conversation
Thank you for making this pull request. Did you know? You can try it on Binder: or . Also, the version of Jupytext developed in this PR can be installed with
(this requires |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1190 +/- ##
==========================================
- Coverage 97.73% 96.74% -0.99%
==========================================
Files 29 29
Lines 4456 4456
==========================================
- Hits 4355 4311 -44
- Misses 101 145 +44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
858b829
to
d4a633d
Compare
release: | ||
needs: [ publish ] | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Jupytext ${{ inputs.ref || github.ref_name }} | ||
draft: true | ||
prerelease: ${{ contains(inputs.ref || github.ref, 'rc') }} | ||
generate_release_notes: true |
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.
Instead of reinventing the wheel, I would suggest to look into jupyter-releaser. It will work out-of-the-box nicely to publish to both PyPI and NPM.
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.
Sure, open to suggestions on this one, can you propose the change so I can look at what it does and check if it's equivalent? I'm curious if it works with Trusted publishing
and how that works when being used with both PyPI and NPM
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 does work with Trusted publishing
which is very neat. For NPM we still need to use a token as a secret to publish.
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 need to read it carefully, because the workflow seems incompatible:
https://github.com/jupyter-server/jupyter_releaser/blob/43d510770f1fe039e133890936416956b927e250/jupyter_releaser/actions/populate_release.py#L42
(This workflow runs on tag release, while the jupyter_releasser
creates the new tag) 🤔. Indeed there are good points like the bumpimg of package.json
, but then how do you specify the tag?
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.
This is a manual workflow. So, the maintainer will kickstart a release process by prepping a release -> https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html#prep-release
And this will produce the artifacts and updated changelog. Once the maintainer is happy with everything, they can go ahead with release -> https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html#publish-release
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, I think we have two possible workflows here:
- run on tag: use the current approach and run
pre-release
to bump to the next version. I think we can mix individual steps from the releaser as long as we order them appropriately - run on dispatch: use the reusable workflows there
It is a bit weird because of the mixing of dynamic-version via git on the python sideand the static version of npm. Normally I prefer to bump versions after a release in order to clearly communicate the difference in versions (e.g. main vs tag release)
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.
Well, my original suggestion was to replace the current release.yml
file with the ones from jupyter-releaser instead of mixing them with current one. But I see few potential blockers adopting jupyter-releaser
:
jupyter-releaser
expectspackage.json
to be in root of the repo for it to build and release NPM packages.- And NPM package and Python package should have same version for consistency. For example, JupyterLab has few dozens of NPM packages and they all have consistent version with main JupyterLab Python package.
dynamic-version via git on the python sideand the static version of npm
We do not use dynamic version (if you mean like versioneer
creating a new version string for each commit). What hatch will do is bump NPM version in package.json
and then make sure that Python package will use that same version as package.json
. Currently, versions of NPM package and Python package of Jupytext are diverged and hence, it does not work out-of-the-box.
Your suggestion of creating our own workflows based on jupyter-releaser
might work. Something like splitting like these workflows for Python and NPM packages separately. But that increases the maintainence burden. As @mwouts is the one who is making releases, it depends on how much complexity he is willing to handle.
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.
Well, my original suggestion was to replace the current
release.yml
file with the ones from jupyter-releaser instead
Slight nuance because you still need a release.yml
with an on:workflow_dispatch
. But yeah, what you suggest is about the second approach in my last comment. We just need to have a light wrapper to forward the inputs.
We do not use dynamic version (if you mean like
versioneer
creating a new version string for each commit).
Ah you're right src/jupytext/version.py
is a static file. I confused it with tool.hatch.build.hooks.vcs.version-file
. Would the version bumping work on the python side?
Currently, versions of NPM package and Python package of Jupytext are diverged and hence, it does not work out-of-the-box.
Good point. In either case it needs to re-converge the versioning number, unless there are more complicated tag forms.
Your suggestion of creating our own workflows based on jupyter-releaser might work. Something like splitting like these workflows for Python and NPM packages separately.
Indeed, looking back there are quite a few changes necessary. And in either case we need to test these workflows because there seems to be quite a few things to look out for. @mahendrapaipuri can the jupyter-releaser
be tested locally on a fork, like uploading to GitHub package repo. And indeed the main question is @mwouts, which one do you prefer: tag push, calling workflow, or manual commits?
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.
Ah you're right src/jupytext/version.py is a static file. I confused it with tool.hatch.build.hooks.vcs.version-file. Would the version bumping work on the python side?
Ah, I thought we are already using hatch
to do version bumping. But currenctly version string is set manually I assume. Yes, we can do the bumping using hatch
can the jupyter-releaser be tested locally on a fork, like uploading to GitHub package repo
Yes, there is a check-release workflow that dry runs all the release steps on local PyPI and mock GitHub instance in CI. So, if and when we decide to use jupyter-releaser
tools in release workflows, we can adopt a similar solution to test it locally on mock instances.
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 @LecrisUT and @mahendrapaipuri for this. I am afraid this is too unfamiliar to me. I am happy with the current process for releasing, i.e. editing the CHANGELOG.md
and version files manually, and then adding a tag in the GitHub interface, so if you don't mind I might left this change for later and revert to the previous state of publish.yml
for now.
0327f0b
to
7556316
Compare
e3d6c25
to
903e871
Compare
Hi @LecrisUT , thank you for making this PR! I have a busy week but I will certainly look into this over the coming days. Thanks! |
Only the workflows that trigger need the concurrency
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
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.
Sounds great! Thank you for the PR! As mentioned above I might revert the change on release.yml as I am not ready for that one, but other than that I am looking forward to merging this!
release: | ||
needs: [ publish ] | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Jupytext ${{ inputs.ref || github.ref_name }} | ||
draft: true | ||
prerelease: ${{ contains(inputs.ref || github.ref, 'rc') }} | ||
generate_release_notes: true |
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 @LecrisUT and @mahendrapaipuri for this. I am afraid this is too unfamiliar to me. I am happy with the current process for releasing, i.e. editing the CHANGELOG.md
and version files manually, and then adding a tag in the GitHub interface, so if you don't mind I might left this change for later and revert to the previous state of publish.yml
for now.
- python-version: "3.x" | ||
markdown-it-py-version: "" | ||
markdown-it-py: false |
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.
Testing that Jupytext works without markdown-it-py
in the CI seems very hard to achieve! It does not seem to be working on main
, but I am not sure it is working here neither. I will have a look.
Cf. https://github.com/mwouts/jupytext/actions/runs/7506308274/job/20437528721 which does not run the 'uninstall markdown-it-py' step:
- name: Uninstall markdown-it-py | ||
# Markdown-it-py is a dependency of Jupytext, | ||
# but Jupytext should still work if it is not installed | ||
if: ${{ matrix.markdown-it-py-version == '' }} | ||
if: ${{ matrix.markdown-it-py == 'false' }} |
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.
Maybe this should be == false
? Maybe I'll switch to using a flag like no_kernel
or quarto
which works and also has the advantage of being more explicit.
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 you're right. Github workflow is annoying like that where sometimes the variable is converted to a string, sometimes it's the original json type. In the case of matrix it's the latter.
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.
FYI I have added an additional no_markdown-it-py
(false/true) at #1204
- python-version: "3.x" | ||
pip-flags: "--pre --upgrade --upgrade-strategy eager" | ||
dependency_type: "pre" |
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 for this! At the moment the pre
-pip tests are not passing (an issue with the pytest
release candidate). Do you think there is a way to mark this step as experimental, i.e. get a red box for that particular one but still get a pass globally?
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, I've recently designed a workflow like that, I'll add it here too: https://github.com/LecrisUT/CMake-Template/blob/a4f73dbd53d8cb98e6325296c2905b2ed40dcaa3/.github/workflows/step_test.yaml#L46
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.
Interesting! I am not familiar with the inputs yet but yes this seems to be the way to go. I've added the experimental flag in this PR, on top of yours: #1204
"mdit_py_plugins", | ||
"markdown-it-py>=1.0.0", | ||
"mdit-py-plugins", | ||
"markdown-it-py>=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.
I am planning to release this PR in jupytext_1.16.1
so I'd rather let this change of dependencies on markdown-it-py
for jupytext_1.17.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.
Ok, let me add the CI to run for 1.0
in this case then revert the commit after that
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.
Great idea! Thanks
Setup a full release CDv4
this is resolved:"Unable to locate build via Github Actions API" error with v3 uploader codecov/codecov-action#1138
public repo: token needed or not? codecov/codecov-action#1035
Tokenless support in the new CLI (for public repos and forks) codecov/feedback#112