diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b0bfe0a4..9ae087f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,3 +47,13 @@ repos: - id: ruff-check # Run the formatter. - id: ruff-format + + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.6.0 + hooks: + - id: pyproject-fmt + additional_dependencies: [tox] + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.24.1 + hooks: + - id: validate-pyproject diff --git a/pyproject.toml b/pyproject.toml index 57cb957c..99336a0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,187 +1,192 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" +requires = [ "setuptools>=61", "wheel" ] + [project] name = "papermill" -dynamic = ["version"] description = "Parameterize and run Jupyter and nteract Notebooks" readme = "README.md" -license = {text = "BSD"} +keywords = [ "jupyter", "mapreduce", "notebook", "nteract", "pipeline" ] +license = { text = "BSD" } authors = [ - {name = "nteract contributors", email = "nteract@googlegroups.com"} + { name = "nteract contributors", email = "nteract@googlegroups.com" }, ] -keywords = ["jupyter", "mapreduce", "nteract", "pipeline", "notebook"] +requires-python = ">=3.10" 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", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.10" +dynamic = [ "version" ] dependencies = [ - "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'", + "aiohttp>=3.9; python_version=='3.12'", + "click", + "entrypoints", + "nbclient>=0.2", + "nbformat>=5.2", + "pyyaml", + "requests", + "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", +optional-dependencies.all = [ + "azure-datalake-store>=0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob>=12.1", + "black>=19.3b0", + "boto3", + "gcsfs>=0.2", + "pyarrow>=2", + "pygithub>=1.55", + "requests>=2.21", ] -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", - "azure-identity>=1.3.1", - "gcsfs>=0.2.0", - "pyarrow>=2.0", - "PyGithub>=1.55", - "black>=19.3b0", +optional-dependencies.azure = [ + "azure-datalake-store>=0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob>=12.1", + "requests>=2.21", ] -dev = [ - "boto3", - "botocore", - "codecov", - "coverage", - "google_compute_engine", - "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", - "setuptools>=38.6.0", - "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", +optional-dependencies.black = [ "black>=19.3b0" ] +optional-dependencies.dev = [ + "attrs>=17.4", + "azure-datalake-store>=0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob>=12.1", + "black>=19.3b0", + "boto3", + "botocore", + "bumpversion", + "check-manifest", + "codecov", + "coverage", + "gcsfs>=0.2", + "google-compute-engine", + "ipython>=5,<9", + "ipywidgets", + "moto>=5,<5.1", + "notebook", + "pip>=18.1", + "pre-commit", + "pyarrow>=2", + "pygithub>=1.55", + "pytest>=4.1", + "pytest-cov>=2.6.1", + "pytest-env>=0.6.2", + "pytest-mock>=1.10", + "recommonmark", + "requests>=2.21", + "setuptools>=38.6", + "tox", + "twine>=1.11", + "wheel>=0.31", ] -test = [ - "boto3", - "botocore", - "codecov", - "coverage", - "google_compute_engine", - "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", - "setuptools>=38.6.0", - "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", +optional-dependencies.docs = [ + "azure-datalake-store>=0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob>=12.1", + "black>=19.3b0", + "boto3", + "furo>=2023.9.10", + "gcsfs>=0.2", + "moto>=4.2.8", + "myst-parser>=2", + "pyarrow>=2", + "pygithub>=1.55", + "requests>=2.21", + "sphinx>=7.2.6", + "sphinx-copybutton>=0.5.2", ] -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", +optional-dependencies.gcs = [ "gcsfs>=0.2" ] +optional-dependencies.github = [ "pygithub>=1.55" ] +optional-dependencies.hdfs = [ "pyarrow>=2" ] +optional-dependencies.s3 = [ "boto3" ] +optional-dependencies.test = [ + "attrs>=17.4", + "azure-datalake-store>=0.0.30,<1.0.0a0", + "azure-identity>=1.3.1", + "azure-storage-blob>=12.1", + "black>=19.3b0", + "boto3", + "botocore", + "bumpversion", + "check-manifest", + "codecov", + "coverage", + "gcsfs>=0.2", + "google-compute-engine", + "ipython>=5,<9", + "ipywidgets", + "moto>=5,<5.1", + "notebook", + "pip>=18.1", + "pre-commit", + "pyarrow>=2", + "pygithub>=1.55", + "pytest>=4.1", + "pytest-cov>=2.6.1", + "pytest-env>=0.6.2", + "pytest-mock>=1.10", + "recommonmark", + "requests>=2.21", + "setuptools>=38.6", + "tox", + "twine>=1.11", + "wheel>=0.31", ] +urls.Documentation = "https://papermill.readthedocs.io" +urls.Funding = "https://nteract.io" +urls.Source = "https://github.com/nteract/papermill/" +urls.Tracker = "https://github.com/nteract/papermill/issues" +scripts.papermill = "papermill.__main__:papermill" [tool.setuptools] -packages = ["papermill"] +packages = [ "papermill" ] include-package-data = true [tool.setuptools.dynamic] -version = {attr = "papermill.version.version"} +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] +target-version = "py310" +line-length = 120 +# Exclude a variety of commonly ignored directories. +exclude = [ + "docs", +] +format.quote-style = "preserve" -[tool.coverage.run] -branch = false - -[tool.coverage.report] -exclude_lines = [ - "if self.debug:", - "pragma: no cover", - "raise AssertionError", - "raise NotImplementedError", - "if __name__ == .__main__.:", +# Enable Pyflakes `E` and `F` codes by default. +lint.select = [ + "E", + "F", # see: https://pypi.org/project/pyflakes + "I", # isort + "RUF100", # unnecessary noqa comment + "UP", # pyupgrade + "W", # see: https://pypi.org/project/pycodestyle ] -omit = [ - "papermill/tests/*", - "papermill/version.py" +lint.ignore = [ + "E731", # Do not assign a lambda expression, use a def + "Q", # Ignore quotes + "UP032", # Ignore Use f-string instead of `format` call ] - +# Use Google-style docstrings. +lint.pydocstyle.convention = "google" [tool.codespell] quiet-level = 3 @@ -191,50 +196,30 @@ quiet-level = 3 # 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" - [tool.pytest.ini_options] env = [ - "AWS_SECRET_ACCESS_KEY=foobar_secret", - "AWS_ACCESS_KEY_ID=foobar_key", + "AWS_SECRET_ACCESS_KEY=foobar_secret", + "AWS_ACCESS_KEY_ID=foobar_key", ] filterwarnings = [ - "ignore:.*imp module is deprecated.*:DeprecationWarning", + "ignore:.*imp module is deprecated.*:DeprecationWarning", ] -[tool.bumpversion] -current_version = "2.6.0" -commit = true -tag = true -tag_name = "{new_version}" +[tool.coverage.run] +branch = false -[[tool.bumpversion.files]] -filename = "papermill/version.py" +[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.tox] legacy_tox_ini = """ @@ -304,3 +289,12 @@ deps = .[dev] allowlist_externals = /bin/bash commands = pytest -v --maxfail=2 --cov=papermill -W always {posargs} """ + +[tool.bumpversion] +current_version = "2.6.0" +commit = true +tag = true +tag_name = "{new_version}" + +[[tool.bumpversion.files]] +filename = "papermill/version.py"