Skip to content

Commit

Permalink
Make retrieval of own version number robust against python-weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuabach committed Oct 24, 2023
1 parent 91f7a50 commit baae4b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/gnucash_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from flask.cli import FlaskGroup
import click

from . import auth, book, commodities
from . import auth, book, commodities, __version__
from .utils import jinja as jinja_utils
from .config import GnuCashWebConfig

Expand Down Expand Up @@ -56,7 +56,7 @@ def create_app(test_config=None):
app.jinja_env.filters['nth'] = jinja_utils.nth
app.jinja_env.globals['is_authenticated'] = auth.is_authenticated

app.jinja_env.globals['pkg_version'] = metadata.version('gnucash_web')
app.jinja_env.globals['pkg_version'] = __version__.VERSION

app.register_blueprint(auth.bp)
app.register_blueprint(book.bp)
Expand Down
1 change: 1 addition & 0 deletions src/gnucash_web/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = '0.1.0'
3 changes: 2 additions & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!python
from setuptools import setup, find_packages
from os.path import exists
from . import __version__

readme = open('README.md') if exists('README.md') else open('../README.md')

setup(
name='GnuCash Web',
version='0.1.0',
version=__version__.VERSION,
author='Joshua Bachmeier',
author_email='joshua@bachmeier.cc',
description='A simple, easy to use, mobile-friendly webinterface for GnuCash intended for self-hosting',
Expand Down

0 comments on commit baae4b5

Please sign in to comment.