Skip to content

Commit

Permalink
Set python package version from C header
Browse files Browse the repository at this point in the history
  • Loading branch information
bgermann authored and tim-eves committed Sep 6, 2018
1 parent d9be1d8 commit 6a25418
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python

from re import findall
from os import path
from io import open
try:
Expand All @@ -10,10 +11,14 @@
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, 'include/graphite2/Font.h')) as f:
c_header = f.read()
major, minor, bug = findall('define GR2_VERSION_[A-X]+\s+(\d+)', c_header)
version = major + "." + minor + "." + bug

setup(
name = 'graphite2',
version = '1.3.11',
version = version,
description = 'SIL graphite2 smart font system python bindings',
author = 'SIL International',
license = 'LGPL-2.1+ OR MPL-1.1+',
Expand Down

0 comments on commit 6a25418

Please sign in to comment.