Skip to content
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
8 changes: 6 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[flake8]
extend-ignore =
# E203 and E704 needed for black
# E203 and E704 needed for black
E203,
E704,
E501,
E704,
F401,
F541,
F821,
F841,
W503
max-line-length=88
7 changes: 6 additions & 1 deletion .github/linters/bearer.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
rule:
skip-rule: []
skip-rule:
- python_lang_os_command_injection
- python_lang_path_traversal
- python_lang_path_using_user_input
- python_lang_sql_injection
- python_lang_weak_random
21 changes: 4 additions & 17 deletions .github/workflows/bandit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,16 @@ permissions: {}
jobs:
bandit:
permissions:
contents: read
pull-requests: write
security-events: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Run Bandit Scan
uses: lukehinds/bandit-action@new-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: PyCQA/bandit-action@v1
with:
path: "sz_tools"
recursive: "true"
python-version: ${{ matrix.python-version }}
targets: sz_tools
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
uses: py-actions/flake8@v2
with:
max-line-length: 88
path: src
path: sz_tools
plugins: flake8-black
3 changes: 2 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
"shuff",
"shutil",
"SIGALRM",
"simplifiable",
"SKYBLUE",
"sourcedict",
"splitext",
Expand Down Expand Up @@ -345,4 +346,4 @@
"data/**",
"development-requirements.txt"
]
}
}
14 changes: 7 additions & 7 deletions development-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
bandit==1.8.6
black==25.9.0
build==1.3.0
coverage==7.11.0
coverage==7.10.7
flake8==7.3.0
fpvs==0.3.0
isort==7.0.0
isort==6.1.0
mypy==1.18.2
psutil==7.1.1
pylint==4.0.2
pylint==3.3.9
pytest-cov==7.0.0
pytest-schema==0.1.2
pytest==8.4.2
sphinx-autodoc-typehints==3.5.2
sphinx-gallery==0.19.0
sphinx-autodoc-typehints
sphinx-gallery
sphinx-jinja2-compat==0.4.1
sphinx-prompt==1.10.1
sphinx-prompt
sphinx-rtd-theme==3.0.2
sphinx-tabs==3.4.*
sphinx-toolbox==4.0.0
sphinx==8.2.3
sphinx
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
Expand Down
49 changes: 47 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ build-backend = "setuptools.build_meta"
test = ["pytest", "coverage"]

[tool.bandit]
skips = ["B101"]
skips = [
"B101",
"B108",
"B404",
"B602",
"B605",
"B608"
]

[tool.black]
line-length = 120
Expand All @@ -24,6 +31,19 @@ src_paths = ["examples", "src", "tests"]

[tool.mypy]
exclude = ['.venv', 'g2_tools']
disable_error_code = [
"arg-type",
"attr-defined",
"import-not-found",
"name-defined",
"no-untyped-call",
"no-untyped-def",
"return-value",
"union-attr",
"unused-ignore",
"var-annotated"
]
disallow_untyped_defs = false

[[tool.mypy.overrides]]
module = "senzing_abstract.szengineflags.*"
Expand All @@ -34,16 +54,41 @@ warn_unused_ignores = "false"
module = "pytest_schema.*"
ignore_missing_imports = "true"

[[tool.mypy.overrides]]
module = "sz_tools/_sz_database"
ignore_missing_imports = "true"

[tool.pylint]
ignored-argument-names = "args|kwargs"
disable = [
"broad-except",
"broad-exception-raised",
"consider-iterating-dictionary",
"consider-using-dict-items",
"consider-using-f-string",
"consider-using-generator",
"f-string-without-interpolation",
"invalid-name",
"line-too-long",
"line-too-long",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-member",
"protected-access",
"raise-missing-from",
"simplifiable-if-expression",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-statements"
"too-many-statements",
"undefined-variable",
"unidiomatic-typecheck",
"unspecified-encoding",
"unused-argument",
"unused-import",
"unused-variable",
"useless-return"
]
good-names = [
"template-python"
Expand Down
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[metadata]
name = python-tools
name = sz-python-tools
version = 0.0.31
author = senzing
author_email = support@senzing.com
description = Python Tools
description = Senzing Python Tools
license = Apache 2
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -12,12 +12,11 @@ project_urls =
Bug Tracker = https://github.com/senzing-garage/sz-python-tools/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent

[options]
package_dir =
= src
= sz_tools
packages = find:
python_requires = >=3.9
install_requires =
Expand Down
Binary file added testdata/senzing-license/g2.lic
Binary file not shown.
Empty file added testdata/sqlite/G2C-empty.db
Empty file.
Binary file added testdata/sqlite/G2C-with-config.db
Binary file not shown.
Binary file added testdata/sqlite/G2C-with-schema.db
Binary file not shown.
Binary file added testdata/sqlite/G2C.db
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/example_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -----------------------------------------------------------------------------
# Example testcases
# -----------------------------------------------------------------------------


def test_example() -> None:
"""Example test"""
a_string = "This is a test string"
assert a_string == "This is a test string"
Loading