Setup Python project template.

This commit is contained in:
Tronic 2022-01-25 14:36:18 +00:00
parent e7b7ee181b
commit 6329d05bfe
10 changed files with 74 additions and 0 deletions

4
.gitignore vendored
View File

@ -1 +1,5 @@
/.*
/*.egg-info
website-output
__pycache__
coverage.xml

0
README.md Normal file
View File

0
gsitegen/__init__.py Normal file
View File

32
setup.py Normal file
View File

@ -0,0 +1,32 @@
from setuptools import find_packages, setup
setup(
name="gsitegen",
author="Govindas",
author_email="govindas@govindas.invalid",
description="File and message encryption GUI and CLI",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https://git.limework.net/Govindas/SiteGenerator",
use_scm_version=True,
setup_requires=["setuptools_scm"],
packages=find_packages(),
python_requires=">=3.8",
classifiers=[
"Programming Language :: Python :: 3",
"License :: Public Domain",
"Operating System :: OS Independent",
],
install_requires=[
"html5tagger>=1.1.0",
"markdown>=3.3.6",
],
extras_require={
"test": ["pytest", "pytest-sugar", "pytest-mock", "coverage", "mypy", "bandit", "types-Markdown"],
"dev": ["tox", "isort", "yapf"],
},
include_package_data=True,
entry_points=dict(
console_scripts=["gsitegen = gsitegen.generate:main"],
),
)

7
tests/test_generate.py Normal file
View File

@ -0,0 +1,7 @@
from gsitegen.generate import *
from html5tagger import E
def test_something():
doc = E()
parseMarkdown(doc, "## Heading 2")
assert str(doc) == "<h2>Heading 2</h2>"

31
tox.ini Normal file
View File

@ -0,0 +1,31 @@
[tox]
envlist = clean, py39, py310, coverage, security, type-checking
[coverage:run]
include = gsitegen/*.py
branch = true
[testenv:clean]
whitelist_externals = rm
commands =
rm -f .coverage
[testenv]
usedevelop = true
extras = test
commands =
coverage run --append -m pytest {posargs:tests}
[testenv:coverage]
commands =
coverage report -i
coverage html -i
coverage xml -i
[testenv:type-checking]
commands =
mypy gsitegen --ignore-missing-imports
[testenv:security]
commands =
bandit --recursive gsitegen --skip B101