Skip to content

Commit

Permalink
Fade to Black
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jun 16, 2018
1 parent 981c170 commit fe591a6
Show file tree
Hide file tree
Showing 19 changed files with 351 additions and 235 deletions.
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/ambv/black
rev: 18.6b2
hooks:
- id: black
language_version: python3.6
- repo: https://github.com/asottile/seed-isort-config
rev: v1.0.1
hooks:
- id: seed-isort-config
language_version: python3.6
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
language_version: python3.6
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include *.rst *.txt tox.ini .coveragerc LICENSE
include *.rst *.txt tox.ini .coveragerc LICENSE .pre-commit-config.yaml pyproject.toml
exclude src/argon2/_ffi.py .gitmodules extras/libargon2/.git appveyor.yml .readthedocs.yml .travis.yml
graft tests
graft .github
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ CFFI-based Argon2 Bindings for Python
:target: https://www.irccloud.com/invite?channel=%23cryptography-dev&hostname=irc.freenode.net&port=6697&ssl=1
:alt: IRC

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: Code style: black

.. teaser-begin
`Argon2 <https://github.com/p-h-c/phc-winner-argon2>`_ won the `Password Hashing Competition <https://password-hashing.net/>`_ and ``argon2_cffi`` is the simplest way to use it in Python and PyPy:
Expand Down
65 changes: 39 additions & 26 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def find_version(*file_paths):
string inside.
"""
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
Expand All @@ -56,28 +57,28 @@ def find_version(*file_paths):
# ones.

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
]

# 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 = u'argon2_cffi'
project = u"argon2_cffi"
year = datetime.date.today().year
copyright = u'2015, Hynek Schlawack'
copyright = u"2015, Hynek Schlawack"

# 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 @@ -100,7 +101,7 @@ def find_version(*file_paths):

# List of patterns, relative to source directory, that match files and
# directories to ignore 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.
Expand All @@ -118,7 +119,7 @@ def find_version(*file_paths):
# 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 Down Expand Up @@ -216,18 +217,16 @@ def find_version(*file_paths):
# html_file_suffix = None

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


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

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

# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
Expand All @@ -236,8 +235,13 @@ def find_version(*file_paths):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'argon2_cffi.tex', u'argon2_cffi Documentation',
u'Hynek Schlawack', 'manual'),
(
"index",
"argon2_cffi.tex",
u"argon2_cffi Documentation",
u"Hynek Schlawack",
"manual",
)
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -266,8 +270,13 @@ def find_version(*file_paths):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'argon2_cffi', u'argon2_cffi Documentation',
[u'Hynek Schlawack'], 1)
(
"index",
"argon2_cffi",
u"argon2_cffi Documentation",
[u"Hynek Schlawack"],
1,
)
]

# If true, show URL addresses after external links.
Expand All @@ -280,9 +289,15 @@ def find_version(*file_paths):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'argon2_cffi', u'argon2_cffi Documentation',
u'Hynek Schlawack', 'argon2_cffi',
'One line description of project.', 'Miscellaneous'),
(
"index",
"argon2_cffi",
u"argon2_cffi Documentation",
u"Hynek Schlawack",
"argon2_cffi",
"One line description of project.",
"Miscellaneous",
)
]

# Documents to append as an appendix to all manuals.
Expand All @@ -299,6 +314,4 @@ def find_version(*file_paths):


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"https://docs.python.org/3": None,
}
intersphinx_mapping = {"https://docs.python.org/3": None}
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.black]
line-length = 79
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ ignore =
# Ambiguous variable names
# Ignored, since there is an enum value "I" for the algorithm type Argon2I
E741
# Not an actual PEP8 violation
W503


[isort]
atomic=true
include_trailing_comma=true
lines_after_imports=2
lines_between_types=1
multi_line_output=5
multi_line_output=3
not_skip=__init__.py

known_first_party=argon2
known_third_party=argon2,cffi,hypothesis,pytest,setuptools,six
Loading

0 comments on commit fe591a6

Please sign in to comment.