From 0c4b6dd2f5455438c451eff95548fd6df0448932 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Fri, 7 Feb 2020 14:25:52 +0100
Subject: [PATCH] add docs, drop support for Python 2.7

---
 .travis.yml                      | 13 ++++----
 LICENSE.md                       |  3 +-
 docs/Makefile                    | 20 ++++++++++++
 docs/conf.py                     | 55 ++++++++++++++++++++++++++++++++
 docs/index.rst                   | 20 ++++++++++++
 docs/make.bat                    | 35 ++++++++++++++++++++
 firanka/builders.py              |  3 +-
 firanka/exceptions.py            |  3 +-
 firanka/intervals.py             |  8 ++---
 firanka/series/__init__.py       |  3 --
 firanka/series/base.py           |  3 +-
 firanka/series/bundle.py         |  3 +-
 firanka/series/function.py       |  3 +-
 firanka/series/interpolations.py |  3 +-
 firanka/series/modulo.py         |  3 +-
 setup.cfg                        | 14 +++-----
 setup.py                         | 10 ++++--
 17 files changed, 158 insertions(+), 44 deletions(-)
 create mode 100644 docs/Makefile
 create mode 100644 docs/conf.py
 create mode 100644 docs/index.rst
 create mode 100644 docs/make.bat

diff --git a/.travis.yml b/.travis.yml
index 051829f..94f2b51 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,16 @@
 language: python
 python:
- - "2.7"
- - "3.3"
- - "3.4"
  - "3.5"
- - "pypy"
+ - "3.6"
+ - "3.7"
+ - "3.8"
+ - "nightly"
+ - "pypy3"
 install:
  - pip install -r requirements.txt
  - pip install --force-reinstall "coverage>=4.0,<4.4" codeclimate-test-reporter
 script:
- - python setup.py nosetests
+ - python setup.py tests
  - python setup.py sdist bdist bdist_wheel
 after_success:
  - codeclimate-test-reporter
-notifications:
-  slack: digicort:lbgdFcFmWmHtHKDEMI3FwQK5
\ No newline at end of file
diff --git a/LICENSE.md b/LICENSE.md
index 240f2a9..13cc922 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,6 +1,7 @@
 MIT License
 
-Copyright (c) 2017 P.W. DMS s.c.
+Copyright (c) 2017-2018 P.W. DMS s.c.
+Copyright (c) 2018-2020 Piotr Maślanka
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..d4bb2cb
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS    ?=
+SPHINXBUILD   ?= sphinx-build
+SOURCEDIR     = .
+BUILDDIR      = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..d62f2de
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,55 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+# -- Path setup --------------------------------------------------------------
+
+# 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.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+
+# -- Project information -----------------------------------------------------
+
+project = 'firanka'
+copyright = '2018-2020, Piotr Maślanka'
+author = 'Piotr Maślanka'
+
+# The full version, including alpha/beta/rc tags
+release = '0.1.2'
+
+
+# -- General configuration ---------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+
+# -- 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'
+
+# 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']
\ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..a9b6b9d
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,20 @@
+.. firanka documentation master file, created by
+   sphinx-quickstart on Fri Feb  7 14:22:52 2020.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to firanka's documentation!
+===================================
+
+.. toctree::
+   :maxdepth: 2
+   :caption: Contents:
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000..922152e
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,35 @@
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set SOURCEDIR=.
+set BUILDDIR=_build
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+	echo.
+	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+	echo.installed, then set the SPHINXBUILD environment variable to point
+	echo.to the full path of the 'sphinx-build' executable. Alternatively you
+	echo.may add the Sphinx directory to PATH.
+	echo.
+	echo.If you don't have Sphinx installed, grab it from
+	echo.http://sphinx-doc.org/
+	exit /b 1
+)
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+
+:end
+popd
diff --git a/firanka/builders.py b/firanka/builders.py
index e484a7e..c309a1d 100644
--- a/firanka/builders.py
+++ b/firanka/builders.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 import copy
 
