feat: add type hints, new CLI features, and improve project structure

chore: add uv.lock to gitignore

Major changes:
- Add type hints and docstrings to all functions (PEP 484)
- Add __main__.py for module execution (python -m genpass)
- Expose public API in __init__.py
- Add config file support (~/.genpass/config.json)
- Add entropy calculation (--entropy)
- Add clipboard support (--clipboard/-c)
- Add ambiguous characters exclusion (--no-ambiguous)
- Add output formats: plain, json, delimited (--format)
- Add sensible defaults (all character types enabled by default)
- Add input validation for length and count
- Update shell completions for all new options
- Add pre-commit config with ruff, mypy, black
- Update pyproject.toml with dev dependencies and tool configs
- Add requirements.txt and requirements-dev.txt
- Update README.md with comprehensive examples

BREAKING CHANGE: Default behavior now includes all character types
This commit is contained in:
kilyabin
2026-03-10 00:42:16 +04:00
parent c11345d576
commit eeca690c0a
13 changed files with 969 additions and 67 deletions

View File

@@ -1,14 +1,103 @@
[project]
name = "genpass"
version = "1.0.0"
version = "2.0.0"
description = "Secure password generator CLI"
authors = [{ name = "kilyabin" }]
readme = "README.md"
license = "MIT"
license = { text = "MIT" }
requires-python = ">= 3.8"
keywords = ["password", "generator", "security", "cli", "random"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Security",
"Topic :: Utilities",
]
dependencies = [
"pyperclip>=1.8.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
"black>=23.0.0",
"pre-commit>=3.0.0",
]
[project.scripts]
genpass = "genpass.cli:main"
[project.urls]
Homepage = "https://github.com/kilyabin/GenPass"
Repository = "https://github.com/kilyabin/GenPass.git"
Issues = "https://github.com/kilyabin/GenPass/issues"
Changelog = "https://github.com/kilyabin/GenPass/blob/main/CHANGELOG.md"
[tool.setuptools]
packages = ["genpass"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --cov=genpass --cov-report=term-missing"
[tool.ruff]
line-length = 100
target-version = "py38"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = ["E501"]
[tool.ruff.lint.isort]
known-first-party = ["genpass"]
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
[tool.black]
line-length = 100
target-version = ["py38", "py39", "py310", "py311", "py312"]
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''