Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ repos:
- id: detect-private-key

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies: [tomli]

- repo: https://github.com/psf/black
rev: 25.11.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
name: Black code
Expand All @@ -41,19 +41,19 @@ repos:
- mdformat-gfm

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
rev: v0.15.9
hooks:
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
rev: v2.21.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
rev: v0.25
hooks:
- id: validate-pyproject
6 changes: 3 additions & 3 deletions papermill/adl.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def _create_adapter(self, store_name):

def listdir(self, url):
"""Returns a list of the files under the specified path"""
(store_name, path) = self._split_url(url)
store_name, path = self._split_url(url)
adapter = self._create_adapter(store_name)
return [f"adl://{store_name}.azuredatalakestore.net/{path_to_child}" for path_to_child in adapter.ls(path)]

def read(self, url):
"""Read storage at a given url"""
(store_name, path) = self._split_url(url)
store_name, path = self._split_url(url)
adapter = self._create_adapter(store_name)
lines = []
with adapter.open(path) as f:
Expand All @@ -54,7 +54,7 @@ def read(self, url):

def write(self, buf, url):
"""Write buffer to storage at a given url"""
(store_name, path) = self._split_url(url)
store_name, path = self._split_url(url)
adapter = self._create_adapter(store_name)
with adapter.open(path, 'wb') as f:
f.write(buf.encode())
2 changes: 1 addition & 1 deletion papermill/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __init__(self, keyname=None, *args, **kwargs):
s3 = session.resource('s3', **session_params)
S3.s3_session = (session, client, s3)

(self.session, self.client, self.s3) = S3.s3_session
self.session, self.client, self.s3 = S3.s3_session

def _bucket_name(self, bucket):
return self._clean(bucket).split('/', 1)[0]
Expand Down
2 changes: 1 addition & 1 deletion papermill/tests/test_adl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_split_url_raises_exception_on_invalid_url(self):
self.assertTrue("Invalid ADL url 'this_is_not_a_valid_url'" in str(context.exception))

def test_split_url_splits_valid_url(self):
(store_name, path) = ADL._split_url("adl://foo.azuredatalakestore.net/bar/baz")
store_name, path = ADL._split_url("adl://foo.azuredatalakestore.net/bar/baz")
self.assertEqual(store_name, "foo")
self.assertEqual(path, "bar/baz")

Expand Down
33 changes: 12 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[build-system]
build-backend = "setuptools.build_meta"

requires = [ "setuptools>=61", "wheel" ]

[project]
Expand All @@ -24,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = [ "version" ]
dependencies = [
Expand All @@ -37,7 +37,6 @@ dependencies = [
"tenacity>=5.0.2",
"tqdm>=4.32.2",
]

optional-dependencies.all = [
"azure-datalake-store>=0.0.30,<1.0.0a0",
"azure-identity>=1.3.1",
Expand Down Expand Up @@ -151,15 +150,12 @@ scripts.papermill = "papermill.__main__:papermill"
[tool.setuptools]
packages = [ "papermill" ]
include-package-data = true

[tool.setuptools.dynamic]
version = { attr = "papermill.version.version" }
dynamic.version = { attr = "papermill.version.version" }

# Example configuration for Black.

[tool.black]
line-length = 120
target-version = [ 'py310' ]
target-version = [ "py310" ]
skip-string-normalization = true

[tool.ruff]
Expand All @@ -170,7 +166,6 @@ exclude = [
"docs",
]
format.quote-style = "preserve"

# Enable Pyflakes `E` and `F` codes by default.
lint.select = [
"E",
Expand All @@ -196,27 +191,25 @@ quiet-level = 3
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
ignore-words-list = "dne, compiletime"

[tool.pytest.ini_options]
env = [
[tool.pytest]
ini_options.env = [
"AWS_SECRET_ACCESS_KEY=foobar_secret",
"AWS_ACCESS_KEY_ID=foobar_key",
]
filterwarnings = [
ini_options.filterwarnings = [
"ignore:.*imp module is deprecated.*:DeprecationWarning",
]

[tool.coverage.run]
branch = false

[tool.coverage.report]
exclude_lines = [
[tool.coverage]
run.branch = false
report.exclude_lines = [
"if __name__ == .__main__.:",
"if self.debug:",
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
omit = [
report.omit = [
"papermill/tests/*",
"papermill/version.py",
]
Expand Down Expand Up @@ -295,6 +288,4 @@ current_version = "2.6.0"
commit = true
tag = true
tag_name = "{new_version}"

[[tool.bumpversion.files]]
filename = "papermill/version.py"
files = [ { filename = "papermill/version.py" } ]
Loading