Compare commits

..

No commits in common. "master" and "v0.1.13" have entirely different histories.

11 changed files with 99 additions and 134 deletions

3
.gitignore vendored
View file

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

View file

@ -5,45 +5,6 @@ All notable changes to rattail-nationbuilder will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## v0.3.4 (2024-08-19)
### Fix
- avoid deprecated method in app provider
- avoid deprecated base class for config extension
## v0.3.3 (2024-08-19)
### Fix
- avoid deprecated import for `parse_list()`
## v0.3.2 (2024-08-13)
### Fix
- update app provider entry point, per wuttjamaican
## v0.3.1 (2024-07-01)
### Fix
- remove legacy command definitions
## v0.3.0 (2024-06-10)
### Feat
- switch from setup.cfg to pyproject.toml + hatchling
## [0.2.0] - 2024-05-29
### Changed
- Migrate all commands to use `typer`.
## [0.1.14] - 2023-12-01
### Changed
- Update subcommand entry point group names, per wuttjamaican.
## [0.1.13] - 2023-09-16
### Changed
- Limit page size to 100, for fetching Person records from NB API.

View file

@ -1,55 +0,0 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "rattail-nationbuilder"
version = "0.3.4"
description = "Rattail integration package for NationBuilder"
readme = "README.md"
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
license = {text = "GNU GPL v3+"}
classifiers = [
"Development Status :: 4 - Beta",
"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 = [
"rattail",
]
[project.entry-points."rattail.typer_imports"]
rattail_nationbuilder = "rattail_nationbuilder.commands"
[project.entry-points."rattail.config.extensions"]
rattail_nationbuilder = "rattail_nationbuilder.config:RattailNationBuilderExtension"
[project.entry-points."rattail.importing"]
"to_rattail.from_nationbuilder.import" = "rattail_nationbuilder.importing.nationbuilder:FromNationBuilderToRattail"
[project.entry-points."wutta.app.providers"]
rattail_nationbuilder = "rattail_nationbuilder.app:NationBuilderProvider"
[project.urls]
Homepage = "https://rattailproject.org"
Repository = "https://forgejo.wuttaproject.org/rattail/rattail-nationbuilder"
Changelog = "https://forgejo.wuttaproject.org/rattail/rattail-nationbuilder/src/branch/master/CHANGELOG.md"
[tool.commitizen]
version_provider = "pep621"
tag_format = "v$version"
update_changelog_on_bump = true

View file

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

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -36,7 +36,7 @@ class NationBuilderProvider(RattailProvider):
if 'nationbuilder' not in self.handlers:
spec = self.config.get('rattail', 'nationbuilder.handler',
default='rattail_nationbuilder.app:NationBuilderHandler')
factory = self.app.load_object(spec)
factory = self.load_object(spec)
self.handlers['nationbuilder'] = factory(self.config, **kwargs)
return self.handlers['nationbuilder']

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,25 +24,13 @@
rattail-nationbuilder commands
"""
import typer
from rattail.commands import rattail_typer
from rattail.commands.typer import importer_command, typer_get_runas_user
from rattail.commands.importing import ImportCommandHandler
from rattail import commands
@rattail_typer.command()
@importer_command
def import_nationbuilder(
ctx: typer.Context,
**kwargs
):
class ImportNationBuilder(commands.ImportSubcommand):
"""
Import data for NationBuilder => Rattail
"""
config = ctx.parent.rattail_config
progress = ctx.parent.rattail_progress
handler = ImportCommandHandler(
config, import_handler_key='to_rattail.from_nationbuilder.import')
kwargs['user'] = typer_get_runas_user(ctx)
handler.run(kwargs, progress=progress)
name = 'import-nationbuilder'
description = __doc__.strip()
handler_key = 'to_rattail.from_nationbuilder.import'

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,10 +24,10 @@
Config Extension
"""
from wuttjamaican.conf import WuttaConfigExtension
from rattail.config import ConfigExtension
class RattailNationBuilderExtension(WuttaConfigExtension):
class RattailNationBuilderExtension(ConfigExtension):
"""
Config extension for rattail-nationbuilder
"""
@ -36,7 +36,7 @@ class RattailNationBuilderExtension(WuttaConfigExtension):
def configure(self, config):
# rattail import-nationbuilder
config.setdefault('rattail.importing.to_rattail.from_nationbulder.import.default_handler',
config.setdefault('rattail.importing', 'to_rattail.from_nationbulder.import.default_handler',
'rattail_nationbuilder.importing.nationbuilder:FromNationBuilderToRattail')
config.setdefault('rattail.importing.to_rattail.from_nationbuilder.import.default_cmd',
config.setdefault('rattail.importing', 'to_rattail.from_nationbuilder.import.default_cmd',
'rattail import-nationbuilder')

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -27,10 +27,9 @@ NationBuilder cache tables
import sqlalchemy as sa
from sqlalchemy import orm
from wuttjamaican.util import parse_list
from rattail.db import model
from rattail.db.util import normalize_full_name
from rattail.config import parse_list
class NationBuilderCachePerson(model.Base):

44
setup.cfg Normal file
View file

@ -0,0 +1,44 @@
# -*- coding: utf-8; -*-
[metadata]
name = rattail-nationbuilder
version = attr: rattail_nationbuilder.__version__
author = Lance Edgar
author_email = lance@edbob.org
url = https://rattailproject.org/
license = GNU GPL v3
description = Rattail integration package for NationBuilder
long_description = file: README.md
classifiers =
Development Status :: 4 - Beta
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 =
rattail
packages = find:
include_package_data = True
[options.entry_points]
rattail.commands =
import-nationbuilder = rattail_nationbuilder.commands:ImportNationBuilder
rattail.config.extensions =
rattail_nationbuilder = rattail_nationbuilder.config:RattailNationBuilderExtension
rattail.importing =
to_rattail.from_nationbuilder.import = rattail_nationbuilder.importing.nationbuilder:FromNationBuilderToRattail
rattail.providers =
rattail_nationbuilder = rattail_nationbuilder.app:NationBuilderProvider

29
setup.py Normal file
View file

@ -0,0 +1,29 @@
# -*- 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/>.
#
################################################################################
"""
rattail-nationbuilder setup script
"""
from setuptools import setup
setup()

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -30,17 +30,22 @@ import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'rattail_nationbuilder', '_version.py')).read())
@task
def release(c):
"""
Release a new version of rattail-nationbuilder
"""
# rebuild package
if os.path.exists('dist'):
shutil.rmtree('dist')
# rebuild local tar.gz file for distribution
if os.path.exists('rattail_nationbuilder.egg-info'):
shutil.rmtree('rattail_nationbuilder.egg-info')
c.run('python -m build --sdist')
# filename of built package
filename = 'rattail-nationbuilder-{}.tar.gz'.format(__version__)
# upload to PyPI
c.run('twine upload dist/*')
c.run('twine upload dist/{}'.format(filename))