From 38a297153bef958b84c9d989d0686d08df9b4775 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 07:49:29 -0800 Subject: [PATCH 01/32] Convert setup.py using hatch --- pyproject.toml | 372 +++++++++++++++++-------------------------------- 1 file changed, 131 insertions(+), 241 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 57cb957c..3bec86b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,306 +1,196 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "papermill" dynamic = ["version"] description = "Parameterize and run Jupyter and nteract Notebooks" readme = "README.md" -license = {text = "BSD"} +license = "BSD" +requires-python = ">=3.10" authors = [ - {name = "nteract contributors", email = "nteract@googlegroups.com"} + { name = "nteract contributors", email = "nteract@googlegroups.com" }, +] +keywords = [ + "jupyter", + "mapreduce", + "notebook", + "nteract", + "pipeline", ] -keywords = ["jupyter", "mapreduce", "nteract", "pipeline", "notebook"] classifiers = [ "Intended Audience :: Developers", - "Intended Audience :: System Administrators", "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.10" dependencies = [ + "aiohttp >=3.9.0; python_version==\"3.12\"", "click", + "entrypoints", + "nbclient >= 0.2.0", + "nbformat >= 5.2.0", "pyyaml", - "nbformat>=5.2.0", - "nbclient>=0.2.0", - "tqdm>=4.32.2", "requests", - "entrypoints", - "tenacity>=5.0.2", - "aiohttp>=3.9.0; python_version=='3.12'", + "tenacity >= 5.0.2", + "tqdm >= 4.32.2", ] -[project.urls] -Documentation = "https://papermill.readthedocs.io" -Funding = "https://nteract.io" -Source = "https://github.com/nteract/papermill/" -Tracker = "https://github.com/nteract/papermill/issues" - -[project.scripts] -papermill = "papermill.__main__:papermill" - [project.optional-dependencies] -s3 = ["boto3"] -azure = [ - "azure-datalake-store>=0.0.30,<1.0.0a0", - "azure-storage-blob>=12.1.0", - "requests>=2.21.0", - "azure-identity>=1.3.1", -] -gcs = ["gcsfs>=0.2.0"] -hdfs = ["pyarrow>=2.0"] -github = ["PyGithub>=1.55"] -black = ["black>=19.3b0"] all = [ - "boto3", - "azure-datalake-store>=0.0.30,<1.0.0a0", - "azure-storage-blob>=12.1.0", - "requests>=2.21.0", + "# newer versions require changes to authentication", + "# see https://github.com/nteract/papermill/issues/825", + "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", + "azure-storage-blob >= 12.1.0", + "black >= 19.3b0", + "boto3", "gcsfs>=0.2.0", - "pyarrow>=2.0", - "PyGithub>=1.55", - "black>=19.3b0", + "pyarrow >= 2.0", + "PyGithub >= 1.55", + "requests >= 2.21.0", +] +azure = [ + "# newer versions require changes to authentication", + "# see https://github.com/nteract/papermill/issues/825", + "azure-datalake-store >= 0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob >= 12.1.0", + "requests >= 2.21.0", +] +black = [ + "black >= 19.3b0", ] dev = [ + "# newer versions of ipython have different imports and require refactoring", + "# newer versions require changes to authentication", + "# see https://github.com/nteract/papermill/issues/825", + "attrs>=17.4.0", + "azure-datalake-store >= 0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob >= 12.1.0", + "black >= 19.3b0", + "boto3", "boto3", "botocore", + "bumpversion", + "check-manifest", "codecov", "coverage", - "google_compute_engine", + "gcsfs>=0.2.0", + "google_compute_engine # Need this because boto has issues with dynamic package loading during tests if other google components are there", "ipython>=5.0,<9.0.0", "ipywidgets", + "moto >= 5.0.0,<5.1.0", "notebook", - "moto>=5.0.0,<5.1.0", - "pytest>=4.1", + "pip>=18.1", + "pre-commit", + "pyarrow >= 2.0", + "PyGithub >= 1.55", "pytest-cov>=2.6.1", - "pytest-mock>=1.10", "pytest-env>=0.6.2", - "requests>=2.21.0", - "check-manifest", - "attrs>=17.4.0", - "pre-commit", - "tox", - "bumpversion", + "pytest-mock>=1.10", + "pytest>=4.1", "recommonmark", - "pip>=18.1", - "wheel>=0.31.0", + "requests >= 2.21.0", + "requests >= 2.21.0", "setuptools>=38.6.0", + "tox", "twine>=1.11.0", - "azure-datalake-store>=0.0.30,<1.0.0a0", - "azure-storage-blob>=12.1.0", + "wheel>=0.31.0", +] +docs = [ + "# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html#pinning-dependencies", + "# newer versions require changes to authentication", + "# Pin packages for RTD builds", + "# see https://github.com/nteract/papermill/issues/825", + "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", + "azure-storage-blob >= 12.1.0", + "black >= 19.3b0", + "boto3", + "furo>=2023.9.10", "gcsfs>=0.2.0", - "pyarrow>=2.0", - "PyGithub>=1.55", - "black>=19.3b0", + "moto>=4.2.8", + "myst-parser>=2.0.0", + "pyarrow >= 2.0", + "PyGithub >= 1.55", + "requests >= 2.21.0", + "sphinx-copybutton>=0.5.2", + "Sphinx>=7.2.6", +] +gcs = [ + "gcsfs>=0.2.0", +] +github = [ + "PyGithub >= 1.55", +] +hdfs = [ + "pyarrow >= 2.0", +] +s3 = [ + "boto3", ] test = [ + "# newer versions of ipython have different imports and require refactoring", + "# newer versions require changes to authentication", + "# see https://github.com/nteract/papermill/issues/825", + "attrs>=17.4.0", + "azure-datalake-store >= 0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob >= 12.1.0", + "black >= 19.3b0", + "boto3", "boto3", "botocore", + "bumpversion", + "check-manifest", "codecov", "coverage", - "google_compute_engine", + "gcsfs>=0.2.0", + "google_compute_engine # Need this because boto has issues with dynamic package loading during tests if other google components are there", "ipython>=5.0,<9.0.0", "ipywidgets", + "moto >= 5.0.0,<5.1.0", "notebook", - "moto>=5.0.0,<5.1.0", - "pytest>=4.1", + "pip>=18.1", + "pre-commit", + "pyarrow >= 2.0", + "PyGithub >= 1.55", "pytest-cov>=2.6.1", - "pytest-mock>=1.10", "pytest-env>=0.6.2", - "requests>=2.21.0", - "check-manifest", - "attrs>=17.4.0", - "pre-commit", - "tox", - "bumpversion", + "pytest-mock>=1.10", + "pytest>=4.1", "recommonmark", - "pip>=18.1", - "wheel>=0.31.0", + "requests >= 2.21.0", + "requests >= 2.21.0", "setuptools>=38.6.0", + "tox", "twine>=1.11.0", - "azure-datalake-store>=0.0.30,<1.0.0a0", - "azure-storage-blob>=12.1.0", - "azure-identity>=1.3.1", - "gcsfs>=0.2.0", - "pyarrow>=2.0", - "PyGithub>=1.55", - "black>=19.3b0", -] -docs = [ - "boto3", - "azure-datalake-store>=0.0.30,<1.0.0a0", - "azure-storage-blob>=12.1.0", - "requests>=2.21.0", - "azure-identity>=1.3.1", - "gcsfs>=0.2.0", - "pyarrow>=2.0", - "PyGithub>=1.55", - "black>=19.3b0", - "Sphinx>=7.2.6", - "furo>=2023.9.10", - "myst-parser>=2.0.0", - "moto>=4.2.8", - "sphinx-copybutton>=0.5.2", -] - -[tool.setuptools] -packages = ["papermill"] -include-package-data = true - -[tool.setuptools.dynamic] -version = {attr = "papermill.version.version"} - -# Example configuration for Black. -[tool.black] -line-length = 120 -target-version = ['py310'] -skip-string-normalization = true - - -[tool.coverage.run] -branch = false - -[tool.coverage.report] -exclude_lines = [ - "if self.debug:", - "pragma: no cover", - "raise AssertionError", - "raise NotImplementedError", - "if __name__ == .__main__.:", -] -omit = [ - "papermill/tests/*", - "papermill/version.py" + "wheel>=0.31.0", ] +[project.scripts] +papermill = "papermill.__main__:papermill" -[tool.codespell] -quiet-level = 3 -# comma separated list of words; waiting for: -# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603 -# also adding links until they ignored by its: nature -# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960 -ignore-words-list = "dne, compiletime" - - -[tool.ruff] -target-version = "py310" -line-length = 120 -# Enable Pyflakes `E` and `F` codes by default. -lint.select = [ - "E", "W", # see: https://pypi.org/project/pycodestyle - "F", # see: https://pypi.org/project/pyflakes - "I", # isort - "RUF100", # unnecessary noqa comment - "UP", # pyupgrade -] -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" -] -format.quote-style = "preserve" +[project.urls] +Documentation = "https://papermill.readthedocs.io" +Funding = "https://nteract.io" +Homepage = "https://github.com/nteract/papermill" +Source = "https://github.com/nteract/papermill/" +Tracker = "https://github.com/nteract/papermill/issues" -[tool.ruff.lint.pydocstyle] -# Use Google-style docstrings. -convention = "google" +[tool.hatch.version] +path = "papermill/__init__.py" -[tool.pytest.ini_options] -env = [ - "AWS_SECRET_ACCESS_KEY=foobar_secret", - "AWS_ACCESS_KEY_ID=foobar_key", -] -filterwarnings = [ - "ignore:.*imp module is deprecated.*:DeprecationWarning", +[tool.hatch.build.targets.sdist] +include = [ + "/papermill", ] - -[tool.bumpversion] -current_version = "2.6.0" -commit = true -tag = true -tag_name = "{new_version}" - -[[tool.bumpversion.files]] -filename = "papermill/version.py" - -[tool.tox] -legacy_tox_ini = """ -[tox] -skipsdist = true -envlist = py{310,311,312,313}, dist, manifest, docs, binder - -[gh-actions] -python = - 3.10: py310 - 3.11: py311 - 3.12: py312 - 3.13: py313, docs, dist - -# Manifest -[testenv:manifest] -skip_install = true -deps = check-manifest -commands = check-manifest -ignore = - .readthedocs.yaml - -# Docs -[testenv:docs] -description = invoke sphinx-build to build the HTML docs -deps = - .[docs] -extras = docs -commands = - sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs} - python -c 'import pathlib; print("documentation available under file://\\{0\\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))' - -# Binder -[testenv:binder] -description = ensure /binder/*ipynb are runnable -deps = - -r binder/requirements.txt -commands = python -c "import glob; import papermill as pm; [pm.execute_notebook(input, '{toxworkdir}/out.ipynb', parameters=\\{'binder_dir':'binder'\\}) for input in glob.glob('binder/**/*.ipynb')]" - -# Distro -[testenv:dist] -skip_install = true -deps = build -commands = - python -m build --outdir {distdir} - /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.tar.gz' - /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.whl' - -[testenv] -# disable Python's hash randomization for tests that stringify dicts, etc -setenv = - PYTHONHASHSEED = 0 - AWS_ACCESS_KEY_ID=foobar_key - AWS_SECRET_ACCESS_KEY=foobar_secret -passenv = * -basepython = - py310: python3.10 - py311: python3.11 - py312: python3.12 - py313: python3.13 - manifest: python3.13 - dist: python3.13 - docs: python3.13 - binder: python3.13 -deps = .[dev] -# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line... -allowlist_externals = /bin/bash -commands = pytest -v --maxfail=2 --cov=papermill -W always {posargs} -""" From 293f576eaaa5acb9fd9a75cf2d1b598a7267d6ba Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 07:50:59 -0800 Subject: [PATCH 02/32] move tools into pyproject.toml --- pyproject.toml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3bec86b9..3f5390d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -194,3 +194,62 @@ path = "papermill/__init__.py" include = [ "/papermill", ] + + +[tool.black] +line-length = 120 +target-version = ['py310'] +skip-string-normalization = true + + +[tool.coverage.run] +branch = false + +[tool.coverage.report] +exclude_lines = [ + "if self.debug:", + "pragma: no cover", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == .__main__.:", +] +omit = [ + "papermill/tests/*", + "papermill/version.py" +] + + +[tool.codespell] +quiet-level = 3 +# comma separated list of words; waiting for: +# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603 +# also adding links until they ignored by its: nature +# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960 +ignore-words-list = "dne, compiletime" + + +[tool.ruff] +target-version = "py310" +line-length = 120 +# Enable Pyflakes `E` and `F` codes by default. +lint.select = [ + "E", "W", # see: https://pypi.org/project/pycodestyle + "F", # see: https://pypi.org/project/pyflakes + "I", # isort + "RUF100", # unnecessary noqa comment + "UP", # pyupgrade +] +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" +] +format.quote-style = "preserve" + +[tool.ruff.lint.pydocstyle] +# Use Google-style docstrings. +convention = "google" From 3fd9cb57fa32a42ef6d5fd6863400819382f89aa Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 07:59:35 -0800 Subject: [PATCH 03/32] comment out setup.py --- setup.py | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..f0e31760 --- /dev/null +++ b/setup.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +""" +setup.py + +See: +https://packaging.python.org/tutorials/packaging-projects/ +https://packaging.python.org/en/latest/distributing.html +https://github.com/pypa/sampleproject + +""" + +# import os + +# from setuptools import setup + +# local_path = os.path.dirname(__file__) +# # Fix for tox which manipulates execution pathing +# if not local_path: +# local_path = '.' +# here = os.path.abspath(local_path) + + +# def version(): +# with open(f"{here}/papermill/version.py") as ver: +# for line in ver.readlines(): +# if line.startswith('version ='): +# return line.split(' = ')[-1].strip()[1:-1] +# raise ValueError('No version found in papermill/version.py') + + +# def read(fname): +# with open(fname) as fhandle: +# return fhandle.read() + + +# def read_reqs(fname, folder=None): +# path_dir = os.path.join(here, folder) if folder else here +# req_path = os.path.join(path_dir, fname) +# return [req.strip() for req in read(req_path).splitlines() if req.strip()] + + +# s3_reqs = read_reqs('s3.txt', folder='requirements') +# azure_reqs = read_reqs('azure.txt', folder='requirements') +# gcs_reqs = read_reqs('gcs.txt', folder='requirements') +# hdfs_reqs = read_reqs('hdfs.txt', folder='requirements') +# github_reqs = read_reqs('github.txt', folder='requirements') +# docs_only_reqs = read_reqs('docs.txt', folder='requirements') +# black_reqs = ['black >= 19.3b0'] +# all_reqs = s3_reqs + azure_reqs + gcs_reqs + hdfs_reqs + github_reqs + black_reqs +# docs_reqs = all_reqs + docs_only_reqs +# dev_reqs = read_reqs('dev.txt', folder='requirements') + all_reqs +# extras_require = { +# "test": dev_reqs, +# "dev": dev_reqs, +# "all": all_reqs, +# "s3": s3_reqs, +# "azure": azure_reqs, +# "gcs": gcs_reqs, +# "hdfs": hdfs_reqs, +# "github": github_reqs, +# "black": black_reqs, +# "docs": docs_reqs, +# } + +# # Get the long description from the README file +# with open(os.path.join(here, 'README.md'), encoding='utf-8') as f: +# long_description = f.read() + +# setup( +# name='papermill', +# version=version(), +# description='Parameterize and run Jupyter and nteract Notebooks', +# author='nteract contributors', +# author_email='nteract@googlegroups.com', +# license='BSD', +# # Note that this is a string of words separated by whitespace, not a list. +# keywords='jupyter mapreduce nteract pipeline notebook', +# long_description=long_description, +# long_description_content_type='text/markdown', +# url='https://github.com/nteract/papermill', +# packages=['papermill'], +# python_requires='>=3.10', +# install_requires=read_reqs('requirements.txt'), +# extras_require=extras_require, +# entry_points={'console_scripts': ['papermill = papermill.__main__:papermill']}, +# project_urls={ +# 'Documentation': 'https://papermill.readthedocs.io', +# 'Funding': 'https://nteract.io', +# 'Source': 'https://github.com/nteract/papermill/', +# 'Tracker': 'https://github.com/nteract/papermill/issues', +# }, +# classifiers=[ +# 'Intended Audience :: Developers', +# 'Intended Audience :: System Administrators', +# 'Intended Audience :: Science/Research', +# 'License :: OSI Approved :: BSD License', +# 'Programming Language :: Python', +# 'Programming Language :: Python :: 3', +# 'Programming Language :: Python :: 3.10', +# 'Programming Language :: Python :: 3.11', +# 'Programming Language :: Python :: 3.12', +# 'Programming Language :: Python :: 3.13', +# ], +# ) From c8df7d9facecd2d53f9533b36275c30bebbc209a Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 08:09:58 -0800 Subject: [PATCH 04/32] add hatch-vcs and troubleshoot version --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3f5390d4..3789ebed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" [project] @@ -187,8 +187,9 @@ Homepage = "https://github.com/nteract/papermill" Source = "https://github.com/nteract/papermill/" Tracker = "https://github.com/nteract/papermill/issues" -[tool.hatch.version] -path = "papermill/__init__.py" +[tool.hatch] +version.source = "vcs" +build.hooks.vcs.version-file = "papermill/version.py" [tool.hatch.build.targets.sdist] include = [ From 922ce2ee8cff040121b0e6bc0799f570d4fa8fab Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 08:22:28 -0800 Subject: [PATCH 05/32] update version handling --- .gitignore | 3 +++ papermill/version.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 papermill/version.py diff --git a/.gitignore b/.gitignore index a580829b..30942df9 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,6 @@ pip-wheel-metadata # lint .ruff_cache/ local.ipynb + +# hatch build +papermill/version.py diff --git a/papermill/version.py b/papermill/version.py deleted file mode 100644 index e7426207..00000000 --- a/papermill/version.py +++ /dev/null @@ -1 +0,0 @@ -version = '2.6.0' From 2fbdd85dbbb82e5f8fd283036901858ad01d7dc6 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 08:41:12 -0800 Subject: [PATCH 06/32] add dynamic versioning files for git --- .git_archival.txt | 3 +++ .gitattributes | 1 + pyproject.toml | 34 ++++------------------------------ 3 files changed, 8 insertions(+), 30 deletions(-) create mode 100644 .git_archival.txt diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000..7c510094 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,3 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ diff --git a/.gitattributes b/.gitattributes index af7fe598..d1575bd8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ papermill/_version.py export-subst +.git_archival.txt export-subst diff --git a/pyproject.toml b/pyproject.toml index 3789ebed..5f5943da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "papermill" dynamic = ["version"] description = "Parameterize and run Jupyter and nteract Notebooks" readme = "README.md" -license = "BSD" +license = "BSD-3-Clause" requires-python = ">=3.10" authors = [ { name = "nteract contributors", email = "nteract@googlegroups.com" }, @@ -45,21 +45,9 @@ dependencies = [ [project.optional-dependencies] all = [ - "# newer versions require changes to authentication", - "# see https://github.com/nteract/papermill/issues/825", - "azure-datalake-store >= 0.0.30,<1.0.0a0", - "azure-identity>=1.3.1", - "azure-storage-blob >= 12.1.0", - "black >= 19.3b0", - "boto3", - "gcsfs>=0.2.0", - "pyarrow >= 2.0", - "PyGithub >= 1.55", - "requests >= 2.21.0", + "papermill[azure,black,dev,docs,gcs,github,hdfs,s3,test]" ] azure = [ - "# newer versions require changes to authentication", - "# see https://github.com/nteract/papermill/issues/825", "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", "azure-storage-blob >= 12.1.0", @@ -69,9 +57,6 @@ black = [ "black >= 19.3b0", ] dev = [ - "# newer versions of ipython have different imports and require refactoring", - "# newer versions require changes to authentication", - "# see https://github.com/nteract/papermill/issues/825", "attrs>=17.4.0", "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", @@ -80,12 +65,11 @@ dev = [ "boto3", "boto3", "botocore", - "bumpversion", "check-manifest", "codecov", "coverage", "gcsfs>=0.2.0", - "google_compute_engine # Need this because boto has issues with dynamic package loading during tests if other google components are there", + "google_compute_engine", "ipython>=5.0,<9.0.0", "ipywidgets", "moto >= 5.0.0,<5.1.0", @@ -101,16 +85,11 @@ dev = [ "recommonmark", "requests >= 2.21.0", "requests >= 2.21.0", - "setuptools>=38.6.0", "tox", "twine>=1.11.0", "wheel>=0.31.0", ] docs = [ - "# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html#pinning-dependencies", - "# newer versions require changes to authentication", - "# Pin packages for RTD builds", - "# see https://github.com/nteract/papermill/issues/825", "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", "azure-storage-blob >= 12.1.0", @@ -139,9 +118,6 @@ s3 = [ "boto3", ] test = [ - "# newer versions of ipython have different imports and require refactoring", - "# newer versions require changes to authentication", - "# see https://github.com/nteract/papermill/issues/825", "attrs>=17.4.0", "azure-datalake-store >= 0.0.30,<1.0.0a0", "azure-identity>=1.3.1", @@ -150,12 +126,11 @@ test = [ "boto3", "boto3", "botocore", - "bumpversion", "check-manifest", "codecov", "coverage", "gcsfs>=0.2.0", - "google_compute_engine # Need this because boto has issues with dynamic package loading during tests if other google components are there", + "google_compute_engine", "ipython>=5.0,<9.0.0", "ipywidgets", "moto >= 5.0.0,<5.1.0", @@ -171,7 +146,6 @@ test = [ "recommonmark", "requests >= 2.21.0", "requests >= 2.21.0", - "setuptools>=38.6.0", "tox", "twine>=1.11.0", "wheel>=0.31.0", From ec0bc2719b38d9e0bc7038342ea96e690ad216ef Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 08:42:50 -0800 Subject: [PATCH 07/32] remove setup.py --- setup.py | 104 ------------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index f0e31760..00000000 --- a/setup.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -""" -setup.py - -See: -https://packaging.python.org/tutorials/packaging-projects/ -https://packaging.python.org/en/latest/distributing.html -https://github.com/pypa/sampleproject - -""" - -# import os - -# from setuptools import setup - -# local_path = os.path.dirname(__file__) -# # Fix for tox which manipulates execution pathing -# if not local_path: -# local_path = '.' -# here = os.path.abspath(local_path) - - -# def version(): -# with open(f"{here}/papermill/version.py") as ver: -# for line in ver.readlines(): -# if line.startswith('version ='): -# return line.split(' = ')[-1].strip()[1:-1] -# raise ValueError('No version found in papermill/version.py') - - -# def read(fname): -# with open(fname) as fhandle: -# return fhandle.read() - - -# def read_reqs(fname, folder=None): -# path_dir = os.path.join(here, folder) if folder else here -# req_path = os.path.join(path_dir, fname) -# return [req.strip() for req in read(req_path).splitlines() if req.strip()] - - -# s3_reqs = read_reqs('s3.txt', folder='requirements') -# azure_reqs = read_reqs('azure.txt', folder='requirements') -# gcs_reqs = read_reqs('gcs.txt', folder='requirements') -# hdfs_reqs = read_reqs('hdfs.txt', folder='requirements') -# github_reqs = read_reqs('github.txt', folder='requirements') -# docs_only_reqs = read_reqs('docs.txt', folder='requirements') -# black_reqs = ['black >= 19.3b0'] -# all_reqs = s3_reqs + azure_reqs + gcs_reqs + hdfs_reqs + github_reqs + black_reqs -# docs_reqs = all_reqs + docs_only_reqs -# dev_reqs = read_reqs('dev.txt', folder='requirements') + all_reqs -# extras_require = { -# "test": dev_reqs, -# "dev": dev_reqs, -# "all": all_reqs, -# "s3": s3_reqs, -# "azure": azure_reqs, -# "gcs": gcs_reqs, -# "hdfs": hdfs_reqs, -# "github": github_reqs, -# "black": black_reqs, -# "docs": docs_reqs, -# } - -# # Get the long description from the README file -# with open(os.path.join(here, 'README.md'), encoding='utf-8') as f: -# long_description = f.read() - -# setup( -# name='papermill', -# version=version(), -# description='Parameterize and run Jupyter and nteract Notebooks', -# author='nteract contributors', -# author_email='nteract@googlegroups.com', -# license='BSD', -# # Note that this is a string of words separated by whitespace, not a list. -# keywords='jupyter mapreduce nteract pipeline notebook', -# long_description=long_description, -# long_description_content_type='text/markdown', -# url='https://github.com/nteract/papermill', -# packages=['papermill'], -# python_requires='>=3.10', -# install_requires=read_reqs('requirements.txt'), -# extras_require=extras_require, -# entry_points={'console_scripts': ['papermill = papermill.__main__:papermill']}, -# project_urls={ -# 'Documentation': 'https://papermill.readthedocs.io', -# 'Funding': 'https://nteract.io', -# 'Source': 'https://github.com/nteract/papermill/', -# 'Tracker': 'https://github.com/nteract/papermill/issues', -# }, -# classifiers=[ -# 'Intended Audience :: Developers', -# 'Intended Audience :: System Administrators', -# 'Intended Audience :: Science/Research', -# 'License :: OSI Approved :: BSD License', -# 'Programming Language :: Python', -# 'Programming Language :: Python :: 3', -# 'Programming Language :: Python :: 3.10', -# 'Programming Language :: Python :: 3.11', -# 'Programming Language :: Python :: 3.12', -# 'Programming Language :: Python :: 3.13', -# ], -# ) From fa5f140c45da0d59ec5e0642a2e0b2c86201af2d Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 08:58:57 -0800 Subject: [PATCH 08/32] update manifest --- MANIFEST.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index d32a2282..6bfa1187 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,12 +7,16 @@ recursive-include papermill *.keep recursive-include papermill *.txt include requirements.txt -recursive-include requirements *.txt +include tox.ini +include pytest.ini include README.md include LICENSE include MANIFEST.in include *.md include *.toml +include *.in +include *.txt +recursive-include requirements *.txt # Documentation prune docs From 75bf9da8a6857980c0a60e61ddcdf9968d1b05e7 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:04:43 -0800 Subject: [PATCH 09/32] remove setuptools from files and add doc note --- .github/workflows/ci.yml | 2 +- docs/extending-entry-points.rst | 3 +++ requirements/dev.txt | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c59ba97..3cbade18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: set -xe python -VV python -m site - python -m pip install --upgrade pip setuptools wheel coverage[toml] virtualenv tox tox-gh-actions + python -m pip install --upgrade pip wheel coverage[toml] virtualenv tox tox-gh-actions - name: "Run tox targets for ${{ matrix.python-version }}" run: python -m tox diff --git a/docs/extending-entry-points.rst b/docs/extending-entry-points.rst index 9da81170..ab71829b 100644 --- a/docs/extending-entry-points.rst +++ b/docs/extending-entry-points.rst @@ -1,6 +1,9 @@ Extending papermill through entry points ======================================== +*Note: setuptools is no longer used in this project. This document should be +updated to reflect the use of pyproject.toml and other modern packaging tools.* + What are entry points? ---------------------- diff --git a/requirements/dev.txt b/requirements/dev.txt index d3c7dc51..f1c4882d 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -21,5 +21,4 @@ bumpversion recommonmark pip>=18.1 wheel>=0.31.0 -setuptools>=38.6.0 twine>=1.11.0 From 3328e162180a7b3df72873cf889cb3fa6a1fe277 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:10:41 -0800 Subject: [PATCH 10/32] fix if in ci action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cbade18..eea6bef2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: python -m tox - name: "Generate coverage XML" - if: "contains(env.USING_COVERAGE, matrix.python-version)" + if: contains(env.USING_COVERAGE, matrix.python-version) run: python -m coverage xml - name: "Upload coverage to Codecov" From e252211b120c96372f400a8990a4495aff55d7f5 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:19:27 -0800 Subject: [PATCH 11/32] update license and classifier --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5f5943da..f9088f23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,8 @@ name = "papermill" dynamic = ["version"] description = "Parameterize and run Jupyter and nteract Notebooks" readme = "README.md" -license = "BSD-3-Clause" +license.expression = "BSD-3-Clause" +license.file = "LICENSE" requires-python = ">=3.10" authors = [ { name = "nteract contributors", email = "nteract@googlegroups.com" }, @@ -23,7 +24,6 @@ classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", - "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.13", From 9b151acdcb30827cc8342e0daf5d6f475395390c Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:24:31 -0800 Subject: [PATCH 12/32] update url for markdown precommit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0bfe0a4..afdae31a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: name: Black code args: [--skip-string-normalization] - - repo: https://github.com/executablebooks/mdformat + - repo: https://github.com/hukkin/mdformat rev: 1.0.0 hooks: - id: mdformat From 1123c19d2b05b3ce65b99c1bf7d2d3328a6105f8 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:26:26 -0800 Subject: [PATCH 13/32] update url for black precommit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afdae31a..1d73a259 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: codespell additional_dependencies: [tomli] - - repo: https://github.com/psf/black + - repo: https://github.com/psf/black-pre-commit-mirror rev: 25.11.0 hooks: - id: black From e14e1d0bf324e4d936c02489f24451e65a09974e Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:35:55 -0800 Subject: [PATCH 14/32] move pytest.ini to pyproject.toml --- pyproject.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f9088f23..a2ea1bae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -203,6 +203,16 @@ quiet-level = 3 ignore-words-list = "dne, compiletime" +[tool.pytest.ini_options] +env = [ + "AWS_SECRET_ACCESS_KEY=foobar_secret", + "AWS_ACCESS_KEY_ID=foobar_key" +] +filterwarnings = [ + "ignore:.*imp module is deprecated.*:DeprecationWarning", +] + + [tool.ruff] target-version = "py310" line-length = 120 From bb39832b2bb7f81685b952762b5a2b9d1e3730d6 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 09:40:57 -0800 Subject: [PATCH 15/32] apply scientific python recommendations for pytest config --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a2ea1bae..43925dc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -204,6 +204,11 @@ ignore-words-list = "dne, compiletime" [tool.pytest.ini_options] +minversion = "9" +testpaths = ["papermill/tests"] +log_level = "INFO" +strict_xfail = true +addopts = ["-ra", "--strict-config", "--strict-markers"] env = [ "AWS_SECRET_ACCESS_KEY=foobar_secret", "AWS_ACCESS_KEY_ID=foobar_key" From 10dd869cb670350acd818fe03ae8f17fdcf606be Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 11:59:53 -0800 Subject: [PATCH 16/32] remove unneeded ruff python version --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 43925dc4..439943c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -219,7 +219,6 @@ filterwarnings = [ [tool.ruff] -target-version = "py310" line-length = 120 # Enable Pyflakes `E` and `F` codes by default. lint.select = [ From bbccc4975474424849cdb709f5785d592486de6e Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:13:23 -0800 Subject: [PATCH 17/32] use spdx license specifier --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 439943c9..4f6150fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,8 +7,7 @@ name = "papermill" dynamic = ["version"] description = "Parameterize and run Jupyter and nteract Notebooks" readme = "README.md" -license.expression = "BSD-3-Clause" -license.file = "LICENSE" +license = {text = "BSD-3-Clause"} requires-python = ">=3.10" authors = [ { name = "nteract contributors", email = "nteract@googlegroups.com" }, From b81ccb9f7f4ce3d65f125414bcadc71b95df7f16 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:18:05 -0800 Subject: [PATCH 18/32] update pytest filter warning --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4f6150fe..b55ce4c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -213,7 +213,7 @@ env = [ "AWS_ACCESS_KEY_ID=foobar_key" ] filterwarnings = [ - "ignore:.*imp module is deprecated.*:DeprecationWarning", + "error", # turn all warnings into errors ] From 4e9cad03c1a250a985729d7933918f0a1fbe9ca2 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:19:20 -0800 Subject: [PATCH 19/32] remove unneeded requirements file --- requirements.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6f8ebb8a..00000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -click -pyyaml -nbformat >= 5.2.0 -nbclient >= 0.2.0 -tqdm >= 4.32.2 -requests -entrypoints -tenacity >= 5.0.2 -aiohttp >=3.9.0; python_version=="3.12" From e163fb55f25429a19ddf4c9caa71e2e5e07dffcf Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:26:16 -0800 Subject: [PATCH 20/32] add hatch to dev dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index b55ce4c7..94447c4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ dev = [ "coverage", "gcsfs>=0.2.0", "google_compute_engine", + "hatch", "ipython>=5.0,<9.0.0", "ipywidgets", "moto >= 5.0.0,<5.1.0", From 17ae1d563491d1413eaf5efbeb1f4ceace5df4ed Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:33:50 -0800 Subject: [PATCH 21/32] dedupe dependencies --- pyproject.toml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 94447c4c..00561780 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,17 +44,14 @@ dependencies = [ [project.optional-dependencies] all = [ - "papermill[azure,black,dev,docs,gcs,github,hdfs,s3,test]" + "papermill[azure,dev,docs,gcs,github,hdfs,s3,test]" ] azure = [ - "azure-datalake-store >= 0.0.30,<1.0.0a0", + "azure-datalake-store >= 0.0.30,<1.0.0a0", # newer versions require auth changes see https://github.com/nteract/papermill/issues/825 "azure-identity>=1.3.1", "azure-storage-blob >= 12.1.0", "requests >= 2.21.0", ] -black = [ - "black >= 19.3b0", -] dev = [ "attrs>=17.4.0", "azure-datalake-store >= 0.0.30,<1.0.0a0", @@ -62,7 +59,6 @@ dev = [ "azure-storage-blob >= 12.1.0", "black >= 19.3b0", "boto3", - "boto3", "botocore", "check-manifest", "codecov", @@ -84,24 +80,14 @@ dev = [ "pytest>=4.1", "recommonmark", "requests >= 2.21.0", - "requests >= 2.21.0", "tox", "twine>=1.11.0", "wheel>=0.31.0", ] docs = [ - "azure-datalake-store >= 0.0.30,<1.0.0a0", - "azure-identity>=1.3.1", - "azure-storage-blob >= 12.1.0", - "black >= 19.3b0", - "boto3", "furo>=2023.9.10", - "gcsfs>=0.2.0", "moto>=4.2.8", "myst-parser>=2.0.0", - "pyarrow >= 2.0", - "PyGithub >= 1.55", - "requests >= 2.21.0", "sphinx-copybutton>=0.5.2", "Sphinx>=7.2.6", ] From 7c69ce55e5abe85f9520f6b0b3f9fbdc01705bbe Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Nov 2025 12:34:35 -0800 Subject: [PATCH 22/32] Remove requirements files --- requirements/azure.txt | 6 ------ requirements/dev.txt | 24 ------------------------ requirements/docs.txt | 7 ------- requirements/gcs.txt | 1 - requirements/github.txt | 1 - requirements/hdfs.txt | 1 - requirements/s3.txt | 1 - 7 files changed, 41 deletions(-) delete mode 100644 requirements/azure.txt delete mode 100644 requirements/dev.txt delete mode 100644 requirements/docs.txt delete mode 100644 requirements/gcs.txt delete mode 100644 requirements/github.txt delete mode 100644 requirements/hdfs.txt delete mode 100644 requirements/s3.txt diff --git a/requirements/azure.txt b/requirements/azure.txt deleted file mode 100644 index 59ef020e..00000000 --- a/requirements/azure.txt +++ /dev/null @@ -1,6 +0,0 @@ -# newer versions require changes to authentication -# see https://github.com/nteract/papermill/issues/825 -azure-datalake-store >= 0.0.30,<1.0.0a0 -azure-storage-blob >= 12.1.0 -requests >= 2.21.0 -azure-identity>=1.3.1 diff --git a/requirements/dev.txt b/requirements/dev.txt deleted file mode 100644 index f1c4882d..00000000 --- a/requirements/dev.txt +++ /dev/null @@ -1,24 +0,0 @@ -boto3 -botocore -codecov -coverage -google_compute_engine # Need this because boto has issues with dynamic package loading during tests if other google components are there -# newer versions of ipython have different imports and require refactoring -ipython>=5.0,<9.0.0 -ipywidgets -notebook -moto >= 5.0.0,<5.1.0 -pytest>=4.1 -pytest-cov>=2.6.1 -pytest-mock>=1.10 -pytest-env>=0.6.2 -requests >= 2.21.0 -check-manifest -attrs>=17.4.0 -pre-commit -tox -bumpversion -recommonmark -pip>=18.1 -wheel>=0.31.0 -twine>=1.11.0 diff --git a/requirements/docs.txt b/requirements/docs.txt deleted file mode 100644 index c4fa860e..00000000 --- a/requirements/docs.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Pin packages for RTD builds -# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html#pinning-dependencies -Sphinx>=7.2.6 -furo>=2023.9.10 -myst-parser>=2.0.0 -moto>=4.2.8 -sphinx-copybutton>=0.5.2 diff --git a/requirements/gcs.txt b/requirements/gcs.txt deleted file mode 100644 index 8db67662..00000000 --- a/requirements/gcs.txt +++ /dev/null @@ -1 +0,0 @@ -gcsfs>=0.2.0 diff --git a/requirements/github.txt b/requirements/github.txt deleted file mode 100644 index 75bfade9..00000000 --- a/requirements/github.txt +++ /dev/null @@ -1 +0,0 @@ -PyGithub >= 1.55 diff --git a/requirements/hdfs.txt b/requirements/hdfs.txt deleted file mode 100644 index fa262689..00000000 --- a/requirements/hdfs.txt +++ /dev/null @@ -1 +0,0 @@ -pyarrow >= 2.0 diff --git a/requirements/s3.txt b/requirements/s3.txt deleted file mode 100644 index 30ddf823..00000000 --- a/requirements/s3.txt +++ /dev/null @@ -1 +0,0 @@ -boto3 From 35e5a7aa5405c94879b4da0ac454fd62676a0897 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 11:17:39 -0800 Subject: [PATCH 23/32] remove manifest and check-manifest --- .github/workflows/ci.yml | 2 +- MANIFEST.in | 37 -------------------- pyproject.toml | 73 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 38 deletions(-) delete mode 100644 MANIFEST.in diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eea6bef2..ae841666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - toxenv: ["manifest", "docs", "binder"] + toxenv: ["docs", "binder"] env: TOXENV: ${{ matrix.toxenv }} steps: diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 6bfa1187..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,37 +0,0 @@ -recursive-include papermill *.py -recursive-include papermill *.ipynb -recursive-include papermill *.json -recursive-include papermill *.yaml -recursive-include papermill *.yml -recursive-include papermill *.keep -recursive-include papermill *.txt - -include requirements.txt -include tox.ini -include pytest.ini -include README.md -include LICENSE -include MANIFEST.in -include *.md -include *.toml -include *.in -include *.txt -recursive-include requirements *.txt - -# Documentation -prune docs - -exclude .pre-commit-config.yaml -# exclude sample notebooks for binder -prune binder -# Scripts -graft scripts -# Test env -prune .tox -# Exclude notebooks checkpoints generated by testing -recursive-exclude papermill/.ipynb_checkpoints *.ipynb -recursive-exclude papermill/tests/notebooks/.ipynb_checkpoints *.ipynb - -# Build files -exclude .github -exclude .readthedocs.yaml diff --git a/pyproject.toml b/pyproject.toml index 00561780..36aaaeab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,9 +152,13 @@ version.source = "vcs" build.hooks.vcs.version-file = "papermill/version.py" [tool.hatch.build.targets.sdist] +ignore-vcs = true include = [ "/papermill", ] +exclude = [ + "binder/*", +] [tool.black] @@ -228,3 +232,72 @@ format.quote-style = "preserve" [tool.ruff.lint.pydocstyle] # Use Google-style docstrings. convention = "google" + +[tool.tox] +legacy_tox_ini = """ +[tox] +skipsdist = true +envlist = py{310,311,312,313}, dist, manifest, docs, binder + +[gh-actions] +python = + 3.10: py310 + 3.11: py311 + 3.12: py312 + 3.13: py313, docs, dist + +# Manifest +[testenv:manifest] +skip_install = true +deps = check-manifest +commands = check-manifest +ignore = + .readthedocs.yaml + +# Docs +[testenv:docs] +description = invoke sphinx-build to build the HTML docs +deps = + .[docs] +extras = docs +commands = + sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs} + python -c 'import pathlib; print("documentation available under file://\\{0\\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))' + +# Binder +[testenv:binder] +description = ensure /binder/*ipynb are runnable +deps = + -r binder/requirements.txt +commands = python -c "import glob; import papermill as pm; [pm.execute_notebook(input, '{toxworkdir}/out.ipynb', parameters=\\{'binder_dir':'binder'\\}) for input in glob.glob('binder/**/*.ipynb')]" + +# Distro +[testenv:dist] +skip_install = true +deps = build +commands = + python -m build --outdir {distdir} + /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.tar.gz' + /bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/papermill*.whl' + +[testenv] +# disable Python's hash randomization for tests that stringify dicts, etc +setenv = + PYTHONHASHSEED = 0 + AWS_ACCESS_KEY_ID=foobar_key + AWS_SECRET_ACCESS_KEY=foobar_secret +passenv = * +basepython = + py310: python3.10 + py311: python3.11 + py312: python3.12 + py313: python3.13 + manifest: python3.13 + dist: python3.13 + docs: python3.13 + binder: python3.13 +deps = .[dev] +# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line... +allowlist_externals = /bin/bash +commands = pytest -v --maxfail=2 --cov=papermill -W always {posargs} +""" From 45f390455a2907fe36573fc1a3b5d2f90be6b28b Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 11:22:48 -0800 Subject: [PATCH 24/32] Remove unneeded doc note --- docs/extending-entry-points.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/extending-entry-points.rst b/docs/extending-entry-points.rst index ab71829b..9da81170 100644 --- a/docs/extending-entry-points.rst +++ b/docs/extending-entry-points.rst @@ -1,9 +1,6 @@ Extending papermill through entry points ======================================== -*Note: setuptools is no longer used in this project. This document should be -updated to reflect the use of pyproject.toml and other modern packaging tools.* - What are entry points? ---------------------- From 9230e54cd4fbaed06e8c76a136950bc7d0042565 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 11:23:22 -0800 Subject: [PATCH 25/32] remove manifest from pyproject --- pyproject.toml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 36aaaeab..e4479857 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -237,7 +237,7 @@ convention = "google" legacy_tox_ini = """ [tox] skipsdist = true -envlist = py{310,311,312,313}, dist, manifest, docs, binder +envlist = py{310,311,312,313}, dist, docs, binder [gh-actions] python = @@ -246,14 +246,6 @@ python = 3.12: py312 3.13: py313, docs, dist -# Manifest -[testenv:manifest] -skip_install = true -deps = check-manifest -commands = check-manifest -ignore = - .readthedocs.yaml - # Docs [testenv:docs] description = invoke sphinx-build to build the HTML docs @@ -292,7 +284,6 @@ basepython = py311: python3.11 py312: python3.12 py313: python3.13 - manifest: python3.13 dist: python3.13 docs: python3.13 binder: python3.13 From 7d0fcdad0a82c12f8069b0aef28232fd730f00ce Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 11:28:07 -0800 Subject: [PATCH 26/32] add azure to docs for tox --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e4479857..d883292c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -250,7 +250,7 @@ python = [testenv:docs] description = invoke sphinx-build to build the HTML docs deps = - .[docs] + .[docs,azure] extras = docs commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs} From 025ae5cc32954d5b310b6893039dacb955cb3558 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 12:34:25 -0800 Subject: [PATCH 27/32] Update binder tox config --- pyproject.toml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d883292c..d983d79d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ dependencies = [ [project.optional-dependencies] all = [ - "papermill[azure,dev,docs,gcs,github,hdfs,s3,test]" + "papermill[azure,binder,dev,docs,gcs,github,hdfs,s3,test]" ] azure = [ "azure-datalake-store >= 0.0.30,<1.0.0a0", # newer versions require auth changes see https://github.com/nteract/papermill/issues/825 @@ -52,6 +52,13 @@ azure = [ "azure-storage-blob >= 12.1.0", "requests >= 2.21.0", ] +binder = [ + "nteract-scrapbook", + "pandas", + "matplotlib", + "ipywidgets", + "ipykernel", +] dev = [ "attrs>=17.4.0", "azure-datalake-store >= 0.0.30,<1.0.0a0", @@ -110,7 +117,6 @@ test = [ "azure-storage-blob >= 12.1.0", "black >= 19.3b0", "boto3", - "boto3", "botocore", "check-manifest", "codecov", @@ -131,7 +137,6 @@ test = [ "pytest>=4.1", "recommonmark", "requests >= 2.21.0", - "requests >= 2.21.0", "tox", "twine>=1.11.0", "wheel>=0.31.0", @@ -259,9 +264,11 @@ commands = # Binder [testenv:binder] description = ensure /binder/*ipynb are runnable -deps = - -r binder/requirements.txt -commands = python -c "import glob; import papermill as pm; [pm.execute_notebook(input, '{toxworkdir}/out.ipynb', parameters=\\{'binder_dir':'binder'\\}) for input in glob.glob('binder/**/*.ipynb')]" +extras = binder +changedir = binder +commands = + python -m ipykernel install --user --name=python3 + python -c "import papermill as pm; pm.execute_notebook('cli-simple/simple_input.ipynb', '{toxworkdir}/out.ipynb', parameters=\\{'msg': 'test'\\})" # Distro [testenv:dist] From 205e9c978ff8a6ec97a29bb2fec4b55e8bc2e8a2 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 12:44:36 -0800 Subject: [PATCH 28/32] Update pyproject.toml all deps Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d983d79d..8fc5a02a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ dependencies = [ [project.optional-dependencies] all = [ - "papermill[azure,binder,dev,docs,gcs,github,hdfs,s3,test]" + "papermill[azure,binder,gcs,github,hdfs,s3]" ] azure = [ "azure-datalake-store >= 0.0.30,<1.0.0a0", # newer versions require auth changes see https://github.com/nteract/papermill/issues/825 From 3c36817849f310b4703982bf193f698d9cc3d234 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 12:46:33 -0800 Subject: [PATCH 29/32] Update pyproject.toml to order classifiers Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8fc5a02a..9d152648 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ "Intended Audience :: System Administrators", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "aiohttp >=3.9.0; python_version==\"3.12\"", From 584680a336424757492f69914caf862b375ca676 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 12:47:40 -0800 Subject: [PATCH 30/32] Update pyproject.toml with style for spacing Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9d152648..9da62bf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] dependencies = [ - "aiohttp >=3.9.0; python_version==\"3.12\"", + "aiohttp >=3.9.0; python_version == \"3.12\"", "click", "entrypoints", "nbclient >= 0.2.0", From 710cccf1841e3df3e8634e68cd423b0e80b05b8e Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 15 Nov 2025 12:53:51 -0800 Subject: [PATCH 31/32] Update pyproject.toml ignore-vcs for sdist Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9da62bf0..6485b892 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,7 +157,6 @@ version.source = "vcs" build.hooks.vcs.version-file = "papermill/version.py" [tool.hatch.build.targets.sdist] -ignore-vcs = true include = [ "/papermill", ] From 73aaa13114f30354bcff0da392f65b9a271721f6 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 17 Nov 2025 06:42:11 -0600 Subject: [PATCH 32/32] Update pyproject.toml embedded quotes Co-authored-by: Ofek Lev --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6485b892..c9f56813 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] dependencies = [ - "aiohttp >=3.9.0; python_version == \"3.12\"", + "aiohttp >=3.9.0; python_version == '3.12'", "click", "entrypoints", "nbclient >= 0.2.0",