Skip to content

Commit

Permalink
- use a version text file to make determining the version easier for …
Browse files Browse the repository at this point in the history
…Sphinx
  • Loading branch information
dataflake committed Jun 10, 2018
1 parent 14832ba commit d081708
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 6 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
#
import datetime
import os
import pkg_resources
import sys
# sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('../'))
rqmt = pkg_resources.require('Products.ZMySQLDA')[0]

parent = os.path.dirname(os.path.dirname(__file__))
parent_dir = os.path.abspath(parent)
with open(os.path.join(parent_dir, 'version.txt'), 'r') as version_file:
pkg_version = version_file.read().strip()

# -- Project information -----------------------------------------------------
year = datetime.datetime.now().year
Expand All @@ -28,9 +29,9 @@
author = 'Zope Foundation and Contributors'

# The short X.Y version
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
version = pkg_version.replace('.dev0', '')
# The full version, including alpha/beta/rc tags
release = rqmt.version
release = pkg_version


# -- General configuration ---------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
##############################################################################
from setuptools import setup, find_packages

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

setup(
name="Products.ZMySQLDA",
version="4.0.dev0",
version=read('version.txt').strip(),
license="ZPL 2.1",
author="HOFFMANN+LIEBENBERG in association with "
"SNTL Publishing, Andy Dustman, John Eikenberry",
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.dev0

0 comments on commit d081708

Please sign in to comment.