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

This commit is contained in:
Lance Edgar 2024-06-10 22:04:05 -05:00
parent 2ab7cf04c6
commit 7089ced72b
6 changed files with 70 additions and 82 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
*~
*.pyc
dist/
rattail_mailchimp.egg-info/ rattail_mailchimp.egg-info/

58
pyproject.toml Normal file
View file

@ -0,0 +1,58 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "rattail-mailchimp"
version = "0.2.1"
description = "Rattail Software Interfaces for MailChimp"
readme = "README.rst"
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
license = {text = "GNU GPL v3+"}
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Web Environment",
"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",
"Topic :: Office/Business",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"mailchimp3",
"rattail",
]
[project.entry-points."rattail.config.extensions"]
rattail_mailchimp = "rattail_mailchimp.config:MailchimpConfigExtension"
[project.entry-points."rattail.subcommands"]
import-mailchimp = "rattail_mailchimp.commands:ImportMailChimp"
[project.entry-points."rattail.typer_imports"]
rattail_mailchimp = "rattail_mailchimp.commands"
[project.entry-points."rattail.emails"]
rattail_mailchimp = "rattail_mailchimp.emails"
[project.urls]
Homepage = "https://rattailproject.org"
Repository = "https://kallithea.rattailproject.org/rattail-project/rattail-mailchimp"
Changelog = "https://kallithea.rattailproject.org/rattail-project/rattail-mailchimp/files/master/CHANGELOG.md"
[tool.commitizen]
version_provider = "pep621"
tag_format = "v$version"
update_changelog_on_bump = true

View file

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

View file

@ -1,48 +0,0 @@
# -*- coding: utf-8; -*-
[metadata]
name = rattail-mailchimp
version = attr: rattail_mailchimp.__version__
author = Lance Edgar
author_email = lance@edbob.org
url = https://rattailproject.org/
license = GNU GPL v3
description = Rattail Software Interfaces for MailChimp
long_description = file: README.rst
classifiers =
Development Status :: 4 - Beta
Environment :: Console
Environment :: Web Environment
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
Topic :: Office/Business
Topic :: Software Development :: Libraries :: Python Modules
[options]
install_requires =
mailchimp3
rattail
packages = find:
include_package_data = True
zip_safe = False
[options.entry_points]
rattail.config.extensions =
rattail_mailchimp = rattail_mailchimp.config:MailchimpConfigExtension
rattail.subcommands =
import-mailchimp = rattail_mailchimp.commands:ImportMailChimp
rattail.typer_imports =
rattail_mailchimp = rattail_mailchimp.commands
rattail.emails =
rattail_mailchimp = rattail_mailchimp.emails

View file

@ -1,26 +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/>.
#
################################################################################
from setuptools import setup
setup()

View file

@ -30,17 +30,15 @@ import shutil
from invoke import task from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'rattail_mailchimp', '_version.py')).read())
@task @task
def release(c): def release(c):
""" """
Release a new version of 'rattail-mailchimp'. Release a new version of 'rattail-mailchimp'.
""" """
if os.path.exists('dist'):
shutil.rmtree('dist')
if os.path.exists('rattail_mailchimp.egg-info'):
shutil.rmtree('rattail_mailchimp.egg-info') shutil.rmtree('rattail_mailchimp.egg-info')
c.run('python -m build --sdist') c.run('python -m build --sdist')
filename = f'rattail_mailchimp-{__version__}.tar.gz' c.run('twine upload dist/*')
c.run('twine upload dist/{}'.format(filename))