Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 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
29 changes: 13 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
autoupdate_schedule: quarterly
# submodules: true

# exclude notebook files and markdown issue templates
exclude: '\.ipynb$|^\.github/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -18,35 +20,30 @@ repos:
- id: check-docstring-first
- id: detect-private-key

#- repo: https://github.com/myint/docformatter
# rev: v1.5.0
# hooks:
# - id: docformatter
# args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies: [tomli]
#args: ["--write-changes"] # uncomment if you want to get automatic fixing

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 25.11.0
hooks:
- id: black
name: Black code
args: [--skip-string-normalization]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.14.5
hooks:
- id: ruff
args: ["--fix"]
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ _Note: You might want to set a reference to the main repository to fetch/merge f
git remote add upstream https://github.com/nteract/papermill
```

It's possible you will have conflicts between your repository and main. Here, `main` is meant to be synchronized with the `upstream` repository. GitHub has some good [documentation](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/) on merging pull requests from the command line.
It's possible you will have conflicts between your repository and main. Here, `main` is meant to be synchronized with the `upstream` repository. GitHub has some good [documentation](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/) on merging pull requests from the command line.

Happy hacking on Papermill!
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pip install papermill
```

For all optional io dependencies, you can specify individual bundles
like `s3`, or `azure` -- or use `all`. To use Black to format parameters you can add as an extra requires \['black'\].
like `s3`, or `azure` -- or use `all`. To use Black to format parameters you can add as an extra requires ['black'].

```{.sourceCode .bash}
pip install papermill[all]
Expand Down Expand Up @@ -100,7 +100,7 @@ $ papermill local/input.ipynb s3://bkt/output.ipynb -p alpha 0.6 -p l1_ratio 0.1
```

**NOTE:**
If you use multiple AWS accounts, and you have [properly configured your AWS credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html), then you can specify which account to use by setting the `AWS_PROFILE` environment variable at the command-line. For example:
If you use multiple AWS accounts, and you have [properly configured your AWS credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html), then you can specify which account to use by setting the `AWS_PROFILE` environment variable at the command-line. For example:

```{.sourceCode .bash}
$ AWS_PROFILE=dev_account papermill local/input.ipynb s3://bkt/output.ipynb -p alpha 0.6 -p l1_ratio 0.1
Expand Down Expand Up @@ -154,7 +154,7 @@ Papermill supports the following name handlers for input and output paths during

- Local file system: `local`

- HTTP, HTTPS protocol: `http://, https://`
- HTTP, HTTPS protocol: `http://, https://`

- Amazon Web Services: [AWS S3](https://aws.amazon.com/s3/) `s3://`

Expand Down
4 changes: 2 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ We made it to our [1.0 milestone goals](https://github.com/nteract/papermill/mil

- Input and output paths can now reference input parameters. `my_nb_{nb_type}.ipynb out_{nb_type}.ipynb -p nb_type test` will substitute values into the paths passed in with python format application patterns.
- `read_notebook`, `read_notebooks`, `record`, and `display` api functions are now removed.
- \[upstream\] ipywidgets are now supported. See [nbconvert docs](https://nbconvert.readthedocs.io/en/latest/execute_api.html#widget-state) for details.
- \[upstream\] notebook executions which run out of memory no longer hang indefinitely when the kernel dies.
- [upstream] ipywidgets are now supported. See [nbconvert docs](https://nbconvert.readthedocs.io/en/latest/execute_api.html#widget-state) for details.
- [upstream] notebook executions which run out of memory no longer hang indefinitely when the kernel dies.

## 0.19.1

Expand Down
1 change: 1 addition & 0 deletions papermill/abs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for working with Azure blob storage"""

import io
import re

Expand Down
1 change: 1 addition & 0 deletions papermill/adl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for working with Azure data lake storage"""

import re

from azure.datalake.store import core, lib
Expand Down
1 change: 1 addition & 0 deletions papermill/engines.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Engines to perform different roles"""

import datetime
import sys
from functools import wraps
Expand Down
5 changes: 2 additions & 3 deletions papermill/inspection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deduce parameters of a notebook from the parameters cell."""

from pathlib import Path

import click
Expand Down Expand Up @@ -88,9 +89,7 @@ def display_notebook_help(ctx, notebook_path, parameters):
param_help = f"{definition:<34}{p['help']}"
click.echo(param_help)
else:
click.echo(
"\n Can't infer anything about this notebook's parameters. " "It may not have any parameter defined."
)
click.echo("\n Can't infer anything about this notebook's parameters. It may not have any parameter defined.")

return 0

Expand Down
1 change: 1 addition & 0 deletions papermill/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sets up a logger"""

import logging

logger = logging.getLogger('papermill')
1 change: 1 addition & 0 deletions papermill/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Models used by papermill."""

from collections import namedtuple

Parameter = namedtuple(
Expand Down
2 changes: 1 addition & 1 deletion papermill/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
""" Test the command line interface """
"""Test the command line interface"""

import os
import subprocess
Expand Down
2 changes: 1 addition & 1 deletion papermill/tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test(self):
path = get_notebook_path('broken1.ipynb')

# check that the notebook has two existing marker cells, so that this test is sure to be
# validating the removal logic (the markers are simulatin an error in the first code cell
# validating the removal logic (the markers are simulating an error in the first code cell
# that has since been fixed)
original_nb = load_notebook_node(path)
self.assertEqual(original_nb.cells[0].metadata["tags"], ["papermill-error-cell-tag"])
Expand Down
22 changes: 8 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Example configuration for Black.
[tool.black]
line-length = 120
target-version = ['py311']
target-version = ['py310']
skip-string-normalization = true


Expand Down Expand Up @@ -34,33 +34,27 @@ ignore-words-list = "dne, compiletime"


[tool.ruff]
target-version = "py38"
target-version = "py310"
line-length = 120
# Enable Pyflakes `E` and `F` codes by default.
select = [
lint.select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
"I", # isort
# "D", # see: https://pypi.org/project/pydocstyle
# "N", # see: https://pypi.org/project/pep8-naming
"RUF100", # unnecessary noqa comment
"UP", # pyupgrade
]
#extend-select = [
# "C4", # see: https://pypi.org/project/flake8-comprehensions
# "SIM", # see: https://pypi.org/project/flake8-simplify
# "RET", # see: https://pypi.org/project/flake8-return
# "PT", # see: https://pypi.org/project/flake8-pytest-style
#]
ignore = [
lint.ignore = [
"E731", # Do not assign a lambda expression, use a def
"Q", # Ignore quotes
"UP032" # Ignore Use f-string instead of `format` call
]
# Exclude a variety of commonly ignored directories.
exclude = [
"docs"
]
ignore-init-module-imports = true
format.quote-style = "preserve"

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
""""
"""
setup.py

See:
Expand All @@ -8,6 +8,7 @@
https://github.com/pypa/sampleproject

"""

import os

from setuptools import setup
Expand Down
Loading