-
Notifications
You must be signed in to change notification settings - Fork 400
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
Reorganize repo to src-layout
, migrate to hatch
build system and pyproject.toml
#1134
Changes from all commits
b379cf8
9d5e08e
c6e7546
2c85bf5
a4a1eae
545d8fd
17b053f
57a656d
334f191
ebc033f
4d3e902
247cdcd
c0c957c
9d1c022
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Check Release | ||
on: | ||
push: | ||
branches: [master, main] | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- name: Check Release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
Comment on lines
+18
to
+21
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. Is this one to be used before making a release? If so, move this one to 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. Well, this workflow runs like any other workflows like |
||
- name: Upload Distributions | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jupyter-resource-usage-releaser-dist-${{ github.run_number }} | ||
path: .jupyter_releaser_checkout/dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
on: | ||
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. Add |
||
push: | ||
paths-ignore: | ||
- 'CHANGELOG.md' | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: '0 11 * * 4' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
uses: ./.github/workflows/step_pre-commit.yml | ||
|
||
codeql: | ||
needs: pre-commit | ||
uses: ./.github/workflows/step_static-analysis.yml | ||
|
||
test-pip: | ||
needs: pre-commit | ||
uses: ./.github/workflows/step_tests-pip.yml | ||
|
||
test-conda: | ||
needs: pre-commit | ||
uses: ./.github/workflows/step_tests-conda.yml | ||
|
||
build: | ||
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. Also |
||
needs: [codeql, test-pip, test-conda] | ||
uses: ./.github/workflows/step_build.yml | ||
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. Add a |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,21 +9,26 @@ on: | |
jobs: | ||
publish: | ||
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. Add |
||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/jupytext | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Build package | ||
run: | | ||
python -m pip install wheel jupyter-packaging 'jupyterlab>=3,<4' | ||
BUILD_JUPYTERLAB_EXTENSION=1 python setup.py sdist bdist_wheel | ||
python -m pip install wheel build | ||
# Ensure that we build jupyterlab extension and distribute it with wheel | ||
HATCH_BUILD_HOOKS_ENABLE=true python -m build | ||
|
||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: build | ||
run-name: Build test | ||
|
||
on: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
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. What do you mean about 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. I think I was using same group -> https://github.com/mahendrapaipuri/jupytext/actions/runs/6547300550 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. Oh, I see. Never realized I had such configuration on my project. On the |
||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Lint the extension | ||
run: | | ||
# Install JupyterLab in an isolated env to get jlpm | ||
pipx install jupyterlab>=4 | ||
pipx list | ||
|
||
# Install lint deps and lint extension | ||
cd jupyterlab/ | ||
jlpm | ||
jlpm run lint:check | ||
cd .. | ||
|
||
# Uninstall pipx env | ||
pipx uninstall jupyterlab | ||
|
||
- name: Build package | ||
run: | | ||
python -m pip install build wheel | ||
|
||
# Build jupytext package | ||
HATCH_BUILD_HOOKS_ENABLE=true python -m build | ||
|
||
# Don't publish a tar.gz file over 1MB (Issue #730) | ||
if (($(wc -c < dist/*.tar.gz) > 1000000)); then exit 1; fi | ||
|
||
# node_modules should not be in the package | ||
if (($(tar -tf dist/*.tar.gz | grep node_modules | wc -l)>0)); then echo "node_modules should not be included" && exit 1; fi | ||
|
||
# Check that the lab is there | ||
if (($(tar -tf dist/*.tar.gz | grep jupyterlab/packages/jupyterlab_jupytext/labextension/package.json$ | wc -l)==0)); then echo "Missing lab extension" && exit 1; fi | ||
|
||
# Install package and extension | ||
python -m pip install dist/*.tar.gz | ||
|
||
# Check extension | ||
jupyter labextension list | ||
jupyter labextension list 2>&1 | grep -ie "jupyterlab-jupytext.*OK" | ||
python -m jupyterlab.browser_check | ||
|
||
echo "Install went OK" | ||
|
||
- name: Archive build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
Comment on lines
+62
to
+66
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. Make this step conditional on 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. I would say this is the build test and I think it would be a good idea to run them automatically on each PR. We dont want PRs to break builds, especially when labextension is involved. 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. Sorry, I wasn't clear here. I meant only the step |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: pre-commit | ||
run-name: Pre-commit | ||
|
||
on: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- uses: pre-commit/[email protected] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: static-analysis | ||
run-name: Run CodeQL analysis | ||
|
||
on: | ||
workflow_call: | ||
|
||
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. This one needs more specific 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. I think the permissions are inside 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. Oh, ok, I re-read the documentation on the permissions, you are right, that is a more valid approach. I was afraid that it was doing a merge operation where the global ones are still initialized. |
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
codeql: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: python, javascript | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
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 should be moved to
step_build
right?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, this workflow is for
jupyter-releaser
. Please look into its docs to have a better understanding.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.
Hmm, other than the risk of bumping the version, why shouldn't it be in the
step_build
. The purpose for that one is to simulate a packaging step, which this one seems to do as well. In thepublish.yml
then the artifacts ofpipx build
and/or this job should be used.From what I read in the implementation
check-release
is just a combination of all the other github actions, which in principle is more robust for using when releasing. What are your plans on how to implement this?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.
Exactly
check-release
simulates all the steps in actualjupyter-releaser
workflow using mock GH instance. It does more than just building packages like simulating changelog generation, packaging, making release with mock instance, etc. As this workflow is very specific tojupyter-releaser
, in my opinion it makes sense to keep it in a separate file. I mean, we have split the existing dense workflow file into logical step files for better readability. I think adding it tosetp_build
will again mishmash workflow files.My original plan was to do include this
check-release
workflow simulation in the repo and give an idea to maintainers on what exactly it is doing. I guess @mwouts is taking of releases and if he wishes to usejupyter-releaser
workflows for publishing packages, we can add the actual workflows in a separate PR.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 view is that
step_*
workflows are not a single-job files, but more like logically separated ones. E.g.step_pre-commit
should also have thenpm
pre-commits. In that sense it makes sense to have them instep_build
(or renamed to something else) because in essence that step is about testing the packaging, and if this one includes changelog generation and all, all the better.Main concern is the
on:
and linking the workflows one to another. But for this first-iteration we can keep it here since it still under consideration on how to implement.