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

This commit is contained in:
Lance Edgar 2024-06-10 16:23:38 -05:00
parent dd58c640fa
commit 1402d437b5
6 changed files with 122 additions and 132 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
*~
*.pyc
.coverage
.tox/
dist/

101
pyproject.toml Normal file
View file

@ -0,0 +1,101 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "Tailbone"
version = "0.10.16"
description = "Backoffice Web Application for Rattail"
readme = "README.rst"
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
license = {text = "GNU GPL v3+"}
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Pyramid",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Office/Business",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"asgiref",
"colander",
"ColanderAlchemy",
"cornice",
"cornice-swagger",
"deform",
"humanize",
"Mako",
"markdown",
"openpyxl",
"paginate",
"paginate_sqlalchemy",
"passlib",
"Pillow",
"pyramid>=2",
"pyramid_beaker",
"pyramid_deform",
"pyramid_exclog",
"pyramid_fanstatic",
"pyramid_mako",
"pyramid_retry",
"pyramid_tm",
"rattail[db,bouncer]",
"six",
"sa-filters",
"simplejson",
"transaction",
"waitress",
"WebHelpers2",
"zope.sqlalchemy",
]
[project.optional-dependencies]
docs = ["Sphinx", "sphinx-rtd-theme"]
tests = ["coverage", "mock", "pytest", "pytest-cov"]
[project.entry-points."paste.app_factory"]
main = "tailbone.app:main"
webapi = "tailbone.webapi:main"
[project.entry-points."rattail.cleaners"]
beaker = "tailbone.cleanup:BeakerCleaner"
[project.entry-points."rattail.config.extensions"]
tailbone = "tailbone.config:ConfigExtension"
[project.urls]
Homepage = "https://rattailproject.org"
Repository = "https://kallithea.rattailproject.org/rattail-project/tailbone"
Issues = "https://redmine.rattailproject.org/projects/tailbone/issues"
Changelog = "https://kallithea.rattailproject.org/rattail-project/tailbone/files/master/CHANGES.rst"
[tool.commitizen]
version_provider = "pep621"
tag_format = "v$version"
update_changelog_on_bump = true
# [tool.hatch.build.targets.wheel]
# packages = ["corepos"]

101
setup.cfg
View file

@ -1,101 +0,0 @@
# -*- coding: utf-8; -*-
[nosetests]
nocapture = 1
cover-package = tailbone
cover-erase = 1
cover-html = 1
cover-html-dir = htmlcov
[metadata]
name = Tailbone
version = attr: tailbone.__version__
author = Lance Edgar
author_email = lance@edbob.org
url = http://rattailproject.org/
license = GNU GPL v3
description = Backoffice Web Application for Rattail
long_description = file: README.rst
classifiers =
Development Status :: 4 - Beta
Environment :: Web Environment
Framework :: Pyramid
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Internet :: WWW/HTTP
Topic :: Office/Business
Topic :: Software Development :: Libraries :: Python Modules
[options]
install_requires =
asgiref
colander
ColanderAlchemy
cornice
cornice-swagger
deform
humanize
Mako
markdown
openpyxl
paginate
paginate_sqlalchemy
passlib
Pillow
pyramid>=2
pyramid_beaker
pyramid_deform
pyramid_exclog
pyramid_fanstatic
pyramid_mako
pyramid_retry
pyramid_tm
rattail[db,bouncer]
six
sa-filters
simplejson
transaction
waitress
WebHelpers2
zope.sqlalchemy
tests_require = Tailbone[tests]
test_suite = tests
packages = find:
include_package_data = True
zip_safe = False
[options.packages.find]
exclude =
tests.*
tests
[options.extras_require]
docs = Sphinx; sphinx-rtd-theme
tests = coverage; mock; pytest; pytest-cov
[options.entry_points]
paste.app_factory =
main = tailbone.app:main
webapi = tailbone.webapi:main
rattail.cleaners =
beaker = tailbone.cleanup:BeakerCleaner
rattail.config.extensions =
tailbone = tailbone.config:ConfigExtension

View file

@ -1,29 +0,0 @@
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
# Rattail 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.
#
# Rattail 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
# Rattail. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
"""
Setup script for Tailbone
"""
from setuptools import setup
setup()

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8; -*-
__version__ = '0.10.16'
try:
from importlib.metadata import version
except ImportError:
from importlib_metadata import version
__version__ = version('Tailbone')

View file

@ -25,13 +25,24 @@ Tasks for Tailbone
"""
import os
import re
import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'tailbone', '_version.py')).read())
__version__ = None
pattern = re.compile(r'^version = "(\d+\.\d+\.\d+)"$')
with open(os.path.join(here, 'pyproject.toml'), 'rt') as f:
for line in f:
line = line.rstrip('\n')
match = pattern.match(line)
if match:
__version__ = match.group(1)
break
if not __version__:
raise RuntimeError("could not parse version!")
@task