Update setup.py

This commit is contained in:
tzutalin 2019-05-25 14:29:16 -07:00
parent 8689a16f3d
commit 5b9d2bf9b6
5 changed files with 30 additions and 18 deletions

View File

@ -15,13 +15,13 @@ qt4: qt4py2
qt5: qt5py3 qt5: qt5py3
qt4py2: qt4py2:
pyrcc4 -py2 -o resources.py resources.qrc pyrcc4 -py2 -o lib/resources.py resources.qrc
qt4py3: qt4py3:
pyrcc4 -py3 -o resources.py resources.qrc pyrcc4 -py3 -o lib/resources.py resources.qrc
qt5py3: qt5py3:
pyrcc5 -o resources.py resources.qrc pyrcc5 -o lib/resources.py resources.qrc
clean: clean:
rm -f ~/.labelImgSettings.pkl resources.pyc rm -f ~/.labelImgSettings.pkl resources.pyc

View File

@ -26,8 +26,7 @@ except ImportError:
from PyQt4.QtGui import * from PyQt4.QtGui import *
from PyQt4.QtCore import * from PyQt4.QtCore import *
import resources from libs.resources import *
# Add internal libs
from libs.constants import * from libs.constants import *
from libs.utils import * from libs.utils import *
from libs.settings import Settings from libs.settings import Settings
@ -44,7 +43,6 @@ from libs.pascal_voc_io import XML_EXT
from libs.yolo_io import YoloReader from libs.yolo_io import YoloReader
from libs.yolo_io import TXT_EXT from libs.yolo_io import TXT_EXT
from libs.ustr import ustr from libs.ustr import ustr
from libs.version import __version__
from libs.hashableQListWidgetItem import HashableQListWidgetItem from libs.hashableQListWidgetItem import HashableQListWidgetItem
__appname__ = 'labelImg' __appname__ = 'labelImg'
@ -603,7 +601,7 @@ class MainWindow(QMainWindow, WindowMixin):
elif osName == 'Linux': elif osName == 'Linux':
return ['xdg-open'] return ['xdg-open']
elif osName == 'Darwin': elif osName == 'Darwin':
return ['open', '-a', 'Safari'] return ['open']
## Callbacks ## ## Callbacks ##
def showTutorialDialog(self): def showTutorialDialog(self):

View File

@ -0,0 +1,2 @@
__version_info__ = ('1', '8', '1')
__version__ = '.'.join(__version_info__)

View File

@ -1,2 +0,0 @@
__version_info__ = ('1', '8', '1')
__version__ = '.'.join(__version_info__)

View File

@ -1,9 +1,18 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from setuptools import setup, find_packages from setuptools import setup, find_packages, Command
from libs.version import __version__
from sys import platform as _platform from sys import platform as _platform
from shutil import rmtree
import sys
import os
here = os.path.abspath(os.path.dirname(__file__))
NAME = 'labelImg'
about = {}
with open(os.path.join(here, 'libs', '__init__.py')) as f:
exec(f.read(), about)
with open('README.rst') as readme_file: with open('README.rst') as readme_file:
readme = readme_file.read() readme = readme_file.read()
@ -11,9 +20,14 @@ with open('README.rst') as readme_file:
with open('HISTORY.rst') as history_file: with open('HISTORY.rst') as history_file:
history = history_file.read() history = history_file.read()
requirements = [
# TODO: Different OS have different requirements REQUIRED = []
]
if (sys.version_info > (3, 0)):
REQUIRED = ['pyqt5', 'lxml']
else:
print('\033[93m For py2, you are unable to installl pyqt4 by pip \033[0m')
REQUIRED = ['lxml']
# OS specific settings # OS specific settings
SET_REQUIRES = [] SET_REQUIRES = []
@ -27,7 +41,7 @@ elif _platform == "darwin":
required_packages = find_packages() required_packages = find_packages()
required_packages.append('labelImg') required_packages.append('labelImg')
APP = ['labelImg.py'] APP = [NAME]
OPTIONS = { OPTIONS = {
'argv_emulation': True, 'argv_emulation': True,
'iconfile': 'resources/icons/app.icns' 'iconfile': 'resources/icons/app.icns'
@ -35,8 +49,8 @@ OPTIONS = {
setup( setup(
app=APP, app=APP,
name='labelImg', name=NAME,
version=__version__, version=about['__version__'],
description="LabelImg is a graphical image annotation tool and label object bounding boxes in images", description="LabelImg is a graphical image annotation tool and label object bounding boxes in images",
long_description=readme + '\n\n' + history, long_description=readme + '\n\n' + history,
author="TzuTa Lin", author="TzuTa Lin",
@ -50,7 +64,7 @@ setup(
] ]
}, },
include_package_data=True, include_package_data=True,
install_requires=requirements, install_requires=REQUIRED,
license="MIT license", license="MIT license",
zip_safe=False, zip_safe=False,
keywords='labelImg labelTool development annotation deeplearning', keywords='labelImg labelTool development annotation deeplearning',