diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..3be1877384b9d21f9eb8ca051242fc977e5f8c25 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,28 @@ +version: 2.1 + +orbs: + python: circleci/python@0.2.1 + +jobs: + build-and-test: + executor: python/default + steps: + - checkout + - python/load-cache + - python/install-deps + - python/save-cache + - run: + command: | + pip install satella snakehouse + python setup.py install + pip install pytest-xdist pytest-cov pytest pytest-forked pluggy py mock + name: Install necessary modules + - run: + command: | + pytest + name: Test + +workflows: + main: + jobs: + - build-and-test diff --git a/.gitignore b/.gitignore index b6e47617de110dea7ca47e087ff1347cc2646eda..626a3d1a702e6fe01eff924adf63de3592a9bb75 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +docs/_build # PyInstaller # Usually these files are written by a python script from a template diff --git a/README.md b/README.md index 50e3bd5c1dc9a3a58f60e2c6bc5f86e020c219a8..53220703ad329204a79517286c53612f73859f53 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# temps +# tempsdb + +[](https://pypi.python.org/pypi/tempsdb) +[](https://badge.fury.io/py/tempsdb) +[](https://pypi.python.org/pypi/tempsdb) +[](http://tempsdb.readthedocs.io/en/latest/?badge=latest) +[](https://codeclimate.com/github/smok-serwis/tempsdb/maintainability) +[](https://app.circleci.com/pipelines/github/smok-serwis/tempsdb) + Embedded Cython library for time series that you need to upload somewhere diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d4bb2cbb9eddb1bb1b4f366623044af8e4830919 --- /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 0000000000000000000000000000000000000000..194df61ba14bfc31289cda0eaa16c94c31afbfa0 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,52 @@ +# 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 = 'tempsdb' +copyright = '2020, Piotr MaĹlanka' +author = 'Piotr MaĹlanka' + + +# -- 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 0000000000000000000000000000000000000000..3c8d2644ab6da833a0d762e5929d89f06ab31bd1 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. tempsdb documentation master file, created by + sphinx-quickstart on Sat Nov 28 15:49:03 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to tempsdb'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 0000000000000000000000000000000000000000..922152e96a04a242e6fc40f124261d74890617d8 --- /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/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..35cb25ca33709b70f2fce062592a7905e4da8cd5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +satella diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..d18f3d6eedcd2fb09570acd65aa756b40b39b6e2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,38 @@ +# coding: utf-8 +[metadata] +name = tempsdb +long-description = file: README.md +long-description-content-type = text/markdown; charset=UTF-8 +license_files = LICENSE +author = Piotr MaĹlanka +author_email = pmaslanka@smok.co +description = Embedded Cython database for time series that you need to send somewhere +url = https://github.com/smok-serwis/tempsdb +project-urls = + Documentation = https://tempsdb.readthedocs.io/ + Code = https://github.com/smok-serwis/tempsdb + Issue tracker = https://github.com/smok-serwis/tempsdb/issues +classifier = + Programming Language :: Python + 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 + Operating System :: POSIX + Operating System :: OS Independent + Development Status :: 5 - Production/Stable + License :: OSI Approved :: MIT License + Topic :: Software Development :: Libraries + Topic :: Database + +[pycodestyle] +max-line-length = 100 + +[pep8] +max-line-length = 100 + +[bdist_wheel] +universal = 1 + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..86bf64c0c509f8a5c0fcbfc7b152cf5ff8d28d2e --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +import os +import typing as tp +from satella.files import find_files +from setuptools import find_packages +from distutils.core import setup +from snakehouse import Multibuild, build + + +def find_pyx(*path) -> tp.List[str]: + return list(find_files(os.path.join(*path), r'(.*)\.pyx', scan_subdirectories=True)) + + +setup(name='tempsdb', + version='0.1_a1', + packages=find_packages(include=['tempsdb', 'tempsdb.*']), + install_requires=['satella'], + ext_modules=build([Multibuild('tempsdb', find_pyx('rapid')), ], + compiler_directives={ + 'language_level': '3', + }), + python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*', + zip_safe=False + ) diff --git a/tempsdb/__init__.py b/tempsdb/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391