Skip to content

Commit

Permalink
script to build pypi package
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Jun 16, 2020
1 parent 8c9bcc3 commit fabb3e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ PythonAPI/pycocotools/_mask.so
PythonAPI/pycocotools/coco.pyc
PythonAPI/pycocotools/cocoeval.pyc
PythonAPI/pycocotools/mask.pyc

dist/
*.egg-info
1 change: 1 addition & 0 deletions PythonAPI/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft ./common
1 change: 1 addition & 0 deletions PythonAPI/common
22 changes: 16 additions & 6 deletions PythonAPI/setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
from setuptools import setup, Extension
import numpy as np

from setuptools import dist, setup, Extension
# To compile and install locally run "python setup.py build_ext --inplace"
# To install library to Python site-packages run "python setup.py build_ext install"


setup_requires=[
'setuptools>=18.0',
'cython>=0.27.3',
'numpy',
]
dist.Distribution().fetch_build_eggs(setup_requires)

import numpy as np

ext_modules = [
Extension(
'pycocotools._mask',
sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../common'],
sources=['./common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), './common'],
extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
)
]

setup(
name='pycocotools',
description='Official APIs for the MS-COCO dataset',
packages=['pycocotools'],
package_dir = {'pycocotools': 'pycocotools'},
setup_requires=setup_requires,
install_requires=[
'setuptools>=18.0',
'cython>=0.27.3',
'matplotlib>=2.1.0'
],
version='2.0',
version='2.0.1',
ext_modules= ext_modules
)

0 comments on commit fabb3e2

Please sign in to comment.