Skip to content

Commit

Permalink
Merge branch 'main' into jupyter-server
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk authored May 23, 2023
2 parents 626eb54 + e3cca69 commit 4adf46e
Show file tree
Hide file tree
Showing 44 changed files with 1,180 additions and 765 deletions.
7 changes: 3 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
# E: style errors
# W: style warnings
# C: complexity
# E402: module level import not at top of file
# I100: Import statements are in the wrong order
# I101: Imported names are in the wrong order. Should be
ignore = E, C, W, E402, I100, I101, D400
# D: docstring warnings (unused pydocstyle extension)
# F841: local variable assigned but never used
ignore = E, C, W, D, F841
exclude =
.cache,
.github
16 changes: 16 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
# Notes:
# - Status and logs from dependabot are provided at
# https://github.com/jupyterhub/nbgitpuller/network/updates.
#
version: 2
updates:
# Maintain dependencies in our GitHub Workflows
- package-ecosystem: github-actions
directory: /
labels: [ci]
schedule:
interval: monthly
time: "05:00"
timezone: Etc/UTC
37 changes: 5 additions & 32 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ on:
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

env:
SPHINXOPTS: --color

jobs:
linkcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.11"

- name: Install dependencies
run: |
Expand All @@ -38,31 +39,3 @@ jobs:
run: |
cd docs
make linkcheck
build-and-publish:
runs-on: ubuntu-20.04

permissions:
# required to push to the gh-pages branch
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
pip install -r docs/doc-requirements.txt
- name: make html (Builds documentation)
run: |
cd docs
make html
- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
run: |
pip install ghp-import
ghp-import --no-jekyll --push --message "Update documentation [skip ci]" docs/_build/html
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ name: Release
on:
pull_request:
paths-ignore:
- "docs/**"
- "**/docs.yml"
- "docs/**"
- "**/docs.yml"
push:
paths-ignore:
- "docs/**"
- "**/docs.yml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

jobs:
build-release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/setup-node@v3
with:
python-version: 3.8
node-version: "18"

- name: install build package
run: |
Expand All @@ -39,7 +43,7 @@ jobs:
ls -l dist
- name: publish to pypi
uses: pypa/gh-action-pypi-publish@v1.4.1
uses: pypa/gh-action-pypi-publish@v1.8.5
if: startsWith(github.ref, 'refs/tags/')
with:
user: __token__
Expand Down
74 changes: 45 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,65 @@ on:
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
include:
- python-version: "3.7"
- python-version: "3.8"
# 2.17 is in ubuntu 18.04
git-version: "2.17"
- python-version: "3.9"
# 2.25 is in ubuntu 20.04
git-version: "2.25"
- python-version: "3.10"
# 2.34 is in ubuntu 22.04
git-version: "2.34"
- python-version: "3.11"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"

- name: Run webpack to build static assets
- uses: actions/setup-node@v3
with:
node-version: "${{ matrix.node-version || '16'}}"

- name: install git ${{ matrix.git-version }}
if: ${{ matrix.git-version }}
run: |
npm install
npm run webpack
export MAMBA_ROOT_PREFIX=$/tmp/conda
mkdir -p $MAMBA_ROOT_PREFIX/bin
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/1.4.2 | tar -xvj -C $MAMBA_ROOT_PREFIX/bin/ --strip-components=1 bin/micromamba
$MAMBA_ROOT_PREFIX/bin/micromamba install -c conda-forge -p $MAMBA_ROOT_PREFIX "git=${{ matrix.git-version }}"
echo "PATH=$MAMBA_ROOT_PREFIX/bin:$PATH" >> $GITHUB_ENV
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

# DISABLED: Since we don't pin our dependencies in dev-requirements.txt
# and only refresh the cache when it changes, we end up with a
# cache that remains for too long and cause failures. Due to
# this, it has been disabled.
#
# - name: Cache pip dependencies
# uses: actions/cache@v2
# with:
# path: ~/.cache/pip
# # Look to see if there is a cache hit for the corresponding requirements file
# key: ${{ runner.os }}-pip-${{ hashFiles('*requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
- name: git version
run: |
which git
git --version
- name: Run webpack to build static assets
run: |
npm install
npm run webpack
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- name: Run flake8 linter
run: flake8
pip install .
pip freeze
- name: Run tests
run: |
pip install .
pytest --verbose --maxfail=2 --color=yes --cov nbgitpuller
pytest --verbose --maxfail=2 --color=yes --cov nbgitpuller tests
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ docs/_build
node_modules/
package-lock.json

nbgitpuller/static/dist
nbgitpuller/static/dist
74 changes: 74 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# pre-commit is a tool to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
#
# Common tasks
#
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
repos:
# FIXME: Autoformatting of our .py files by pyupgrade/autoflake/isort/black is
# initially not enabled as it would lead to large indentation changes
# while we currently have several open PRs good to resolve first.
#

# # Autoformat: Python code, syntax patterns are modernized
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.3.1
# hooks:
# - id: pyupgrade
# args:
# - --py37-plus

# # Autoformat: Python code
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.0.0
# hooks:
# - id: autoflake
# # args ref: https://github.com/PyCQA/autoflake#advanced-usage
# args:
# - --in-place

# # Autoformat: Python code
# - repo: https://github.com/pycqa/isort
# rev: 5.11.4
# hooks:
# - id: isort

# # Autoformat: Python code
# - repo: https://github.com/psf/black
# rev: 22.12.0
# hooks:
# - id: black

# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
# FIXME: Autoformatting of our .js files is initially not enabled as it
# would lead to large indentation changes while we currently have
# several open PRs good to resolve first.
exclude_types:
- "javascript"

# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-case-conflict
- id: check-executables-have-shebangs

# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8

ci:
# pre-commit.ci will open PRs updating our hooks once a month
autoupdate_schedule: monthly
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nbgitpuller/templates/
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuration on how ReadTheDocs (RTD) builds our documentation
# ref: https://readthedocs.org/projects/nbgitpuller/
# ref: https://docs.readthedocs.io/en/stable/config-file/v2.html
#
version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-20.04
tools:
python: "3.10"

python:
install:
- requirements: docs/doc-requirements.txt
Loading

0 comments on commit 4adf46e

Please sign in to comment.