Skip to content

Commit

Permalink
Merge pull request #50 from fkie-cad/pre-commit
Browse files Browse the repository at this point in the history
added pre-commit
  • Loading branch information
giga-a authored Jan 22, 2024
2 parents 48f3388 + e4e071b commit 73f4c3a
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 87 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: Installation
run: python -m pip install ".[test]"
run: python -m pip install ".[dev]"
- name: Unit Tests
run: pytest -v ./tests
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
default_stages: [commit, push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
args: [--maxkb=10000]

- id: check-toml

- id: forbid-new-submodules

- id: no-commit-to-branch

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: shellcheck

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.11'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format
4 changes: 1 addition & 3 deletions auto_pip.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
echo "[x] Checking setup.py"
python3 setup.py check -r -s
echo "[x] Creating pypi Package"

python3 setup.py sdist bdist_wheel 2>stderr.log 1>stdout.log
python3 -m build 2>stderr.log 1>stdout.log

if grep -q "error:" stderr.log
then
Expand Down
9 changes: 0 additions & 9 deletions clean-up.logs

This file was deleted.

146 changes: 146 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
[build-system]
requires = [
"setuptools>=61.2",
]
build-backend = "setuptools.build_meta"

[project]
name = "honeypots"
version = "0.64"
authors = [
{ name = "QeeqBox", email = "[email protected]" },
]
description = "30 different honeypots in one package! (dhcp, dns, elastic, ftp, http proxy, https proxy, http, https, imap, ipp, irc, ldap, memcache, mssql, mysql, ntp, oracle, pjl, pop3, postgres, rdp, redis, sip, smb, smtp, snmp, socks5, ssh, telnet, vnc)"
readme = "README.rst"
requires-python = ">=3.8"
dependencies = [
"twisted==21.7.0",
"psutil==5.9.0",
"psycopg2-binary==2.9.3",
"pycryptodome==3.19.0",
"requests==2.28.2",
"requests[socks]==2.28.2",
"impacket==0.9.24",
"paramiko==3.1.0",
"scapy==2.4.5",
"service_identity==21.1.0",
"netifaces==0.11.0",
]
license = {text = "AGPL-3.0"}

[project.urls]
Homepage = "https://github.com/qeeqbox/honeypots"

[project.optional-dependencies]
dev = [
"dnspython==2.4.2",
"elasticsearch",
"ldap3",
"mysql-connector",
"pre-commit",
"pymssql",
"pysnmplib",
"pytest",
"redis",
"redis",
"vncdotool",
]

[project.scripts]
honeypots = "honeypots.__main__:main_logic"

[tool.setuptools]
packages = [
"honeypots",
"honeypots.data",
]
include-package-data = true

[tool.setuptools.package-data]
"honeypots.data" = [
"*.html",
]

[tool.ruff]
select = [
"F",
"E",
"W",
"C90",
"N",
"UP",
"B",
"A",
"C4",
"EXE",
"FA",
"ISC",
"PIE",
"T20",
"PT",
"Q",
"RET",
"SIM",
"TCH",
"ARG",
"PTH",
"ERA",
"PL",
"PLR",
"PLW",
"PERF",
"RUF",
]
ignore = [
"A003",
"PERF203",
"PERF401",
"RUF001",
"RUF002",
"RUF003",
"RUF015",
# pydantic only supports these from python>=3.9
"UP006",
"UP007",
# rules may cause conflicts when used with the formatter
"ISC001",
"Q001",
]
fixable = [
"F",
"E",
"W",
"C90",
"N",
"UP",
"B",
"A",
"C4",
"EXE",
"FA",
"ISC",
"PIE",
"T20",
"PT",
"Q",
"RET",
"SIM",
"TCH",
"ARG",
"PTH",
"ERA",
"PL",
"PLR",
"PLW",
"PERF",
"RUF",
]
exclude = [
".git",
".ruff_cache",
".venv",
"venv",
"data",
]
line-length = 99
target-version = "py38"
48 changes: 0 additions & 48 deletions setup.py

This file was deleted.

0 comments on commit 73f4c3a

Please sign in to comment.