Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1192 add a db class to pyprediktorutilites fixes #7

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,17 @@ dwh = Dwh("localhost", "mydatabase", "myusername", "mypassword")
results = dwh.fetch("SELECT * FROM mytable")
dwh.execute("INSERT INTO mytable VALUES (1, 'test')")
```

# TODOs

1. In `setup.cfg` file there is the following code snipped:

```
install_requires =
pytest
pytest-cov
pytest-mock
pyarrow
```

Install these packages only when testing and build the documentation via `tox -e docs`. Do not install them on production.
14 changes: 11 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@
# If this is True, todo emits a warning for each TODO entries. The default is False.
todo_emit_warnings = True

# Since the documentation build process doesn't need to make actual database connections, we can mock the pyodbc module during the documentation build.
autodoc_mock_imports = ["pyodbc"]

# -- Options for HTML output -------------------------------------------------

Expand All @@ -159,10 +161,10 @@
# 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
# documentation.
#html_theme_options = {
# html_theme_options = {
# "sidebar_width": "300px",
# "page_width": "1200px"
#}
# }

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down Expand Up @@ -247,7 +249,13 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "user_guide.tex", "pyPrediktorUtilities Documentation", "Andreas Lydersen", "manual")
(
"index",
"user_guide.tex",
"pyPrediktorUtilities Documentation",
"Andreas Lydersen",
"manual",
)
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ install_requires =
paramiko >= 3.3.1
jinja2 >= 3.0.1
pandas >= 1.4.4
pyodbc >= 4.0.39
pyodbc
pytest
pytest-cov
pytest-mock
pyarrow


[options.packages.find]
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ isolated_build = True


[testenv]
sitepackages = True
description = Invoke pytest to run automated tests
setenv =
TOXINIDIR = {toxinidir}
Expand All @@ -17,9 +18,9 @@ passenv =
SETUPTOOLS_*
extras =
testing
allowlist_externals = pytest
commands =
pytest {posargs}

pytest --show-capture=all {posargs}

# # To run `tox -e lint` you need to make sure you have a
# # `.pre-commit-config.yaml` file. See https://pre-commit.com
Expand Down
Loading