feat: switch from setup.cfg to pyproject.toml + hatchling

This commit is contained in:
Lance Edgar 2024-06-10 21:29:46 -05:00
parent 783e5770f1
commit 92285dcbc1
6 changed files with 78 additions and 86 deletions

3
.gitignore vendored
View file

@ -1,2 +1,5 @@
*~
*.pyc
Messkit.egg-info/ Messkit.egg-info/
dist/
docs/_build/ docs/_build/

View file

@ -1,3 +1,6 @@
# -*- coding: utf-8; -*- # -*- coding: utf-8; -*-
__version__ = '0.1.8' from importlib.metadata import version
__version__ = version('Messkit')

67
pyproject.toml Normal file
View file

@ -0,0 +1,67 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "Messkit"
version = "0.1.8"
description = "Generic-ish Data Utility App"
readme = "README.rst"
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Environment :: Web Environment",
"Framework :: Pyramid",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Office/Business",
]
dependencies = [
# TODO: user should get to choose which of these is needed?
"mysql-connector-python",
"psycopg2",
"prompt_toolkit",
"rich",
"Sphinx",
"Tailbone",
"typer",
]
[project.scripts]
messkit = "messkit.commands:messkit_typer"
[project.entry-points."paste.app_factory"]
main = "messkit.web.app:main"
[project.entry-points."rattail.config.extensions"]
messkit = "messkit.config:MesskitConfig"
[project.urls]
Homepage = "https://redmine.rattailproject.org/projects/messkit"
Repository = "https://kallithea.rattailproject.org/rattail-project/messkit"
Issues = "https://redmine.rattailproject.org/projects/messkit/issues"
Changelog = "https://kallithea.rattailproject.org/rattail-project/messkit/files/master/CHANGELOG.md"
[tool.commitizen]
version_provider = "pep621"
tag_format = "v$version"
update_changelog_on_bump = true
# [tool.hatch.build.targets.sdist]
# exclude = [
# "machines/",
# ]

View file

@ -1,50 +0,0 @@
# -*- coding: utf-8; -*-
[metadata]
name = Messkit
version = attr: messkit.__version__
author = Lance Edgar
author_email = lance@edbob.org
url = https://rattailproject.org
description = Generic-ish Data Utility App
long_description = file: README.rst
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Environment :: Web Environment
Framework :: Pyramid
Intended Audience :: Developers
Natural Language :: English
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Office/Business
[options]
install_requires =
# TODO: user should get to choose which of these is needed?
mysql-connector-python
psycopg2
prompt_toolkit
rich
Sphinx
Tailbone
typer
packages = find:
include_package_data = True
[options.entry_points]
console_scripts =
messkit = messkit.commands:messkit_typer
paste.app_factory =
main = messkit.web.app:main
rattail.config.extensions =
messkit = messkit.config:MesskitConfig

View file

@ -1,29 +0,0 @@
# -*- coding: utf-8; -*-
######################################################################
#
# Messkit -- Generic-ish Data Utility App
# Copyright © 2022-2023 Lance Edgar
#
# This file is part of Messkit.
#
# Messkit is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Messkit is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Messkit. If not, see <http://www.gnu.org/licenses/>.
#
######################################################################
"""
Messkit setup script
"""
from setuptools import setup
setup()

View file

@ -9,19 +9,17 @@ import shutil
from invoke import task from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'messkit', '_version.py')).read())
@task @task
def release(c): def release(c):
""" """
Release a new version of Messkit Release a new version of Messkit
""" """
# rebuild local tar.gz file for distribution # rebuild package
if os.path.exists('dist'):
shutil.rmtree('dist')
if os.path.exists('Messkit.egg-info'): if os.path.exists('Messkit.egg-info'):
shutil.rmtree('Messkit.egg-info') shutil.rmtree('Messkit.egg-info')
c.run('python -m build --sdist') c.run('python -m build --sdist')
# upload to public PyPI # upload to public PyPI
c.run('twine upload dist/Messkit-{}.tar.gz'.format(__version__)) c.run('twine upload dist/*')