Skip to content

Commit

Permalink
chore(pain001): ⬆️ upgrading dependencies and sync
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed May 19, 2024
1 parent 817628f commit 772ab1a
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 64 deletions.
73 changes: 37 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ repository = "https://github.com/sebastienrousseau/pain001"
homepage = "https://pain001.com"

[tool.poetry.dependencies]
click = "^8.1.7"
colorama = "^0.4.6"
defusedxml = "^0.7.1"
elementpath = "^4.1.5"
jinja2 = "^3.1.4"
markdown-it-py = "^3.0.0"
markupsafe = "^2.1.3"
mdurl = "^0.1.2"
pygments = "^2.16.1"
click = "8.1.7"
colorama = "0.4.6"
datetime = "5.5"
defusedxml = "0.7.1"
elementpath = "4.4.0"
jinja2 = "3.1.4"
markdown-it-py = "3.0.0"
markupsafe = "2.1.5"
mdurl = "0.1.2"
pygments = "2.18.0"
python = "^3.9"
rich = "^13.5.2"
xmlschema = "^2.4.0"
rich = "13.7.1"
xmlschema = "3.3.1"

# Dependency groups are supported for organizing your dependencies
datetime = "^5.5"
[tool.poetry.group.dev.dependencies]
pytest = "^7.1.2"
pytest-cov = "^3.0"
pytest = "^8.1.0"
pytest-cov = "^5.0.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
Sphinx = "^5.1.1"
Sphinx = "^7.3.7"

[build-system]
requires = ["poetry-core"]
Expand Down
44 changes: 41 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ click==8.1.7 ; python_version >= "3.9" and python_version < "4.0" \
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
datetime==5.5 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:0abf6c51cb4ba7cee775ca46ccc727f3afdde463be28dbbe8803631fefd4a120 \
--hash=sha256:21ec6331f87a7fcb57bd7c59e8a68bfffe6fcbf5acdbbc7b356d6a9a020191d3
defusedxml==0.7.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69 \
--hash=sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61
Expand Down Expand Up @@ -83,9 +86,44 @@ mdurl==0.1.2 ; python_version >= "3.9" and python_version < "4.0" \
pygments==2.18.0 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \
--hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a
pytz==2024.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \
--hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319
rich==13.7.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \
--hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432
xmlschema==2.5.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:4f7497de6c8b6dc2c28ad7b9ed6e21d186f4afe248a5bea4f54eedab4da44083 \
--hash=sha256:ec2b2a15c8896c1fcd14dcee34ca30032b99456c3c43ce793fdb9dca2fb4b869
setuptools==69.5.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987 \
--hash=sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32
xmlschema==3.3.1 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:2066ecbc9728112073f6f44d17c5c16723aff1c7d22a7c4c6421e2d68ec5f0ea \
--hash=sha256:93547e999896f1525a821e229991d31e4dd02563f93b0667ce6566cf2b853751
zope-interface==6.4 ; python_version >= "3.9" and python_version < "4.0" \
--hash=sha256:21732994aa3ca43bbb6b36335c288023428a3c5b7322b637c7b0a03053937578 \
--hash=sha256:36ee6e507a9fd4f1f0aab8e8dfc801d162e7211c27503cbfb47e1d558941a7fa \
--hash=sha256:3945f4fda92c1b6fb0cb6eaaaf72599e5c2c2059654bdc42bc09c6e711c214c8 \
--hash=sha256:414e6dccdf4a5c96c0c98da68ba040dbf9ba7511b61b34e228f11b0ed90c439d \
--hash=sha256:4782e173c2fde4f649c2a9a68082445bc1f2c27f41907de06bf1ba82585847f2 \
--hash=sha256:4cd56eb9a23767958c9a0654306b9a4a74def485f645b3a7378cc6ab661ef31c \
--hash=sha256:502d2c9c4231d022b20225dba5c6c736236ed65e1d7e2f6f402b5aa6a7040ec9 \
--hash=sha256:57f34b7997f8de7d2db08363eaccd05dad20f106e39efe95bed4fac84af2d022 \
--hash=sha256:5fbbb290751f5c4ed81e54ae73fe8557c4a85973f5ab019edbb0f746244ecea6 \
--hash=sha256:604fa920478dfc0c76cdb7c203572400a8317ffcdac288245c408b42b3d9aee9 \
--hash=sha256:62e6b756663deade5270f67899753437b39d970f9eecd49e19fae3b880310cf0 \
--hash=sha256:646cd83d24065d074f22f61fe101d20dbf4b729ca7831cc782ec986eb9156f93 \
--hash=sha256:6494dc0314e782ce4fb0e624b4ce2458f54d074382f50a920c7700c05cbcef28 \
--hash=sha256:6e4cc017206c1429a6d8fdd8a25c6efc15512065eec0a8d45c350df96a0911ed \
--hash=sha256:72faa868fcfde49a29d287dce3c83180322467eecd725dd351098efe96e8d4bb \
--hash=sha256:7cda82ab32f984985f09e4ec20a4f9665b26779a1b8e443b34a148de256f2052 \
--hash=sha256:855b7233fa5d0d1f3be8c14fadf4718dee1c928e1d75f1584bea6ecec6dcc4af \
--hash=sha256:86e85eada0eb551950df05d72dc0e892320f14daa78bc434059e834d4b1f9300 \
--hash=sha256:8e246357f52952ae5fa950d19eda8572594c49e6cb1e5462508e6cec561a37de \
--hash=sha256:93f28d84517dcd6c240979bd9b2f262a373832baef856fe663a24b9171d7f04d \
--hash=sha256:b0f61ccbc26e08031d0e72b6a0cbf9b4030f035913cb2b39f940aa42eb8e0063 \
--hash=sha256:b11f2b67ccc990a1522fa8cd3f5d185a068459f944ab2d0e7a1b15d31bcb4af4 \
--hash=sha256:c04bd4ee4766d285e83c6d8c042663a98efb934389e05ccd643fefb066c88a9d \
--hash=sha256:ee1e3ca6c98efe213a96dece89100a8aa52e210ac354861d8039d69bd1d6e5ff \
--hash=sha256:f33af86ed460eb28dc9da1de1f3305795271a19c665161c1d973a737596b2081 \
--hash=sha256:f5092f2712e1fd07579fc3101b18e9c95857c853e836847598bf992c8e672434 \
--hash=sha256:f78e1eac48c4f4e0168a91cabcd8d1aedb972836df5c8769071fc6173294a0a3 \
--hash=sha256:fe636b49c333bfc5b0913590e36a2f151167c462fb36d9f4acc66029e45c974b
52 changes: 43 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,63 @@
# limitations under the License.

