Skip to content

Commit 94285bc

Browse files
Christian ToepferChristian Toepfer
authored andcommitted
add version for generated package using datetime
1 parent 99c5fad commit 94285bc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pyrobuf/compile.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import sys
55
from setuptools import setup
6+
from datetime import datetime
67

78
from Cython.Build import cythonize
89
from Cython.Distutils import build_ext
@@ -18,6 +19,9 @@
1819

1920
_VM = sys.version_info.major
2021

22+
THE_TIME = datetime.now()
23+
VERSION = f'''{THE_TIME.year}.{THE_TIME.month}.{THE_TIME.day}'''\
24+
f'''{THE_TIME.hour*3600+THE_TIME.minute*60+THE_TIME.second}'''
2125

2226
class BasePackagePatch_BuildExt(build_ext):
2327
""" Create __init__.py for base package, after build
@@ -101,10 +105,11 @@ def compile(self):
101105
self._package()
102106

103107
setup(name='pyrobuf-generated' if not self.package else self.package,
104-
ext_modules=cythonize(self._pyx_files,
108+
version=VERSION,
109+
ext_modules=cythonize(self._pyx_files,
105110
include_path=self.include_path),
106-
cmdclass= dict(build_ext=BasePackagePatch_BuildExt),
107-
script_args=script_args)
111+
cmdclass= dict(build_ext=BasePackagePatch_BuildExt),
112+
script_args=script_args)
108113

109114
def extend(self, dist):
110115
self._compile_spec()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111

1212

13-
VERSION = "0.9.3.8"
13+
VERSION = "0.9.3.9"
1414
HERE = os.path.dirname(os.path.abspath(__file__))
1515
PYROBUF_DEFS_PXI = "pyrobuf_defs.pxi"
1616
PYROBUF_LIST_PXD = "pyrobuf_list.pxd"

0 commit comments

Comments
 (0)