from setuptools import setup
from wheel.bdist_wheel import bdist_wheel
from datetime import datetime
from subprocess import Popen, PIPE
from distutils.util import get_platform
from distutils.core import Extension, Distribution
version_args = list(filter(lambda x: x.startswith('--build='),sys.argv))
if len(version_args) > 1:
datetime.now().timetuple().tm_yday
print("only one '--build=<num>.<num>.<num>' parameter can be specified")
if len(version_args) != 0:
version_arg=version_args.pop(0).split("=")[1]
print (version_arg.split("."))
(major, minor, patch) = version_arg.split(".")
return(int(major), int(minor), int(patch))
proc = Popen( [ "../../scripts/version" ], stdout=PIPE, stderr=PIPE )
out,err = proc.communicate( )
(major, minor, patch) = out.decode("utf-8").split(".")
print((major,minor, patch))
return(int(major), int(minor), int(patch))
(casaviewer_major,casaviewer_minor, casaviewer_patch) = compute_version( )
casaviewer_version = '%d.%d.%d' % (casaviewer_major,casaviewer_minor,casaviewer_patch)
for root, directories, filenames in os.walk(dir):
r = os.path.join(*root.split(os.sep)[1:])
for filename in filenames:
acc.append(os.path.join(r,filename))
class BinaryDistribution(Distribution):
user_options = bdist_wheel.user_options + [
('build=', None, 'specify build number') ]
def initialize_options(self):
Distribution.initialize_options(self)
self.build=casaviewer_version
"""Distribution which always forces a binary package with platform name"""
def has_ext_modules(foo):
class BdistWheel(bdist_wheel):
user_options = bdist_wheel.user_options + [
('build=', None, 'specify build number') ]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.build=casaviewer_version