Files @ db59d2fc8ceb
Branch filter:

Location: NPO-Accounting/import2ledger/setup.py

Brett Smith
hooks.ledger_entry: Look up templates dynamically.

If there's a 'ledger entry' key in the entry data, use that value as the
name of the template to load. Thanks to this, nbpy2017 could collapse
multiple importers into one.

Otherwise, build a default template name based on the importer source, and
try to use that.

All the configuration names now end with "ledger entry" instead of starting
with "template". This makes it clearer what they're for, in case we
support other kinds of output templates in the future.

I ended up changing the names of some of the importers so the default
template name was nice, rather than specifying template names for all of
them, to reduce the amount of name discrepancies across the codebase.
#!/usr/bin/env python3

import itertools
import sys

from setuptools import setup, find_packages

REQUIREMENTS = {
    'install_requires': ['babel'],
    'setup_requires': ['pytest-runner'],
    'extras_require': {
        'nbpy2017': ['beautifulsoup4', 'html5lib'],
    },
}

if sys.version_info < (3, 4):
    REQUIREMENTS['install_requires'].extend(['enum34'])

REQUIREMENTS['tests_require'] = [
    'pytest',
    'PyYAML',
    *itertools.chain(*REQUIREMENTS['extras_require'].values()),
]

setup(
    name='import2ledger',
    description="Import different sources of financial data to Ledger",
    version='0.2',
    author='Brett Smith',
    author_email='brettcsmith@brettcsmith.org',
    license='GNU AGPLv3+',

    packages=find_packages(include=['import2ledger', 'import2ledger.*']),
    entry_points={
        'console_scripts': ['import2ledger = import2ledger.__main__:main'],
    },

    **REQUIREMENTS,
)