[metadata]
author = "Sebastien Rousseau <[email protected]>"
description = "Pain001 is a Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Data."
license = "Apache Software License"
name = pain001
version = 0.0.25

[options]
packages = find:
include_package_data = true
install_requires =
click==8.1.7
colorama==0.4.6
datetime==5.5
defusedxml==0.7.1
elementpath==4.1.5
jinja2==3.1.2
elementpath==4.4.0
jinja2==3.1.4
markdown-it-py==3.0.0
markupsafe==2.1.3
markupsafe==2.1.5
mdurl==0.1.2
pygments==2.17.1
pytest==8.2.0
rich==13.7.0
xmlschema==2.5.0
pygments==2.18.0
python=3.9
rich==13.7.1
xmlschema==3.3.1

[options.extras_require]
dev =
pytest==8.1.0
pytest-cov==5.0.0

[options.entry_points]
console_scripts =
pain001 = pain001.cli:main

[aliases]
test = pytest

[tool:pytest]
testpaths = tests
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 79
target-version = ['py39']

[tool.isort]
profile = "black"
line_length = 79
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
known_first_party = "pain001"
known_third_party = "xmlschema"

[tool.pytest]
addopts = "--cov=pain001 --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=100"
testpaths = "tests"

[wheel]
universal = 1
48 changes: 48 additions & 0 deletions tests/test_load_db_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os
import sqlite3
import pytest
from pain001.db.load_db_data import sanitize_table_name, load_db_data


# Test sanitize_table_name function
def test_sanitize_table_name():
assert sanitize_table_name("valid_table_name") == "valid_table_name"
assert sanitize_table_name("invalid table name") == "invalid_table_name"
assert sanitize_table_name("123invalidname") == "table_123invalidname"
assert sanitize_table_name("table!@#name") == "table___name"


# Test load_db_data function
def test_load_db_data(tmp_path):
# Create a temporary SQLite database
db_file = tmp_path / "test.db"
conn = sqlite3.connect(db_file)
cursor = conn.cursor()

# Create a test table and insert data
cursor.execute(
"CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT)"
)
cursor.execute("INSERT INTO test_table (name) VALUES ('Alice')")
cursor.execute("INSERT INTO test_table (name) VALUES ('Bob')")
conn.commit()
conn.close()

# Test loading data from the table
data = load_db_data(db_file, "test_table")
assert len(data) == 2
assert data[0]["name"] == "Alice"
assert data[1]["name"] == "Bob"

# Test FileNotFoundError
with pytest.raises(FileNotFoundError):
load_db_data("non_existent.db", "test_table")

# Test sqlite3.OperationalError for non-existent table
with pytest.raises(sqlite3.OperationalError):
load_db_data(db_file, "non_existent_table")


# If the script is executed directly, run the tests
if __name__ == "__main__":
pytest.main()

0 comments on commit 772ab1a

Please sign in to comment.