Skip to content

Commit

Permalink
Merge 085285b into 8917d24
Browse files Browse the repository at this point in the history
  • Loading branch information
slobodan-ilic committed Jan 15, 2019
2 parents 8917d24 + 085285b commit 09dfc72
Show file tree
Hide file tree
Showing 31 changed files with 5,150 additions and 3,710 deletions.
29 changes: 29 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Recommended flake8 settings while editing crunch-cube, we use Black for the final linting/say in how code is formatted
#
# pip install flake8 flake8-bugbear
#
# This will warn/error on things that black does not fix, on purpose.

[flake8]
# max line length is set to 88 in black, here it is set to 80 and we enable bugbear's B950 warning, which is:
#
# B950: Line too long. This is a pragmatic equivalent of pycodestyle’s E501: it
# considers “max-line-length” but only triggers when the value has been
# exceeded by more than 10%. You will no longer be forced to reformat code due
# to the closing parenthesis being one character too far to satisfy the linter.
# At the same time, if you do significantly violate the line length, you will
# receive a message that states what the actual limit is. This is inspired by
# Raymond Hettinger’s “Beyond PEP 8” talk and highway patrol not stopping you
# if you drive < 5mph too fast. Disable E501 to avoid duplicate warnings.
max-line-length = 80
max-complexity = 12
select = E,F,W,C,B,B9
ignore =
# E123 closing bracket does not match indentation of opening bracket’s line
E123
# E203 whitespace before ‘:’ (Not PEP8 compliant, Python Black)
E203
# E501 line too long (82 > 79 characters) (replaced by B950 from flake8-bugbear, https://github.com/PyCQA/flake8-bugbear)
E501
# W503 line break before binary operator (Not PEP8 compliant, Python Black)
W503
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0-1
hooks:
- id: flake8
- id: end-of-file-fixer
- id: trailing-whitespace
- id: autopep8-wrapper

- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3.6
61 changes: 30 additions & 31 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,41 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
# 'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
"sphinx.ext.todo",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
# 'sphinx.ext.githubpages'
# 'sphinxcontrib.napoleon'
]

# 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', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

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

# General information about the project.
project = u'Crunch Cube'
copyright = u'2017, Crunch.io'
author = u'Crunch.io'
project = u"Crunch Cube"
copyright = u"2017, Crunch.io"
author = u"Crunch.io"

# 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.
version = u'1.0'
version = u"1.0"
# The full version, including alpha/beta/rc tags.
release = u'1.0'
release = u"1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -80,7 +80,7 @@
exclude_patterns = []

# 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 = True
Expand All @@ -91,9 +91,9 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'bizstyle'
html_theme = "bizstyle"

html_logo = '_static/crunch_logo.png'
html_logo = "_static/crunch_logo.png"

# 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 @@ -104,7 +104,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"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -116,7 +116,7 @@
# -- Options for HTMLHelp output ------------------------------------------

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


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -125,15 +125,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 @@ -143,19 +140,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'CrunchCube.tex', u'Crunch Cube Documentation',
u'Crunch.io', 'manual'),
(master_doc, "CrunchCube.tex", u"Crunch Cube Documentation", u"Crunch.io", "manual")
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'crunchcube', u'Crunch Cube Documentation',
[author], 1)
]
man_pages = [(master_doc, "crunchcube", u"Crunch Cube Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -164,11 +157,17 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'CrunchCube', u'Crunch Cube Documentation',
author, 'CrunchCube', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"CrunchCube",
u"Crunch Cube Documentation",
author,
"CrunchCube",
"One line description of project.",
"Miscellaneous",
)
]


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}
37 changes: 14 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,40 @@ def ascii_bytes_from(path, *paths):

# read required text from files
thisdir = os.path.dirname(__file__)
init_py = ascii_bytes_from(thisdir, 'src', 'cr', 'cube', '__init__.py')
readme = ascii_bytes_from(thisdir, 'README.md')
init_py = ascii_bytes_from(thisdir, "src", "cr", "cube", "__init__.py")
readme = ascii_bytes_from(thisdir, "README.md")

# Read the version from cr.cube.__version__ without importing the package
# (and thus attempting to import packages it depends on that may not be
# installed yet). This allows users to check installed version with
# `python -c 'from cr.cube import __version__; print(__version__)`
version = re.search("__version__ = '([^']+)'", init_py).group(1)
version = re.search('__version__ = "([^"]+)"', init_py).group(1)

install_requires = [
'scipy',
'tabulate',
]
install_requires = ["scipy", "tabulate"]

test_requires = [
'pytest',
'pytest-cov',
'mock',
]
test_requires = ["pytest", "pytest-cov", "mock"]

setup(
name='cr.cube',
name="cr.cube",
version=version,
description="Crunch.io Cube library",
long_description=readme,
long_description_content_type="text/markdown",
url='https://github.com/Crunch-io/crunch-cube/',
url="https://github.com/Crunch-io/crunch-cube/",
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
author='Crunch.io',
author_email='dev@crunch.io',
license='MIT License',
author="Crunch.io",
author_email="dev@crunch.io",
license="MIT License",
install_requires=install_requires,
tests_require=test_requires,
extras_require={
'testing': test_requires,
},
packages=find_packages('src', exclude=['tests']),
package_dir={'': 'src'},
extras_require={"testing": test_requires},
packages=find_packages("src", exclude=["tests"]),
package_dir={"": "src"},
include_package_data=True,
entry_points={},
namespace_packages=['cr'],
namespace_packages=["cr"],
zip_safe=True,
)
3 changes: 2 additions & 1 deletion src/cr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try: # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
except ImportError: # pragma: no cover
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion src/cr/cube/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

"""Initialization module for crunch-cube package."""

__version__ = '1.8.6'
__version__ = "1.8.6"
Loading

0 comments on commit 09dfc72

Please sign in to comment.