Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

apply setup-py-upgrade #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ fi
pip install -U pip setuptools wheel

if [ "$CHECK_FORMATTING" = "1" ]; then
pip install black
if ! black --check --diff setup.py exceptiongroup; then
pip install black==20.8b1
if ! black --check --diff setup.py exceptiongroup docs; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Formatting problems were found (listed above). To fix them, run

pip install black
black setup.py exceptiongroup
black setup.py exceptiongroup docs

in your local checkout.

Expand Down
62 changes: 33 additions & 29 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#
import os
import sys

# So autodoc can import our package
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath("../.."))

# Warn about all references to unknown targets
nitpicky = True
Expand All @@ -40,16 +41,16 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinxcontrib_trio',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinxcontrib_trio",
]

intersphinx_mapping = {
"python": ('https://docs.python.org/3', None),
"trio": ('https://trio.readthedocs.io/en/stable', None),
"python": ("https://docs.python.org/3", None),
"trio": ("https://trio.readthedocs.io/en/stable", None),
}

autodoc_member_order = "bysource"
Expand All @@ -61,22 +62,23 @@
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'exceptiongroup'
copyright = 'The exceptiongroup authors'
author = 'The exceptiongroup authors'
project = "exceptiongroup"
copyright = "The exceptiongroup authors"
author = "The exceptiongroup authors"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import exceptiongroup

version = exceptiongroup.__version__
# The full version, including alpha/beta/rc tags.
release = version
Expand All @@ -94,10 +96,10 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# The default language for :: blocks
highlight_language = 'python3'
highlight_language = "python3"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -108,13 +110,14 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
# html_theme = 'alabaster'

# We have to set this ourselves, not only because it's useful for local
# testing, but also because if we don't then RTD will throw away our
# html_theme_options.
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -134,13 +137,13 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'exceptiongroupdoc'
htmlhelp_basename = "exceptiongroupdoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -149,15 +152,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -167,8 +167,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'exceptiongroup.tex', 'Trio Documentation',
author, 'manual'),
(master_doc, "exceptiongroup.tex", "Trio Documentation", author, "manual"),
]


Expand All @@ -177,8 +176,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'exceptiongroup', 'exceptiongroup Documentation',
[author], 1)
(master_doc, "exceptiongroup", "exceptiongroup Documentation", [author], 1)
]


Expand All @@ -188,7 +186,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'exceptiongroup', 'exceptiongroup Documentation',
author, 'exceptiongroup', 'A way to represent multiple things going wrong at the same time, in Python',
'Miscellaneous'),
(
master_doc,
"exceptiongroup",
"exceptiongroup Documentation",
author,
"exceptiongroup",
"A way to represent multiple things going wrong at the same time, in Python",
"Miscellaneous",
),
]
2 changes: 1 addition & 1 deletion exceptiongroup/_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def split(exc_type, exc, *, match=None):
""" splits the exception into one half (matched) representing all the parts of
"""splits the exception into one half (matched) representing all the parts of
the exception that match the predicate, and another half (not matched)
representing all the parts that don't match.

Expand Down
2 changes: 1 addition & 1 deletion exceptiongroup/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file is imported from __init__.py and exec'd from setup.py
# This file is imported from __init__.py and AST-parsed from setuptools

__version__ = "0.0.0"
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools >= 46.4.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.towncrier]
package = "exceptiongroup"
filename = "docs/source/history.rst"
Expand Down
31 changes: 31 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[metadata]
name = exceptiongroup
version = attr: exceptiongroup._version.__version__
description = A way to represent multiple things going wrong at the same time, in Python
url = https://github.com/python-trio/exceptiongroup
long_description = file: README.rst
long_description_content_type = text/x-rst
author = Nathaniel J. Smith
author_email = [email protected]
license = MIT -or- Apache License 2.0
keywords =
async
exceptions
error handling
classifiers =
License :: OSI Approved :: MIT License
License :: OSI Approved :: Apache Software License
Framework :: Trio
Framework :: AsyncIO
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Intended Audience :: Developers

[options]
packages = find:
install_requires = trio
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
install_requires = trio

doesn't seem to be imported

python_requires = >=3.5
34 changes: 2 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
from setuptools import setup, find_packages
from setuptools import setup

exec(open("exceptiongroup/_version.py", encoding="utf-8").read())

LONG_DESC = open("README.rst", encoding="utf-8").read()

setup(
name="exceptiongroup",
version=__version__,
description="A way to represent multiple things going wrong at the same time, in Python",
url="https://github.com/python-trio/exceptiongroup",
long_description=LONG_DESC,
author="Nathaniel J. Smith",
author_email="[email protected]",
license="MIT -or- Apache License 2.0",
packages=find_packages(),
install_requires=["trio"],
keywords=["async", "exceptions", "error handling"],
python_requires=">=3.5",
classifiers=[
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Framework :: Trio",
"Framework :: AsyncIO",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
],
)
setup()