-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #474 from jarrodmillman/pyproject.toml
Use pyproject.toml
- Loading branch information
Showing
9 changed files
with
235 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
branch = True | ||
source = numpydoc | ||
omit = | ||
*/setup.py | ||
numpydoc/tests/* | ||
numpydoc/templates/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
################################################################################ | ||
# DO NOT EDIT | ||
# AUTOGENERATED BY | ||
# | ||
# $ python tools/generate_pyproject.toml.py | ||
# | ||
# EDIT tools/pyproject.toml.in AND RUN THAT SCRIPT. | ||
# | ||
################################################################################ | ||
|
||
[build-system] | ||
build-backend = 'setuptools.build_meta' | ||
requires = ['setuptools>=61.2'] | ||
|
||
[project] | ||
name = 'numpydoc' | ||
description = 'Sphinx extension to support docstrings in Numpy format' | ||
readme = 'README.rst' | ||
requires-python = '>=3.8' | ||
dynamic = ['version'] | ||
keywords = [ | ||
'sphinx', | ||
'numpy', | ||
] | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Plugins', | ||
'License :: OSI Approved :: BSD License', | ||
'Topic :: Documentation', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
] | ||
dependencies = [ | ||
'sphinx>=5', | ||
'Jinja2>=2.10', | ||
'tabulate>=0.8.10', | ||
"tomli>=1.1.0;python_version<'3.11'", | ||
] | ||
|
||
[[project.authors]] | ||
name = 'Pauli Virtanen and others' | ||
email = 'pav@iki.fi' | ||
|
||
[project.license] | ||
file = 'LICENSE.txt' | ||
|
||
[project.urls] | ||
Homepage = 'https://numpydoc.readthedocs.io' | ||
|
||
[project.optional-dependencies] | ||
doc = [ | ||
'numpy>=1.22', | ||
'matplotlib>=3.5', | ||
'pydata-sphinx-theme>=0.13', | ||
'sphinx>=6', | ||
] | ||
test = [ | ||
'pytest', | ||
'pytest-cov', | ||
'matplotlib', | ||
] | ||
|
||
[project.scripts] | ||
validate-docstrings = 'numpydoc.hooks.validate_docstrings:main' | ||
[tool.setuptools] | ||
include-package-data = false | ||
packages = [ | ||
'numpydoc', | ||
'numpydoc.hooks', | ||
] | ||
|
||
[tool.setuptools.package-data] | ||
numpydoc = [ | ||
'tests/test_*.py', | ||
'tests/tinybuild/Makefile', | ||
'tests/tinybuild/index.rst', | ||
'tests/tinybuild/*.py', | ||
'templates/*.rst', | ||
] | ||
[tool.pytest.ini_options] | ||
addopts = ''' | ||
--showlocals --doctest-modules -ra --cov-report= --cov=numpydoc | ||
--junit-xml=junit-results.xml --ignore=doc/ --ignore=tools/''' | ||
junit_family = 'xunit2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pre-commit>=3.3 | ||
rtoml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
|
||
try: | ||
import rtoml as toml | ||
except ImportError: | ||
print("Please install `rtoml` first: `pip install rtoml`") | ||
sys.exit(1) | ||
|
||
|
||
if not os.path.isfile("pyproject.toml"): | ||
print("Please run this script from the skimage repository root:") | ||
print(" python tools/generate_pyproject.toml.py") | ||
sys.exit(1) | ||
|
||
|
||
def parse_requirements_file(filename): | ||
with open(filename) as fid: | ||
requires = [l.strip() for l in fid.readlines() if not l.startswith("#")] | ||
requires = [l for l in requires if l] | ||
|
||
return requires | ||
|
||
|
||
with open("tools/pyproject.toml.in") as f: | ||
pyproject = toml.load(f) | ||
|
||
# pyproject['project']['dependencies'] = \ | ||
# parse_requirements_file("requirements/default.txt") | ||
|
||
pyproject["project"]["optional-dependencies"] = { | ||
dep: parse_requirements_file(f"requirements/{dep}.txt") for dep in ["doc", "test"] | ||
} | ||
|
||
banner = f"""\ | ||
{"#" * 80} | ||
# DO NOT EDIT | ||
# AUTOGENERATED BY | ||
# | ||
# $ python tools/generate_pyproject.toml.py | ||
# | ||
# EDIT tools/pyproject.toml.in AND RUN THAT SCRIPT. | ||
# | ||
{"#" * 80} | ||
""" | ||
|
||
with open("pyproject.toml", "w") as f: | ||
f.write(banner) | ||
toml.dump(pyproject, f, pretty=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=61.2", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "numpydoc" | ||
description = "Sphinx extension to support docstrings in Numpy format" | ||
license = {file = "LICENSE.txt"} | ||
dynamic = ['version'] | ||
keywords = [ | ||
"sphinx", | ||
"numpy", | ||
] | ||
readme = "README.rst" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Plugins", | ||
"License :: OSI Approved :: BSD License", | ||
"Topic :: Documentation", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"sphinx>=5", | ||
"Jinja2>=2.10", | ||
"tabulate>=0.8.10", | ||
"tomli>=1.1.0;python_version<'3.11'", | ||
] | ||
|
||
[[project.authors]] | ||
name = "Pauli Virtanen and others" | ||
email = "pav@iki.fi" | ||
|
||
[project.urls] | ||
Homepage = "https://numpydoc.readthedocs.io" | ||
|
||
[project.optional-dependencies] | ||
|
||
[project.scripts] | ||
validate-docstrings = "numpydoc.hooks.validate_docstrings:main" | ||
|
||
[tool.setuptools] | ||
packages = [ | ||
"numpydoc", | ||
"numpydoc.hooks", | ||
] | ||
include-package-data = false | ||
|
||
[tool.setuptools.package-data] | ||
numpydoc = [ | ||
"tests/test_*.py", | ||
"tests/tinybuild/Makefile", | ||
"tests/tinybuild/index.rst", | ||
"tests/tinybuild/*.py", | ||
"templates/*.rst", | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--showlocals --doctest-modules -ra --cov-report= --cov=numpydoc\n--junit-xml=junit-results.xml --ignore=doc/ --ignore=tools/" | ||
junit_family = "xunit2" |