Use __version__.py instead of VERSION.txt

This commit is contained in:
Manuel Ebert 2019-12-01 19:41:16 -08:00
parent 80b376b4fb
commit 45384f3c8f
4 changed files with 6 additions and 10 deletions

2
.gitignore vendored
View file

@ -52,4 +52,4 @@ exp/
_extras/
*.sublime-*
site/
jrnl/VERSION.txt
jrnl/__version__.py

View file

@ -13,7 +13,7 @@ script:
before_deploy:
- pip install poetry
- poetry config http-basic.pypi $PYPI_USER $PYPI_PASS
- echo $TRAVIS_TAG > jrnl/VERSION.txt
- echo __version__ = \"$TRAVIS_TAG\" > jrnl/__version__.py
- poetry version $TRAVIS_TAG
- poetry build
deploy:

View file

@ -2,11 +2,8 @@
# encoding: utf-8
import os
try:
from .__version__ import __version__
except ImportError:
__version__ = "source"
__title__ = "jrnl"
__version__ = "source"
version_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION.txt")
if os.path.exists(version_path):
with open(version_path) as version_file:
__version__ = version_file.read()

View file

@ -11,7 +11,6 @@ license = "MIT"
readme = "README.md"
homepage = "https://jrnl.sh"
repository = "https://github.com/jrnl-org/jrnl"
include = ["VERSION.txt"]
[tool.poetry.dependencies]
python = "^3.7"