Skip to content

Commit 25446a3

Browse files
authored
Merge pull request #288 from consideRatio/pr/misc-updates
Bootstrap pre-commit config, add dependabot config, test py311
2 parents 8e5fb0f + 380c419 commit 25446a3

File tree

25 files changed

+213
-96
lines changed

25 files changed

+213
-96
lines changed

.flake8

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
# E: style errors
44
# W: style warnings
55
# C: complexity
6-
# E402: module level import not at top of file
7-
# I100: Import statements are in the wrong order
8-
# I101: Imported names are in the wrong order. Should be
9-
ignore = E, C, W, E402, I100, I101, D400
6+
# D: docstring warnings (unused pydocstyle extension)
7+
# F841: local variable assigned but never used
8+
ignore = E, C, W, D, F841
109
exclude =
1110
.cache,
1211
.github

.github/workflows/dependabot.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# dependabot.yml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
#
3+
# Notes:
4+
# - Status and logs from dependabot are provided at
5+
# https://github.com/jupyterhub/nbgitpuller/network/updates.
6+
#
7+
version: 2
8+
updates:
9+
# Maintain dependencies in our GitHub Workflows
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: monthly
14+
time: "05:00"
15+
timezone: "Etc/UTC"

.github/workflows/docs.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ env:
2323

2424
jobs:
2525
linkcheck:
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-22.04
2727

2828
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions/setup-python@v2
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-python@v4
3131
with:
32-
python-version: '3.10'
32+
python-version: "3.11"
3333

3434
- name: Install dependencies
3535
run: |
@@ -41,17 +41,17 @@ jobs:
4141
make linkcheck
4242
4343
build-and-publish:
44-
runs-on: ubuntu-20.04
44+
runs-on: ubuntu-22.04
4545

4646
permissions:
4747
# required to push to the gh-pages branch
4848
contents: write
4949

5050
steps:
51-
- uses: actions/checkout@v2
52-
- uses: actions/setup-python@v2
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-python@v4
5353
with:
54-
python-version: '3.10'
54+
python-version: "3.11"
5555

5656
- name: Install dependencies
5757
run: |
@@ -65,5 +65,5 @@ jobs:
6565
- name: Publish to GitHub Pages
6666
if: github.ref == 'refs/heads/main'
6767
run: |
68-
pip install ghp-import
69-
ghp-import --no-jekyll --push --message "Update documentation [skip ci]" docs/_build/html
68+
pip install ghp-import
69+
ghp-import --no-jekyll --push --message "Update documentation [skip ci]" docs/_build/html

.github/workflows/publish.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: Release
77
on:
88
pull_request:
99
paths-ignore:
10-
- "docs/**"
11-
- "**/docs.yml"
10+
- "docs/**"
11+
- "**/docs.yml"
1212
push:
1313
paths-ignore:
1414
- "docs/**"
@@ -21,15 +21,15 @@ on:
2121

2222
jobs:
2323
build-release:
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
steps:
26-
- uses: actions/checkout@v2
27-
- uses: actions/setup-python@v2
26+
- uses: actions/checkout@v3
27+
- uses: actions/setup-python@v4
2828
with:
29-
python-version: "3.8"
30-
- uses: actions/setup-node@v2
29+
python-version: "3.11"
30+
- uses: actions/setup-node@v3
3131
with:
32-
node-version: "16"
32+
node-version: "18"
3333

3434
- name: install build package
3535
run: |
@@ -43,7 +43,7 @@ jobs:
4343
ls -l dist
4444
4545
- name: publish to pypi
46-
uses: pypa/gh-action-pypi-publish@v1.4.1
46+
uses: pypa/gh-action-pypi-publish@v1.6.4
4747
if: startsWith(github.ref, 'refs/tags/')
4848
with:
4949
user: __token__

.github/workflows/test.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,35 @@ on:
2020

2121
jobs:
2222
test:
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
timeout-minutes: 10
2525

2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ["3.7", "3.8", "3.9", "3.10"]
29+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
3030
node-version: ["16"]
3131

