-
Notifications
You must be signed in to change notification settings - Fork 63
Adapt to level config to match other Jupyter repos #237
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
39e5566
Update project config
blink1073 db52404
Adapt to level config to match other Jupyter repos
blink1073 cefa60f
fix version handling
blink1073 d706ae2
address warning
blink1073 78224f2
fix version
blink1073 4b548db
fix test
blink1073 cd0669e
fix rtd config
blink1073 7a86e27
fix test run
blink1073 6ccdebc
fix env var
blink1073 a74af4e
fail fast
blink1073 4126d01
fix windows event loop handling
blink1073 4c87741
fix windows event loop handling
blink1073 21887fb
address review
blink1073 35f48e3
update homepage link
blink1073 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
# GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
# Python | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
name: tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
||
jobs: | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
- uses: pre-commit/[email protected] | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- uses: pre-commit/[email protected] | ||
|
||
tests: | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", " 3.12"] | ||
|
@@ -28,21 +31,18 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
python -m bash_kernel.install # For testing a non-standard kernel | ||
pip install . | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip hatch | ||
|
||
- name: Run tests | ||
run: pytest | ||
- name: Run tests | ||
run: hatch run test:test -x | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -51,16 +51,13 @@ jobs: | |
- uses: actions/setup-python@v3 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install . | ||
python -m pip install --upgrade pip hatch | ||
|
||
- name: Build docs | ||
run: | | ||
cd doc | ||
make html-strict | ||
hatch run doc:build | ||
|
||
publish: | ||
|
||
name: Publish to PyPi | ||
needs: [tests] | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.tox/ | ||
.venv | ||
*.py[cod] | ||
|
||
# Packages | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,76 @@ | ||
ci: | ||
autoupdate_schedule: monthly | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
|
||
repos: | ||
- repo: "https://github.com/pre-commit/pre-commit-hooks" | ||
rev: v4.3.0 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-case-conflict | ||
- id: check-ast | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- repo: "https://github.com/pycqa/flake8/" | ||
rev: 3.9.2 | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.27.1 | ||
hooks: | ||
- id: check-github-workflows | ||
|
||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.17 | ||
hooks: | ||
- id: mdformat | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v3.0.3" | ||
hooks: | ||
- id: prettier | ||
types_or: [yaml, html, json] | ||
|
||
- repo: https://github.com/adamchainz/blacken-docs | ||
rev: "1.16.0" | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.7.0] | ||
exclude: | | ||
(?x)^( | ||
doc/source/index.rst| | ||
tests/test_execute.py | ||
)$(|) | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: "v2.2.6" | ||
hooks: | ||
- id: flake8 | ||
- repo: "https://github.com/ambv/black" | ||
rev: 22.3.0 | ||
- id: codespell | ||
args: ["-L", "sur,nd"] | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: "https://github.com/PyCQA/isort" | ||
rev: 5.12.0 | ||
- id: rst-backticks | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.5 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.34.0 | ||
- id: ruff | ||
types_or: [python, jupyter] | ||
args: ["--fix", "--show-fixes"] | ||
- id: ruff-format | ||
types_or: [python, jupyter] | ||
|
||
- repo: https://github.com/scientific-python/cookie | ||
rev: "2023.10.27" | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py36-plus"] | ||
- id: sp-repo-review | ||
additional_dependencies: ["repo-review[cli]"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# General Jupyter contributor guidelines | ||
|
||
If you're reading this section, you're probably interested in | ||
contributing to Jupyter. Welcome and thanks for your interest in | ||
contributing! | ||
|
||
Please take a look at the Contributor documentation, familiarize | ||
yourself with using the Jupyter Server, and introduce yourself on the | ||
mailing list and share what area of the project you are interested in | ||
working on. | ||
|
||
For general documentation about contributing to Jupyter projects, see | ||
the [Project Jupyter Contributor | ||
Documentation](https://jupyter.readthedocs.io/en/latest/contributing/content-contributor.html). | ||
|
||
# Setting Up a Development Environment | ||
|
||
## Installing the Jupyter Server | ||
|
||
The development version of the server requires | ||
[node](https://nodejs.org/en/download/) and | ||
[pip](https://pip.pypa.io/en/stable/installing/). | ||
|
||
Once you have installed the dependencies mentioned above, use the | ||
following steps: | ||
|
||
``` | ||
pip install --upgrade pip | ||
git clone https://github.com/jupyter/jupyter-sphinx | ||
cd jupyter-server | ||
pip install -e ".[test]" | ||
``` | ||
|
||
## Code Styling and Quality Checks | ||
|
||
`jupyter-sphinx` has adopted automatic code formatting so you shouldn't | ||
need to worry too much about your code style. As long as your code is | ||
valid, the pre-commit hook should take care of how it should look. | ||
`pre-commit` and its associated hooks will automatically be installed | ||
when you run `pip install -e ".[test]"` | ||
|
||
To install `pre-commit` hook manually, run the following: | ||
|
||
``` | ||
pre-commit install | ||
``` | ||
|
||
You can invoke the pre-commit hook by hand at any time with: | ||
|
||
``` | ||
pre-commit run | ||
``` | ||
|
||
which should run any autoformatting on your code and tell you about any | ||
errors it couldn't fix automatically. You may also install [black | ||
integration](https://github.com/psf/black#editor-integration) into your | ||
text editor to format code automatically. | ||
|
||
If you have already committed files before setting up the pre-commit | ||
hook with `pre-commit install`, you can fix everything up using | ||
`pre-commit run --all-files`. You need to make the fixing commit | ||
yourself after that. | ||
|
||
Some of the hooks only run on CI by default, but you can invoke them by | ||
running with the `--hook-stage manual` argument. | ||
|
||
There are three hatch scripts that can be run locally as well: | ||
`hatch run lint:build` will enforce styling. | ||
|
||
# Running Tests | ||
|
||
Install dependencies: | ||
|
||
``` | ||
pip install -e .[test] | ||
``` | ||
|
||
To run the Python tests, use: | ||
|
||
``` | ||
pytest | ||
``` | ||
|
||
You can also run the tests using `hatch` without installing test | ||
dependencies in your local environment: | ||
|
||
``` | ||
pip install hatch | ||
hatch run test:test | ||
``` | ||
|
||
The command takes any argument that you can give to `pytest`, e.g.: | ||
|
||
``` | ||
hatch run test:test -k name_of_method_to_test | ||
``` | ||
|
||
You can also drop into a shell in the test environment by running: | ||
|
||
``` | ||
hatch -e test shell | ||
``` | ||
|
||
# Building the Docs | ||
|
||
Install the docs requirements using `pip`: | ||
|
||
``` | ||
pip install .[doc] | ||
``` | ||
|
||
Once you have installed the required packages, you can build the docs | ||
with: | ||
|
||
``` | ||
cd docs | ||
make html | ||
``` | ||
|
||
You can also run the tests using `hatch` without installing test | ||
dependencies in your local environment. | ||
|
||
```bash | ||
pip install hatch | ||
hatch run docs:build | ||
``` | ||
|
||
You can also drop into a shell in the docs environment by running: | ||
|
||
``` | ||
hatch -e docs shell | ||
``` | ||
|
||
After that, the generated HTML files will be available at | ||
`build/html/index.html`. You may view the docs in your browser. | ||
|
||
You should also have a look at the [Project Jupyter Documentation | ||
Guide](https://jupyter.readthedocs.io/en/latest/contributing/content-contributor.html). |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.