diff --git a/.gitignore b/.gitignore index d6b84d0..f69dfd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +*~ +*.pyc +dist/ rattail_mailchimp.egg-info/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..31913de --- /dev/null +++ b/pyproject.toml @@ -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 diff --git a/rattail_mailchimp/_version.py b/rattail_mailchimp/_version.py index 53d3efe..1c3638a 100644 --- a/rattail_mailchimp/_version.py +++ b/rattail_mailchimp/_version.py @@ -1,3 +1,6 @@ # -*- coding: utf-8; -*- -__version__ = '0.2.1' +from importlib.metadata import version + + +__version__ = version('rattail-mailchimp') diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8425cd6..0000000 --- a/setup.cfg +++ /dev/null @@ -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 diff --git a/setup.py b/setup.py deleted file mode 100644 index 615bc06..0000000 --- a/setup.py +++ /dev/null @@ -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 . -# -################################################################################ - -from setuptools import setup - -setup() diff --git a/tasks.py b/tasks.py index 577dd82..912f111 100644 --- a/tasks.py +++ b/tasks.py @@ -30,17 +30,15 @@ import shutil from invoke import task -here = os.path.abspath(os.path.dirname(__file__)) -exec(open(os.path.join(here, 'rattail_mailchimp', '_version.py')).read()) - - @task def release(c): """ Release a new version of 'rattail-mailchimp'. """ - shutil.rmtree('rattail_mailchimp.egg-info') + if os.path.exists('dist'): + shutil.rmtree('dist') + if os.path.exists('rattail_mailchimp.egg-info'): + shutil.rmtree('rattail_mailchimp.egg-info') c.run('python -m build --sdist') - filename = f'rattail_mailchimp-{__version__}.tar.gz' - c.run('twine upload dist/{}'.format(filename)) + c.run('twine upload dist/*')