Skip to content
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 the CI #1204

Merged
merged 8 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
if: github.event_name != 'schedule'

test-conda:
needs: [ test-pip ]
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-conda.yml
with:
coverage: ${{ github.event_name != 'schedule' }}
Expand Down
51 changes: 13 additions & 38 deletions .github/workflows/release.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,33 @@
name: Release
name: Publish
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+dev[0-9]+"
workflow_dispatch:
inputs:
skip-tests:
type: boolean
description: Skip
default: false
ref:
type: string
description: Tag to release
required: true

permissions:
contents: read

jobs:
pre-commit:
uses: ./.github/workflows/step_pre-commit.yml
if: "! inputs.skip-tests"

test-pip:
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-pip.yml
with:
coverage: false
if: "! inputs.skip-tests"

test-conda:
needs: [ test-pip ]
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-conda.yml
with:
coverage: false
if: "! inputs.skip-tests"

test-ui:
needs: [ test-pip ]
uses: ./.github/workflows/step_tests-ui.yml
if: "! inputs.skip-tests"

test-status:
needs: [ pre-commit, test-pip, test-conda, test-ui ]
Expand All @@ -56,9 +42,6 @@ jobs:
build:
needs: [ test-status ]
uses: ./.github/workflows/step_build.yml
with:
upload: true
ref: ${{ inputs.ref }}

publish:
needs: [ build ]
Expand All @@ -73,24 +56,16 @@ jobs:
id-token: write

steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Checkout source
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Build package
run: |
python -m pip install wheel build
python -m build

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1

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
2 changes: 0 additions & 2 deletions .github/workflows/step_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/step_tests-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@ jobs:
name: >
🐍 ${{ matrix.python-version }}
${{ matrix.dependency_type && format('({0})', matrix.dependency_type) }}
${{ matrix.markdown-it-py && format('(markdown-it-py {0})', matrix.markdown-it-py) }}
${{ matrix.quarto && '(Quarto)' }}
${{ matrix.no_kernel && '(No kernel)' }}
${{ matrix.markdown-it-py && format('(markdown-it-py {0})', matrix.markdown-it-py) }}
${{ matrix.no_markdown-it-py && '(No markdown-it-py)'}}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12"]
experimental: [false]
include:
# Test pre-release versions
- python-version: "3.x"
dependency_type: "pre"
experimental: true # fails with pytest-8.0.0rc1
# Test minimum markdown-it-py supported (otherwise the most recent version is used)
- python-version: "3.x"
markdown-it-py: "~=2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also add ==1.0 here to track the old dependency

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I tried ~=1.0 at https://github.com/mwouts/jupytext/actions/runs/7512100735, but the installation failed. I don't have time to do further attempts so I will go without that.

- python-version: "3.x"
markdown-it-py: false
no_markdown-it-py: true
- python-version: "3.x"
no_kernel: true
- python-version: "3.x"
Expand All @@ -55,15 +58,16 @@ jobs:
python -m pip install
-e '.[test-cov,test-external]'
jupyterlab
${{ matrix.markdown-it-py && format('markdown-it-py{0}', matrix.markdown-it-py) || '' }}
${{ format('markdown-it-py{0}', matrix.markdown-it-py) }}

- name: Install a Jupyter Kernel
if: ${{ !matrix.no_kernel }}
run: python -m ipykernel install --name python_kernel --user

- 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 == 'false' }}
if: ${{ matrix.no_markdown-it-py }}
run: python -m pip uninstall markdown-it-py --yes

- name: Install Quarto
Expand All @@ -84,6 +88,7 @@ jobs:
python -m jupyterlab.browser_check

- name: Test with pytest
continue-on-error: ${{ matrix.experimental }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually for this one I put the continue-on-error only if it's on push so that:

  • when people look at the main branch they see green ticks
  • when on PR we see what experimental jobs are failing and can navigate more easily
  • use workflow badge to show overall pass/fail
  • the pass job shows you when non-experimental jobs fail. Use that as a required job to keep trackof PR status instead

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good suggestion, I will have to follow-up on that one

run: pytest -n logical --cov --cov-report=xml

- name: Upload coverage
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Jupytext ChangeLog
==================

1.16.1-dev (2024-01-??)
-------------------

**Changed**
- The CI was updated. Thanks to [Christian Le](https://github.com/LecrisUT) for taking care of this! ([#1190](https://github.com/mwouts/jupytext/issues/1190), [#1204](https://github.com/mwouts/jupytext/issues/1204))


1.16.0 (2023-12-03)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
dependencies = [
"nbformat",
"mdit-py-plugins",
"markdown-it-py>=2.0",
"markdown-it-py>=1.0",
"packaging",
"pyyaml",
"toml",
Expand Down
2 changes: 1 addition & 1 deletion src/jupytext/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Jupytext's version number"""

__version__ = "1.16.0"
__version__ = "1.16.1-dev"
Loading