Migrate setup.py to pyproject.toml

This commit is contained in:
Ivan Habunek 2024-04-13 08:49:25 +02:00
parent 0fc2ec12f5
commit f925199781
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
3 changed files with 92 additions and 77 deletions

86
pyproject.toml Normal file
View File

@ -0,0 +1,86 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "toot"
authors = [{ name="Ivan Habunek", email="ivan@habunek.com" }]
description = "Mastodon CLI client"
readme = "README.rst"
license = { file="LICENSE" }
requires-python = ">=3.7"
dynamic = ["version"]
classifiers = [
"Environment :: Console :: Curses",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = [
"beautifulsoup4>=4.5.0,<5.0",
"click~=8.1",
"requests>=2.13,<3.0",
"tomlkit>=0.10.0,<1.0",
"urwid>=2.0.0,<3.0",
"wcwidth>=0.1.7",
]
[project.optional-dependencies]
# Required to display images in the TUI
images = [
"pillow>=9.5.0",
"term-image==0.7.0",
]
# Required to display rich text in the TUI
richtext = [
"urwidgets>=0.1,<0.2"
]
test = [
"flake8",
"psycopg2-binary",
"pytest",
"pytest-xdist[psutil]",
"setuptools",
"vermin",
"typing-extensions",
"pillow>=9.5.0",
]
dev = [
"build",
"flake8",
"mypy",
"pyright",
"pyyaml",
"textual-dev",
"twine",
"types-beautifulsoup4",
"vermin",
]
[project.urls]
"Homepage" = "https://toot.bezdomni.net"
"Source" = "https://github.com/ihabunek/toot/"
[project.scripts]
toot = "toot.cli:cli"
[tool.setuptools]
packages=[
"toot",
"toot.cli",
"toot.tui",
"toot.tui.richtext",
"toot.utils"
]
[tool.setuptools_scm]
[tool.pyright]
include = ["toot"]
typeCheckingMode = "strict"

View File

@ -1,76 +0,0 @@
#!/usr/bin/env python
from setuptools import setup
long_description = """
Toot is a CLI and TUI tool for interacting with Mastodon instances from the
command line.
Allows posting text and media to the timeline, searching, following, muting
and blocking accounts and other actions.
"""
setup(
name='toot',
version='0.42.0',
description='Mastodon CLI client',
long_description=long_description.strip(),
author='Ivan Habunek',
author_email='ivan@habunek.com',
url='https://github.com/ihabunek/toot/',
project_urls={
'Documentation': 'https://toot.bezdomni.net/',
'Issue tracker': 'https://github.com/ihabunek/toot/issues/',
},
keywords='mastodon toot',
license='GPLv3',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console :: Curses',
'Environment :: Console',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 3',
],
packages=['toot', 'toot.cli', 'toot.tui', 'toot.tui.richtext', 'toot.utils'],
python_requires=">=3.7",
install_requires=[
"click~=8.1",
"requests>=2.13,<3.0",
"beautifulsoup4>=4.5.0,<5.0",
"wcwidth>=0.1.7",
"urwid>=2.0.0,<3.0",
"tomlkit>=0.10.0,<1.0",
],
extras_require={
# Required to display images in the TUI
"images": [
"pillow>=9.5.0",
"term-image==0.7.0",
],
# Required to display rich text in the TUI
"richtext": [
"urwidgets>=0.1,<0.2"
],
"dev": [
"coverage",
"pyyaml",
"twine",
"wheel",
],
"test": [
"flake8",
"psycopg2-binary",
"pytest",
"pytest-xdist[psutil]",
"setuptools",
"vermin",
"typing-extensions",
"pillow>=9.5.0",
],
},
entry_points={
'console_scripts': [
'toot=toot.cli:cli',
],
}
)

View File

@ -3,8 +3,13 @@ import sys
from os.path import join, expanduser
from typing import NamedTuple
from importlib import metadata
__version__ = '0.42.0'
try:
__version__ = metadata.version("toot")
except metadata.PackageNotFoundError:
__version__ = "0.0.0"
class App(NamedTuple):