3232
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-python@v2
33+
- uses: actions/checkout@v3
34+
- uses: actions/setup-python@v4
3535
with:
3636
python-version: "${{ matrix.python-version }}"
37-
- uses: actions/setup-node@v2
37+
- uses: actions/setup-node@v3
3838
with:
3939
node-version: "${{ matrix.node-version }}"
4040

4141
- name: Run webpack to build static assets
4242
run: |
43-
npm install
44-
npm run webpack
43+
npm install
44+
npm run webpack
4545
4646
- name: Install dependencies
4747
run: |
4848
pip install -r dev-requirements.txt
4949
pip install .
5050
pip freeze
5151
52-
- name: Run flake8 linter
53-
run: flake8
54-
5552
- name: Run tests
5653
run: |
5754
pytest --verbose --maxfail=2 --color=yes --cov nbgitpuller

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ docs/_build
2121
node_modules/
2222
package-lock.json
2323

24-
nbgitpuller/static/dist
24+
nbgitpuller/static/dist

.pre-commit-config.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# pre-commit is a tool to perform a predefined set of tasks manually and/or
2+
# automatically before git commits are made.
3+
#
4+
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
5+
#
6+
# Common tasks
7+
#
8+
# - Run on all files: pre-commit run --all-files
9+
# - Register git hooks: pre-commit install --install-hooks
10+
#
11+
repos:
12+
# FIXME: Autoformatting of our .py files by pyupgrade/autoflake/isort/black is
13+
# initially not enabled as it would lead to large indentation changes
14+
# while we currently have several open PRs good to resolve first.
15+
#
16+
17+
# # Autoformat: Python code, syntax patterns are modernized
18+
# - repo: https://github.com/asottile/pyupgrade
19+
# rev: v3.3.1
20+
# hooks:
21+
# - id: pyupgrade
22+
# args:
23+
# - --py37-plus
24+
25+
# # Autoformat: Python code
26+
# - repo: https://github.com/PyCQA/autoflake
27+
# rev: v2.0.0
28+
# hooks:
29+
# - id: autoflake
30+
# # args ref: https://github.com/PyCQA/autoflake#advanced-usage
31+
# args:
32+
# - --in-place
33+
34+
# # Autoformat: Python code
35+
# - repo: https://github.com/pycqa/isort
36+
# rev: 5.11.4
37+
# hooks:
38+
# - id: isort
39+
40+
# # Autoformat: Python code
41+
# - repo: https://github.com/psf/black
42+
# rev: 22.12.0
43+
# hooks:
44+
# - id: black
45+
46+
# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
47+
- repo: https://github.com/pre-commit/mirrors-prettier
48+
rev: v3.0.0-alpha.4
49+
hooks:
50+
- id: prettier
51+
# FIXME: Autoformatting of our .js files is initially not enabled as it
52+
# would lead to large indentation changes while we currently have
53+
# several open PRs good to resolve first.
54+
exclude_types:
55+
- "javascript"
56+
57+
# Autoformat and linting, misc. details
58+
- repo: https://github.com/pre-commit/pre-commit-hooks
59+
rev: v4.4.0
60+
hooks:
61+
- id: end-of-file-fixer
62+
- id: requirements-txt-fixer
63+
- id: check-case-conflict
64+
- id: check-executables-have-shebangs
65+
66+
# Linting: Python code (see the file .flake8)
67+
- repo: https://github.com/PyCQA/flake8
68+
rev: "6.0.0"
69+
hooks:
70+
- id: flake8
71+
72+
ci:
73+
# pre-commit.ci will open PRs updating our hooks once a month
74+
autoupdate_schedule: monthly

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nbgitpuller/templates/

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@
6868

