Skip to content

Commit ecc5511

Browse files
authored
tweak release setup (#27)
* tweak release setup * wip * wip * wip * wip * project * wip * wip * wip * poetry update * release_setup * wip * wip * wip * wip * wip
1 parent 1548c6d commit ecc5511

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
[tool.poetry]
1+
[project]
22
name = "simple-html"
33
version = "3.0.0"
4-
readme = "README.md"
5-
description = "Template-less html rendering in Python"
6-
authors = ["Keith Philpott <fakekeith@example.org>"]
7-
license = "MIT"
8-
homepage = "https://github.com/keithasaurus/simple_html"
9-
keywords = ["html", "type hints"]
4+
description="Template-less HTML rendering in Python"
5+
authors = [
6+
{name="Keith Philpott"}
7+
]
108
classifiers = [
119
'Development Status :: 5 - Production/Stable',
1210
'Environment :: Console',
@@ -21,7 +19,15 @@ classifiers = [
2119
'Topic :: Utilities',
2220
'Typing :: Typed'
2321
]
22+
keywords=["html", "type hints"]
23+
readme="README.md"
24+
requires-python = ">=3.9"
25+
26+
[project.urls]
27+
Homepage="https://github.com/keithasaurus/simple_html"
2428

29+
[tool.setuptools]
30+
packages = ["simple_html"]
2531

2632
[tool.poetry.dependencies]
2733
python = "^3.9"
@@ -40,6 +46,7 @@ ruff = "0.12.8"
4046
requires = [
4147
"poetry-core>=1.0.0",
4248
"mypy[mypyc]==1.17.1",
49+
"tomli==2.2.1"
4350
]
4451

4552
[tool.mypy]

setup.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1+
try:
2+
import tomllib
3+
except ModuleNotFoundError:
4+
# python 3.10 and earlier
5+
import tomli as tomllib
6+
7+
from pathlib import Path
18
from setuptools import setup
29
from mypyc.build import mypycify
310

4-
ext_modules = mypycify([
5-
"simple_html/utils.py",
6-
])
11+
this_directory = Path(__file__).parent
12+
long_description = (this_directory / "README.md").read_text()
13+
14+
with open(this_directory / "pyproject.toml", "rb") as f:
15+
toml_data = tomllib.load(f)
16+
17+
project_data = toml_data["project"]
718

819
setup(
9-
name="simple_html",
10-
ext_modules=ext_modules,
20+
name="simple-html",
21+
ext_modules=mypycify([
22+
"simple_html/utils.py",
23+
]),
24+
author=project_data["authors"][0]["name"],
1125
packages=["simple_html"],
12-
python_requires=">=3.9",
26+
python_requires=project_data["requires-python"],
27+
version=project_data["version"],
28+
description=project_data["description"],
29+
long_description=long_description,
30+
long_description_content_type='text/markdown',
31+
license ="MIT",
32+
url=project_data["urls"]["Homepage"],
33+
classifiers = project_data["classifiers"],
34+
keywords=["html", "type hints"]
1335
)

0 commit comments

Comments
 (0)