Migrate to pyproject, add black/flake8/bandit/etc.

This commit is contained in:
Darryl Nixon 2023-05-23 14:33:32 -07:00
parent eb99384b1e
commit 7c5919f073
11 changed files with 69 additions and 23 deletions

3
.flake8 Normal file
View file

@ -0,0 +1,3 @@
[flake8]
max-line-length = 160
exclude = docs/*, .git, __pycache__

28
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--application-directories, '.:ghostforge', --py39-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8

0
ghostforge/cli.py Normal file
View file

30
pyproject.toml Normal file
View file

@ -0,0 +1,30 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ghostforge"
version = "0.0.1"
authors = [{ name = "ghostforge", email = "git@nixon.mozmail.com" }]
description = "A false identity information manager for privacy prudent persons"
readme = "README.md"
requires-python = ">=3.9"
dependencies = ["tornado", "queries"]
license = "MIT"
[project.scripts]
ghostforge_serve = "ghostforge.cli:service"
[project.urls]
"Homepage" = "https://github.com/DarrylNixon/ghostforge"
"Bug Tracker" = "https://github.com/DarrylNixon/ghostforge/issues"
[tool.bandit]
exclude_dirs = ["/doc"]
skips = []
[tool.black]
line-length = 120
[tool.isort]
profile = "black"

View file

@ -1,15 +0,0 @@
from distutils.core import setup
from setuptools import find_packages
from ghostforge import _PROJECT, __version__
setup(
name=_PROJECT,
version=__version__,
packages=find_packages(),
license="MIT",
author="ghostforge",
description="False identity management web app",
long_description="A false identity information manager for privacy prudent persons",
keywords=["ghostforge", "persona", "red team", "tornado"],
install_requires=["tornado>=6.3.2", "queries>=2.1.1"],
)