diff --git a/.gitignore b/.gitignore index 2382cabe..b14464d0 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ exp/ _extras/ *.sublime-* site/ +jrnl/VERSION.txt diff --git a/.travis.yml b/.travis.yml index fea48f50..3eda0c9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ script: before_deploy: - pip install poetry - poetry config http-basic.pypi $PYPI_USER $PYPI_PASS + - echo $TRAVIS_TAG > jrnl/VERSION.txt - poetry version $TRAVIS_TAG - poetry build deploy: diff --git a/jrnl/__init__.py b/jrnl/__init__.py index 57664dbb..f1cdc3c4 100644 --- a/jrnl/__init__.py +++ b/jrnl/__init__.py @@ -1,9 +1,12 @@ #!/usr/bin/env python # encoding: utf-8 -import pkg_resources +import os -dist = pkg_resources.get_distribution('jrnl') -__title__ = dist.project_name -__version__ = dist.version +__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() diff --git a/pyproject.toml b/pyproject.toml index 1b84acde..df18f9da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ 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"