1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00

moved to pyproject toml

This commit is contained in:
Bastian Venthur
2022-12-09 20:57:11 +01:00
parent a330d9766d
commit 352c37045a
7 changed files with 84 additions and 64 deletions

2
.flake8 Normal file
View File

@@ -0,0 +1,2 @@
[flake8]
exclude = venv,build,docs

View File

@@ -2,6 +2,7 @@
## [unreleased] ## [unreleased]
* moved to pyproject.toml
* added python 3.11 to test suite * added python 3.11 to test suite
* break out lint and mypy from test matrix and only run on linux- and latest * break out lint and mypy from test matrix and only run on linux- and latest
stable python to make it a bit more efficient stable python to make it a bit more efficient

View File

@@ -14,13 +14,13 @@ endif
.PHONY: all .PHONY: all
all: lint mypy test all: lint mypy test test-release
$(VENV): requirements.txt requirements-dev.txt setup.py $(VENV): requirements.txt requirements-dev.txt pyproject.toml
$(PY) -m venv $(VENV) $(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -r requirements.txt $(BIN)/pip install --upgrade -r requirements.txt
$(BIN)/pip install --upgrade -r requirements-dev.txt $(BIN)/pip install --upgrade -r requirements-dev.txt
$(BIN)/pip install -e . $(BIN)/pip install -e .['dev']
touch $(VENV) touch $(VENV)
.PHONY: test .PHONY: test
@@ -35,10 +35,17 @@ mypy: $(VENV)
lint: $(VENV) lint: $(VENV)
$(BIN)/flake8 $(BIN)/flake8
.PHONY: release .PHONY: build
release: $(VENV) build: $(VENV)
rm -rf dist rm -rf dist
$(BIN)/python setup.py sdist bdist_wheel $(BIN)/python3 -m build
.PHONY: test-release
test-release: $(VENV) build
$(BIN)/twine check dist/*
.PHONY: release
release: $(VENV) build
$(BIN)/twine upload dist/* $(BIN)/twine upload dist/*
.PHONY: docs .PHONY: docs

67
pyproject.toml Normal file
View File

@@ -0,0 +1,67 @@
[build-system]
requires = ["setuptools>=64.0"]
build-backend = "setuptools.build_meta"
[project]
name = "blag"
authors = [
{ name="Bastian Venthur", email="mail@venthur.de" },
]
description = "blog-aware, static site generator"
keywords = ["markdown", "blag", "blog", "static site generator", "cli"]
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.8"
dynamic = ["version"]
dependencies = [
"markdown",
"feedgenerator",
"jinja2",
"pygments",
]
[project.scripts]
blag = "blag.blag:main"
[project.urls]
'Documentation' = 'https://blag.readthedocs.io/'
'Source' = 'https://github.com/venthur/blag'
'Changelog' = 'https://github.com/venthur/blag/blob/master/CHANGELOG.md'
[project.optional-dependencies]
dev = [
"build",
"sphinx",
"twine",
"wheel",
"pytest",
"pytest-cov",
"flake8",
"mypy",
"types-markdown",
]
[tool.setuptools.dynamic]
version = {attr = "blag.__VERSION__" }
[tool.setuptools]
packages = ["blag"]
[tool.setuptools.package-data]
blag = ["templates/*"]
[tool.pytest.ini_options]
addopts = """
--cov=blag
--cov=tests
--cov-report=html
--cov-report=term-missing:skip-covered
"""
[tool.mypy]
files = "blag,tests"
strict = true
[[tool.mypy.overrides]]
module = "feedgenerator.*"
ignore_missing_imports = true

View File

@@ -1,3 +1,4 @@
build==0.9.0
sphinx==5.3.0 sphinx==5.3.0
twine==4.0.1 twine==4.0.1
wheel==0.37.1 wheel==0.37.1

View File

@@ -1,16 +0,0 @@
[tool:pytest]
addopts =
--cov=blag
--cov=tests
--cov-report=html
--cov-report=term-missing:skip-covered
[flake8]
exclude = venv,build,docs
[mypy]
files = blag,tests
strict = True
[mypy-feedgenerator.*]
ignore_missing_imports = True

View File

@@ -1,42 +0,0 @@
#!/usr/bin/env python
from setuptools import setup
meta = {}
exec(open('./blag/version.py').read(), meta)
meta['long_description'] = open('./README.md').read()
setup(
name='blag',
version=meta['__VERSION__'],
description='blog-aware, static site generator',
long_description=meta['long_description'],
long_description_content_type='text/markdown',
keywords='markdown blag blog static site generator cli',
author='Bastian Venthur',
author_email='mail@venthur.de',
url='https://github.com/venthur/blag',
project_urls={
'Documentation': 'https://blag.readthedocs.io/',
'Source': 'https://github.com/venthur/blag',
'Changelog':
'https://github.com/venthur/blag/blob/master/CHANGELOG.md',
},
python_requires='>=3.8',
package_data={
'blag': ['templates/*'],
},
install_requires=[
'markdown',
'feedgenerator',
'jinja2',
'pygments',
],
packages=['blag'],
entry_points={
'console_scripts': [
'blag = blag.blag:main'
]
},
license='MIT',
)