Skip to content

Commit

Permalink
Fix version path stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuabach committed Jan 7, 2024
1 parent cf66587 commit bbe252b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/README.md
4 changes: 2 additions & 2 deletions src/gnucash_web/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Flask app for GnuCash Web."""
import os
from importlib import metadata
from pathlib import Path

from flask import Flask, redirect, url_for
from flask.cli import FlaskGroup
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

with open('gnucash_web/version.txt') as version:
with (Path(__file__).parent / 'version.txt').open() as version:
app.jinja_env.globals['pkg_version'] = version.read().strip()

app.register_blueprint(auth.bp)
Expand Down
2 changes: 1 addition & 1 deletion src/gnucash_web/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1
0.1.4
4 changes: 2 additions & 2 deletions src/setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!python
from setuptools import setup, find_packages
from os.path import exists
import pathlib

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

setup(
name='GnuCash Web',
name='gnucash_web',
version=version.read().strip(),
author='Joshua Bachmeier',
author_email='[email protected]',
Expand Down Expand Up @@ -38,6 +37,7 @@
packages=find_packages(),
package_data={
'gnucash_web': [
'version.txt',
'templates/*.j2',
'static/*.js', 'static/*.css',
'static/bootstrap/css/*.min.css',
Expand Down

0 comments on commit bbe252b

Please sign in to comment.