Skip to content

Commit 1727d1d

Browse files
authored
Clean up pytest and add mypy handling (#300)
* clean up pytest and add mypy handling * add py.typed file * fix up workflows * cleanup * cleanup * cleanup * fix docs links and win run * another windows fix * invert order * clean up event loop handling
1 parent 347585e commit 1727d1d

24 files changed

+169
-63
lines changed

.github/workflows/draft-changelog.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ on:
77
required: true
88
branch:
99
description: "The branch to target (defaults to default branch)"
10+
required: false
1011
version_spec:
1112
description: "New Version Spec"
1213
default: "next"
14+
required: false
1315
since:
14-
description: Use PRs with activity since this date or git reference
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
1518
since_last_stable:
16-
description: Use PRs with activity since the last stable git tag
19+
description: "Use PRs with activity since the last stable git tag"
1720
type: boolean
21+
required: false
1822
jobs:
1923
draft_changelog:
2024
runs-on: ubuntu-latest

.github/workflows/draft-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ on:
77
required: true
88
branch:
99
description: "The branch to target (defaults to default branch)"
10+
required: false
1011
version_spec:
1112
description: "New Version Spec"
1213
default: "next"
14+
required: false
1315
post_version_spec:
1416
description: "Post Version Specifier"
17+
required: false
1518
since:
16-
description: Use PRs with activity since this date or git reference
19+
description: "Use PRs with activity since this date or git reference"
20+
required: false
1721
since_last_stable:
18-
description: Use PRs with activity since the last stable git tag
22+
description: "Use PRs with activity since the last stable git tag"
23+
required: false
1924
type: boolean
2025
steps_to_skip:
21-
description: Comma separated list of steps to skip
26+
description: "Comma separated list of steps to skip"
27+
required: false
2228
jobs:
2329
draft_release:
2430
runs-on: ubuntu-latest

.github/workflows/full-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ on:
77
required: true
88
branch:
99
description: "The branch to target (defaults to default branch)"
10+
required: false
1011
version_spec:
1112
description: "New Version Spec"
13+
required: false
1214
default: "next"
1315
post_version_spec:
1416
description: "Post Version Specifier"
17+
required: false
1518
since:
16-
description: Use PRs with activity since this date or git reference
19+
description: "Use PRs with activity since this date or git reference"
20+
required: false
1721
since_last_stable:
18-
description: Use PRs with activity since the last stable git tag
22+
description: "Use PRs with activity since the last stable git tag"
23+
required: false
1924
type: boolean
2025
steps_to_skip:
21-
description: Comma separated list of steps to skip
26+
description: "Comma separated list of steps to skip"
27+
required: false
2228

2329
jobs:
2430
full_release:

.github/workflows/generate-changelog.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ on:
33
workflow_dispatch:
44
inputs:
55
target:
6-
description: Target Owner/Repo
6+
description: "Target Owner/Repo"
77
required: true
88
branch:
9-
description: The branch or reference name to filter pull requests by
9+
description: "The branch or reference name to filter pull requests by"
10+
required: false
1011
convert_to_rst:
11-
description: Whether to convert to RST
12+
description: "Whether to convert to RST"
13+
required: false
1214
type: boolean
1315
since:
14-
description: Use PRs with activity since this date or git reference
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
1518
until:
16-
description: Use PRs with activity until this date or git reference
19+
description: "Use PRs with activity until this date or git reference"
20+
required: false
1721
jobs:
1822
generate_changelog:
1923
runs-on: ubuntu-latest

.github/workflows/publish-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
description: "The URL of the draft GitHub release"
77
required: true
88
steps_to_skip:
9-
description: comma-separated list of steps to skip
9+
description: "comma-separated list of steps to skip"
10+
required: false
1011
jobs:
1112
publish_release:
1213
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ jobs:
5858
pip install -e .[test] codecov
5959
6060
- name: Run the tests with coverage on Ubuntu
61-
if: ${{ matrix.os == 'ubuntu' }}
61+
if: ${{ matrix.os == 'ubuntu-latest' }}
6262
run: |
6363
python -m pytest -vv --cov jupyter_releaser --cov-branch --cov-report term-missing:skip-covered
6464
6565
- name: Run the tests on Windows and macOS
66-
if: ${{ matrix.os != 'ubuntu' }}
66+
if: ${{ matrix.os != 'ubuntu-latest' }}
6767
run: |
6868
python -m pytest -vv -s
6969

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,22 @@ repos:
5050
"flake8-implicit-str-concat==0.2.0",
5151
]
5252
stages: [manual]
53+
54+
- repo: https://github.com/pre-commit/mirrors-mypy
55+
rev: v0.942
56+
hooks:
57+
- id: mypy
58+
args: ["--config-file", "pyproject.toml"]
59+
additional_dependencies:
60+
[pytest, click, importlib_resources, types-requests]
61+
stages: [manual]
62+
63+
- repo: https://github.com/sirosen/check-jsonschema
64+
rev: 0.14.2
65+
hooks:
66+
- id: check-jsonschema
67+
name: "Check GitHub Workflows"
68+
files: ^\.github/workflows/
69+
types: [yaml]
70+
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
71+
stages: [manual]

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ prune media
44
prune docs
55
exclude readthedocs.yml
66
include jupyter_releaser/schema.json
7+
include jupyter_releaser/py.typed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# List of patterns, relative to source directory, that match files and
4949
# directories to ignore when looking for source files.
5050
# This pattern also affects html_static_path and html_extra_path.
51-
exclude_patterns = []
51+
# exclude_patterns = []
5252

5353

5454
# -- Options for HTML output -------------------------------------------------

jupyter_releaser/actions/draft_changelog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
if not os.environ.get("RH_SINCE"):
1717
curr_dir = os.getcwd()
1818
os.chdir(CHECKOUT_NAME)
19-
since_last_stable = os.environ.get("RH_SINCE_LAST_STABLE")
20-
since_last_stable = since_last_stable == "true"
19+
since_last_stable_env = os.environ.get("RH_SINCE_LAST_STABLE")
20+
since_last_stable = since_last_stable_env == "true"
2121
since = get_latest_tag(os.environ.get("RH_BRANCH"), since_last_stable)
2222
if since:
2323
log(f"Capturing {since} in RH_SINCE variable")

0 commit comments

Comments
 (0)