diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7f7732f6f6618655e1943b41da0f885080c0e556 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Brandon Rodriguez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..03f3374087e8e48923473499f5328c33aaff5b2a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include LICENSE +include readme.md diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d0c3cbf1020d5c292abdedf27627c6abe25e2293 --- /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 = source +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/make.bat b/docs/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..dc1312ab09ca6fb0267dee6b28a38e69c253631a --- /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=source +set BUILDDIR=build + +%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.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.in b/docs/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..cb5dbf6d6e1ed7724f1bfdac916acbb12217e470 --- /dev/null +++ b/docs/requirements.in @@ -0,0 +1,3 @@ +sphinx +sphinx-autobuild +sphinx-rtd-theme diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..6c7f8a4aca14772651e702d37664b1f192befa17 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,73 @@ +# +# This file is autogenerated by pip-compile with python 3.9 +# To update, run: +# +# pip-compile requirements.in +# +alabaster==0.7.12 + # via sphinx +babel==2.10.3 + # via sphinx +certifi==2022.6.15 + # via requests +charset-normalizer==2.0.12 + # via requests +colorama==0.4.5 + # via sphinx-autobuild +docutils==0.17.1 + # via + # sphinx + # sphinx-rtd-theme +idna==3.3 + # via requests +imagesize==1.3.0 + # via sphinx +importlib-metadata==4.11.4 + # via sphinx +jinja2==3.1.2 + # via sphinx +livereload==2.6.3 + # via sphinx-autobuild +markupsafe==2.1.1 + # via jinja2 +packaging==21.3 + # via sphinx +pygments==2.12.0 + # via sphinx +pyparsing==3.0.9 + # via packaging +pytz==2022.1 + # via babel +requests==2.28.0 + # via sphinx +six==1.16.0 + # via livereload +snowballstemmer==2.2.0 + # via sphinx +sphinx==5.0.2 + # via + # -r requirements.in + # sphinx-autobuild + # sphinx-rtd-theme +sphinx-autobuild==2021.3.14 + # via -r requirements.in +sphinx-rtd-theme==1.0.0 + # via -r requirements.in +sphinxcontrib-applehelp==1.0.2 + # via sphinx +sphinxcontrib-devhelp==1.0.2 + # via sphinx +sphinxcontrib-htmlhelp==2.0.0 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-qthelp==1.0.3 + # via sphinx +sphinxcontrib-serializinghtml==1.1.5 + # via sphinx +tornado==6.1 + # via livereload +urllib3==1.26.9 + # via requests +zipp==3.8.0 + # via importlib-metadata diff --git a/docs/source/Makefile b/docs/source/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d0c3cbf1020d5c292abdedf27627c6abe25e2293 --- /dev/null +++ b/docs/source/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 = source +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/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..ab9ca25fa9c91d9dcfd4e816c5e86796dd3eec37 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,60 @@ +# 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 = 'py-dbc' +copyright = '2022, Brandon Rodriguez' +author = 'Brandon Rodriguez' + +# The full version, including alpha/beta/rc tags +release = '0.1.0' + + +# -- 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 = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.autosectionlabel', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.autosummary', +] + +# 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 = [] + + +# -- 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 = 'sphinx_rtd_theme' + +# 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 = [] diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst new file mode 100644 index 0000000000000000000000000000000000000000..0eff4027cf03424961e575b008f3a9d5e091ba1a --- /dev/null +++ b/docs/source/configuration.rst @@ -0,0 +1,5 @@ +Configuration +************* + +Testing for setting up read-the-docs for a package. +Configuration to be written later. diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..90a52730f105f8371a00ec49d123d67275eaab0a --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,27 @@ +.. py-dbc documentation master file, created by + sphinx-quickstart on Wed Jun 22 12:23:27 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + + +Pythonic Database Connector +=========================== + +The **Pythonic Database Connector** package (aka **py-dbc**) is a +connector to allow Pythonic interaction with multiple database types. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + quickstart + configuration + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/make.bat b/docs/source/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..747ffb7b3033659bdd2d1e6eae41ecb00358a45e --- /dev/null +++ b/docs/source/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%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.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst new file mode 100644 index 0000000000000000000000000000000000000000..64a248b3fcaecd7be43940e3b0d1a868b17f9175 --- /dev/null +++ b/docs/source/quickstart.rst @@ -0,0 +1,5 @@ +Quickstart +********** + +Testing for setting up read-the-docs for a package. +Quickstart to be written later. diff --git a/generate_docs.sh b/generate_docs.sh new file mode 100755 index 0000000000000000000000000000000000000000..c4a13807c3099fa92ab866f4566432cbf893e7cd --- /dev/null +++ b/generate_docs.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +### + # Utility script to auto-generate/auto-update sphinx docs for project. + # Forces entire docs build folder to re-build, in order to skip issue where sometimes docs don't update. + ## + + +# Stop on error. +set -e + + +# Ensure bash is executing from project root, regardless of where it was invoked from. +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + + +# Forcibly remove existing generated docs, to ensure build command actually updates everything properly. +if [[ -d "./docs/build/" ]] +then + rm -r "./docs/build/" +fi +mkdir "./docs/build/" + + +## Auto-generate docs source files, from actual Python code in project. +#sphinx-apidoc -o ./docs/source/api/ ./src/connectors/ + + +## Remove modules .rst file, because we don't actually care about it. +#if [[ -f "./docs/source/api/modules.rst" ]] +#then +# rm ./docs/source/api/modules.rst +#fi + + +# Generate sphinx docs from source files. +sphinx-build ./docs/source/ ./docs/build/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..0a92f1b806ac86188442906e1486cc606682a594 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ['setuptools>=40.8.0', 'wheel'] +build-backend = 'setuptools.build_meta:__legacy__' + +[project] +name = "py-dbc" +version = "0.1.0" +description = "Connector for Pythonic interaction with multiple database types." +readme = "readme.md" +authors = [{ name = "Brandon Rodriguez", email = "brodriguez8774@gmail.com"}] +license = { file = "LICENSE" } +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +keywords = [ + "database", + "mysql", +] +dependencies = [ + "mysqlclient", +] +requires-python = ">=3.7" + +[project.optional-dependencies] +dev = [ + "pip-tools", +] +doc = [ + "pip-tools", + "sphinx", + "sphinx-autobuild", + "sphinx-rtd-theme", +] + +[project.urls] +Homepage = "https://github.com/brodriguez8774/py-dbc" diff --git a/readme.md b/readme.md index 73cd539fc57d6923c9306dae39175d2b76338829..effc38aa159dcc4ce6888e1dd60e3e25c07aa55a 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,6 @@ -# Pythonic Database Connector (py-dbc) +# Pythonic Database Connector +(py-dbc) ## Description -Connector to allow Pythonic interaction with multiple database types. +Connector for Pythonic interaction with multiple database types. diff --git a/readthedocs.yaml b/readthedocs.yaml new file mode 100644 index 0000000000000000000000000000000000000000..82c97796c5e25d29e3a79b9427c89e849a40a627 --- /dev/null +++ b/readthedocs.yaml @@ -0,0 +1,18 @@ +version: 2 + + +build: + os: "ubuntu-20.04" + tools: + python: "3.9" + + +# Build from the docs/ directory with Sphinx. +sphinx: + configuration: docs/source/conf.py + + +# Explicitly set the version of Python and its requirements. +python: + install: + - requirements: docs/requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1267753b761201ba90a63bdf0b4087ad1050665e..0000000000000000000000000000000000000000 --- a/requirements.txt +++ /dev/null @@ -1,20 +0,0 @@ -### - # Specifies Python packages (and package versions) to install in order to run project. - # - # Execute via "pip install -r requirements.txt" while in the base project directory. - ## - - -### - # Core Python Packages - ## -mysqlclient # For connecting to mysql. -pytz # For datetime shenanigans. -pytest # Base Pytest package. Current preferred testing method. -pytest-xdist # Additional Pytest features, such as multithreading and looping. - - -### - # Pip Freeze: - # pip freeze -r requirements.txt - ## diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..6b3df81da341ad697670546ce38823606e910a0e --- /dev/null +++ b/setup.cfg @@ -0,0 +1,35 @@ +[metadata] +name = py-dbc +version = 0.1.0 +description = Connector for Pythonic interaction with multiple database types. +long_description = file: readme.md +url = https://github.com/brodriguez8774/py-dbc +author = Brandon Rodriguez +author_email = brodriguez8774@gmail.com +license = MIT License +classifiers = + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + + +[options] +include_package_data = true +packages = find: + + +# AutoPep8 Config Settings. +[pycodestyle] +max_line_length = 120 + + +# Flake8 Config Settings. +[flake8] +max-line-length = 120