Skip to content

Fix #201: Reformat source code with black #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Features
* :gh:`187` (:pr:`188`): Added logo for python-semver organization and documentation
* :gh:`191` (:pr:`194`): Created manpage for pysemver
* :gh:`196` (:pr:`197`): Added distribution specific installation instructions

* :gh:`201` (:pr:`202`): Reformatted source code with black

Bug Fixes
---------
Expand Down
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Quickstart

A Python module for `semantic versioning`_. Simplifies comparing versions.

|build-status| |python-support| |downloads| |license| |docs|
|build-status| |python-support| |downloads| |license| |docs| |black|

.. teaser-end

Expand Down Expand Up @@ -125,3 +125,6 @@ There are other functions to discover. Read on!
:target: http://python-semver.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. _semantic versioning: http://semver.org/
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Black Formatter
92 changes: 51 additions & 41 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))

from semver import __version__ # noqa: E402

Expand All @@ -32,27 +33,27 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.extlinks',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.extlinks",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = '.rst'
source_suffix = ".rst"

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

# General information about the project.
project = 'python-semver'
copyright = '2018, Kostiantyn Rybnikov and all'
author = 'Kostiantyn Rybnikov and all'
project = "python-semver"
copyright = "2018, Kostiantyn Rybnikov and all"
author = "Kostiantyn Rybnikov and all"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -73,29 +74,28 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# Markup to shorten external links
# See https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extlinks = {'gh': ('https://github.com/python-semver/python-semver/issues/%s',
'#'),
'pr': ('https://github.com/python-semver/python-semver/pull/%s',
'PR #'),
}
extlinks = {
"gh": ("https://github.com/python-semver/python-semver/issues/%s", "#"),
"pr": ("https://github.com/python-semver/python-semver/pull/%s", "PR #"),
}

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -106,22 +106,22 @@
# 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"]

html_css_files = ['css/default.css']
html_css_files = ["css/default.css"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
"**": [
"about.html",
"navigation.html",
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
"donate.html",
]
}

Expand All @@ -130,7 +130,7 @@
# -- Options for HTMLHelp output ------------------------------------------

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


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -139,15 +139,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 @@ -157,8 +154,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'semver.tex', 'python-semver Documentation',
'Kostiantyn Rybnikov and all', 'manual'),
(
master_doc,
"semver.tex",
"python-semver Documentation",
"Kostiantyn Rybnikov and all",
"manual",
)
]


Expand All @@ -169,11 +171,13 @@
manpage_doc = "pysemver"

man_pages = [
(manpage_doc,
'pysemver',
'Helper script for Semantic Versioning',
["Thomas Schraitle"],
1)
(
manpage_doc,
"pysemver",
"Helper script for Semantic Versioning",
["Thomas Schraitle"],
1,
)
]


Expand All @@ -183,7 +187,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'semver', 'python-semver Documentation',
author, 'semver', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"semver",
"python-semver Documentation",
author,
"semver",
"One line description of project.",
"Miscellaneous",
)
]
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.black]
line-length = 88
target-version = ['py37']
include = '\.pyi?$'
# diff = true
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.mypy_cache
| \.tox
| \.venv
| \.env
| _build
| build
| dist
)/
)
'''
Loading