6969
[@akhmerov](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Aakhmerov+updated%3A2021-09-02..2022-03-18&type=Issues) | [@brian-rose](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Abrian-rose+updated%3A2021-09-02..2022-03-18&type=Issues) | [@choldgraf](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Acholdgraf+updated%3A2021-09-02..2022-03-18&type=Issues) | [@consideRatio](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3AconsideRatio+updated%3A2021-09-02..2022-03-18&type=Issues) | [@jameshowison](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Ajameshowison+updated%3A2021-09-02..2022-03-18&type=Issues) | [@jdmansour](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Ajdmansour+updated%3A2021-09-02..2022-03-18&type=Issues) | [@manics](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Amanics+updated%3A2021-09-02..2022-03-18&type=Issues) | [@ryanlovett](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Aryanlovett+updated%3A2021-09-02..2022-03-18&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Awelcome+updated%3A2021-09-02..2022-03-18&type=Issues) | [@yuvipanda](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3Ayuvipanda+updated%3A2021-09-02..2022-03-18&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyterhub%2Fnbgitpuller+involves%3AZsailer+updated%3A2021-09-02..2022-03-18&type=Issues)
7070

71-
7271
### 1.0.2 - 2021-09-03
7372

7473
A release to fix an issue that stopped us from publishing nbgitpuller on
7574
conda-forge.
7675

7776
#### Maintenance and upkeep improvements
7877

79-
- Fix jupyter-packaging reference, use - instead of _ [#219](https://github.com/jupyterhub/nbgitpuller/pull/219) ([@consideRatio](https://github.com/consideRatio))
78+
- Fix jupyter-packaging reference, use - instead of \_ [#219](https://github.com/jupyterhub/nbgitpuller/pull/219) ([@consideRatio](https://github.com/consideRatio))
8079

8180
### 1.0.1 - 2021-09-02
8281

@@ -198,7 +197,7 @@ This is a critical security release, please upgrade to this and see [GHSA-mq5p-2
198197
- Add a mybinder.org tab to the link builder ([#129](https://github.com/jupyterhub/nbgitpuller/pull/129))
199198
- tab activation on link generator ([#132](https://github.com/jupyterhub/nbgitpuller/pull/132))
200199
- fixing bug ([#134](https://github.com/jupyterhub/nbgitpuller/pull/134))
201-
- Fix typo from ipynb link generator external tool reference ([#136](https://github.com/jupyterhub/nbgitpuller/pull/136))
200+
- Fix typo from ipynb link generator external tool reference ([#136](https://github.com/jupyterhub/nbgitpuller/pull/136))
202201
- Use the correct branch for contentRepo ([#138](https://github.com/jupyterhub/nbgitpuller/pull/138))
203202
- Fix file paths or application paths ([#140](https://github.com/jupyterhub/nbgitpuller/pull/140))
204203
- Make the environment repo branch required for binder ([#143](https://github.com/jupyterhub/nbgitpuller/pull/143))

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# [nbgitpuller](https://github.com/jupyterhub/nbgitpuller)
22

3-
43
[![GitHub Workflow Status - Test](https://img.shields.io/github/workflow/status/jupyterhub/nbgitpuller/Tests?logo=github&label=tests)](https://github.com/jupyterhub/nbgitpuller/actions)
54
[![CircleCI build status](https://img.shields.io/circleci/build/github/jupyterhub/nbgitpuller?logo=circleci&label=docs)](https://circleci.com/gh/jupyterhub/nbgitpuller)
65
[![](https://img.shields.io/pypi/v/nbgitpuller.svg?logo=pypi)](https://pypi.python.org/pypi/nbgitpuller)
@@ -25,8 +24,7 @@ pip install nbgitpuller
2524

2625
## Example
2726

28-
29-
This example shows how to use the [nbgitpuller link generator](https://jupyterhub.github.io/nbgitpuller/link)
27+
This example shows how to use the [nbgitpuller link generator](https://jupyterhub.github.io/nbgitpuller/link)
3028
to create an nbgitpuller link, which a user then clicks.
3129

3230
1. The [nbgitpuller link generator GUI](https://jupyterhub.github.io/nbgitpuller/link) is used to create a

0 commit comments

Comments
 (0)