Skip to content
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

Enable black #75

Merged
merged 1 commit into from
Oct 11, 2022
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
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ repos:
- id: requirements-txt-fixer
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions demo/demo_colorer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# encoding: utf-8

from tendo import colorer # noqa
from tendo import colorer # noqa

if __name__ == '__main__':
if __name__ == "__main__":
import logging

logging.getLogger().setLevel(logging.NOTSET)
Expand Down
47 changes: 27 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@
import inspect
import os
import sys
cmd_folder = os.path.realpath(os.path.join(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]), ".."))

cmd_folder = os.path.realpath(
os.path.join(
os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]), ".."
)
)
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from tendo import __version__ # noqa:E402

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# -- General configuration -----------------------------------------------------

Expand All @@ -31,23 +36,29 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]

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

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

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

# General information about the project.
project = 'tendo'
copyright = '2010-2013, Sorin Sbarnea'
project = "tendo"
copyright = "2010-2013, Sorin Sbarnea"

# 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 @@ -72,7 +83,7 @@

# List of patterns, relative to source directory, that match files and
# directories to igno`re when looking for source files.
exclude_patterns = ['build']
exclude_patterns = ["build"]

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
Expand All @@ -89,7 +100,7 @@
# show_authors = False

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

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -99,7 +110,7 @@

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

# 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 Down Expand Up @@ -128,7 +139,7 @@
# 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"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -172,7 +183,7 @@
# html_file_suffix = None

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


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -186,8 +197,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'tendo.tex', 'tendo Documentation',
'Sorin Sbarnea', 'manual'),
("index", "tendo.tex", "tendo Documentation", "Sorin Sbarnea", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -218,11 +228,8 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'tendo', 'tendo Documentation',
['Sorin Sbârnea'], 1)
]
man_pages = [("index", "tendo", "tendo Documentation", ["Sorin Sbârnea"], 1)]


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {"http://docs.python.org/": None}
7 changes: 4 additions & 3 deletions docs/make.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
import os
if 'PYTHONPATH' in os.environ:
os.environ['PYTHONPATH'] = "..:" + os.environ['PYTHONPATH']

if "PYTHONPATH" in os.environ:
os.environ["PYTHONPATH"] = "..:" + os.environ["PYTHONPATH"]
else:
os.environ['PYTHONPATH'] = ".."
os.environ["PYTHONPATH"] = ".."
os.system("make html")
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ upload-dir = docs/build/html
[flake8]
enable-extensions = H106,H203,H204,H205,H210,H904
exclude = __pycache__,build,src,.tox
ignore = D
ignore =
D
W503 # black conflict
max-line-length=1024
11 changes: 9 additions & 2 deletions src/tendo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@
__copyright__ = "Copyright 2010-2022, Sorin Sbarnea"
__email__ = "sorin.sbarnea@gmail.com"
__status__ = "Production"
__all__ = ('tee', 'colorer', 'unicode',
'execfile2', 'singleton', 'ansiterm', '__version__')
__all__ = (
"tee",
"colorer",
"unicode",
"execfile2",
"singleton",
"ansiterm",
"__version__",
)


if sys.hexversion < 0x03080000:
Expand Down
Loading