8
8
To upload the binary wheel to PyPi
9
9
twine upload dist/*.whl
10
10
To upload the source distribution to PyPi
11
- python setup.py sdist
12
- twine upload dist/bgs -*.tar.gz
11
+ python setup.py sdist
12
+ twine upload dist/pybgs -*.tar.gz
13
13
"""
14
14
import os
15
15
import re
21
21
from setuptools .command .build_ext import build_ext
22
22
from distutils .version import LooseVersion
23
23
24
+ #import datetime
25
+ #now = datetime.datetime.now()
26
+ #
27
+ #pkg_properties={}
28
+ #with open('.properties') as fp:
29
+ # for line in fp:
30
+ # if '=' in line:
31
+ # name, value = line.replace('\n','').split('=', 1)
32
+ # if "SNAPSHOT" in value:
33
+ # dev_version = "." + now.strftime("%y%m%d%H%M") + ".dev"
34
+ # value = value.replace("-SNAPSHOT", dev_version)
35
+ # pkg_properties[name] = value
36
+
24
37
25
38
class CMakeExtension (Extension ):
26
39
def __init__ (self , name , sourcedir = '' ):
@@ -38,8 +51,8 @@ def run(self):
38
51
39
52
if platform .system () == "Windows" :
40
53
cmake_version = LooseVersion (re .search (r'version\s*([\d.]+)' , out .decode ()).group (1 ))
41
- if cmake_version < '3.1 .0' :
42
- raise RuntimeError ("CMake >= 3.1 .0 is required on Windows" )
54
+ if cmake_version < '3.10 .0' :
55
+ raise RuntimeError ("CMake >= 3.10 .0 is required on Windows" )
43
56
44
57
for ext in self .extensions :
45
58
self .build_extension (ext )
@@ -62,7 +75,7 @@ def build_extension(self, ext):
62
75
build_args += ['--' , '/m' ]
63
76
else :
64
77
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg ]
65
- build_args += ['--' , '-j2 ' ]
78
+ build_args += ['--' , '-j8 ' ]
66
79
67
80
env = os .environ .copy ()
68
81
env ['CXXFLAGS' ] = '{} -DVERSION_INFO=\\ "{}\\ "' .format (env .get ('CXXFLAGS' , '' ),
@@ -71,21 +84,26 @@ def build_extension(self, ext):
71
84
os .makedirs (self .build_temp )
72
85
subprocess .check_call (['cmake' , ext .sourcedir ] + cmake_args , cwd = self .build_temp , env = env )
73
86
subprocess .check_call (['cmake' , '--build' , '.' ] + build_args , cwd = self .build_temp )
74
- #subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd="./build", env=env)
75
- #subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd="./build")
87
+ print ()
88
+
89
+ with open ("README.md" , "r" ) as fh :
90
+ long_description = fh .read ()
76
91
77
92
setup (
78
- name = 'bgs' ,
79
- version = '2.0.0' ,
93
+ name = 'pybgs' ,
94
+ version = '3.0.0' ,
95
+ #version=pkg_properties["version"],
80
96
author = 'Andrews Sobral' ,
81
97
author_email = 'andrewssobral@gmail.com' ,
82
98
url = 'https://github.com/andrewssobral/bgslibrary' ,
83
- license = 'GPL v3 ' ,
99
+ license = 'MIT ' ,
84
100
description = 'Python wrapper for bgslibrary using pybind11 and CMake' ,
85
- long_description = '' ,
86
- ext_modules = [CMakeExtension ('bgs' )],
101
+ long_description = long_description ,
102
+ long_description_content_type = "text/markdown" ,
103
+ ext_modules = [CMakeExtension ('src' )],
87
104
cmdclass = dict (build_ext = CMakeBuild ),
88
105
zip_safe = False ,
89
- packages = find_packages (),
106
+ #packages=find_packages('pybgs'),
107
+ #package_dir={'':'pybgs'},
90
108
keywords = ['BGSLibrary' , 'Background Subtraction' , 'Computer Vision' , 'Machine Learning' ],
91
109
)
0 commit comments