diff --git a/firanka/exceptions.py b/firanka/exceptions.py
index bc1ef14..7461397 100644
--- a/firanka/exceptions.py
+++ b/firanka/exceptions.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 __all__ = [
     'FirankaError',
diff --git a/firanka/intervals.py b/firanka/intervals.py
index a1eee1c..36a3acf 100644
--- a/firanka/intervals.py
+++ b/firanka/intervals.py
@@ -1,10 +1,6 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
 
 import math
-
-import six
-
+import functools
 from .exceptions import NotInDomainError
 
 __all__ = [
@@ -15,7 +11,7 @@ __all__ = [
 
 
 def _pre_range(fun):  # for making sure that first argument gets parsed as a Interval
-    @six.wraps(fun)
+    @functools.wraps(fun)
     def inner(self, arg, *args, **kwargs):
         if not isinstance(arg, Interval):
             arg = Interval(arg)
diff --git a/firanka/series/__init__.py b/firanka/series/__init__.py
index 6b9ae3b..7a45f46 100644
--- a/firanka/series/__init__.py
+++ b/firanka/series/__init__.py
@@ -1,6 +1,3 @@
-# coding=UTF-8
-from __future__ import absolute_import
-
 from .base import DiscreteSeries, Series
 from .bundle import SeriesBundle, DiscreteSeriesBundle
 from .function import FunctionSeries
diff --git a/firanka/series/base.py b/firanka/series/base.py
index 9b82918..925e0e7 100644
--- a/firanka/series/base.py
+++ b/firanka/series/base.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 import inspect
 
diff --git a/firanka/series/bundle.py b/firanka/series/bundle.py
index 3890987..ba6c4e4 100644
--- a/firanka/series/bundle.py
+++ b/firanka/series/bundle.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 import functools
 import logging
diff --git a/firanka/series/function.py b/firanka/series/function.py
index 7778afd..c87cff4 100644
--- a/firanka/series/function.py
+++ b/firanka/series/function.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 from .base import Series
 
diff --git a/firanka/series/interpolations.py b/firanka/series/interpolations.py
index 178c0ff..9e3a85b 100644
--- a/firanka/series/interpolations.py
+++ b/firanka/series/interpolations.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 import six
 
diff --git a/firanka/series/modulo.py b/firanka/series/modulo.py
index ccd0b4e..9fce048 100644
--- a/firanka/series/modulo.py
+++ b/firanka/series/modulo.py
@@ -1,5 +1,4 @@
-# coding=UTF-8
-from __future__ import print_function, absolute_import, division
+
 
 import math
 
diff --git a/setup.cfg b/setup.cfg
index 1a5c265..657936d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,10 +3,11 @@ description-file = README.md
 license = MIT License
 classifiers =
     Programming Language :: Python
-    Programming Language :: Python :: 2.7
-    Programming Language :: Python :: 3.3
-    Programming Language :: Python :: 3.4
     Programming Language :: Python :: 3.5
+    Programming Language :: Python :: 3.6
+    Programming Language :: Python :: 3.7
+    Programming Language :: Python :: 3.8
+    Programming Language :: Python :: 3.9
     Programming Language :: Python :: Implementation :: CPython
     Programming Language :: Python :: Implementation :: PyPy
     Operating System :: OS Independent
@@ -27,10 +28,3 @@ universal=1
 verbosity=1
 detailed-errors=1
 with-coverage=1
-
-[isort]
-add_imports =
-    from __future__ import absolute_import
-    from __future__ import division
-    from __future__ import print_function
-    from __future__ import unicode_literals
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 8f1e34b..4ad015c 100644
--- a/setup.py
+++ b/setup.py
@@ -7,10 +7,14 @@ setup(
     name='firanka',
     version=__version__,
     packages=find_packages(exclude=['tests.*', 'tests']),
-    tests_require=["nose", 'coverage>=4.0,<4.4'],
     install_requires=open('requirements.txt', 'r').readlines(),
-    test_suite='nose.collector',
     url='https://github.com/smok-serwis/firanka',
     author=u'Piotr Maślanka',
-    author_email=u'piotrm@dms-serwis.com.pl',
+    author_email=u'pmaslanka@smok.co',
+    tests_require=[
+        "nose2", "mock", "coverage", "nose2[coverage_plugin]"
+    ],
+    test_suite='nose2.collector.collector',
+    python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
+
 )
-- 
GitLab