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
qt4py2:
pyrcc4 -py2 -o resources.py resources.qrc
pyrcc4 -py2 -o lib/resources.py resources.qrc
qt4py3:
pyrcc4 -py3 -o resources.py resources.qrc
pyrcc4 -py3 -o lib/resources.py resources.qrc
qt5py3:
pyrcc5 -o resources.py resources.qrc
pyrcc5 -o lib/resources.py resources.qrc
clean:
rm -f ~/.labelImgSettings.pkl resources.pyc

View File

@ -26,8 +26,7 @@ except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import resources
# Add internal libs
from libs.resources import *
from libs.constants import *
from libs.utils import *
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 TXT_EXT
from libs.ustr import ustr
from libs.version import __version__
from libs.hashableQListWidgetItem import HashableQListWidgetItem
__appname__ = 'labelImg'
@ -603,7 +601,7 @@ class MainWindow(QMainWindow, WindowMixin):
elif osName == 'Linux':
return ['xdg-open']
elif osName == 'Darwin':
return ['open', '-a', 'Safari']
return ['open']
## Callbacks ##
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
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from libs.version import __version__
from setuptools import setup, find_packages, Command
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:
readme = readme_file.read()
@ -11,9 +20,14 @@ with open('README.rst') as readme_file:
with open('HISTORY.rst') as history_file:
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
SET_REQUIRES = []
@ -27,7 +41,7 @@ elif _platform == "darwin":
required_packages = find_packages()
required_packages.append('labelImg')
APP = ['labelImg.py']
APP = [NAME]
OPTIONS = {
'argv_emulation': True,
'iconfile': 'resources/icons/app.icns'
@ -35,8 +49,8 @@ OPTIONS = {
setup(
app=APP,
name='labelImg',
version=__version__,
name=NAME,
version=about['__version__'],
description="LabelImg is a graphical image annotation tool and label object bounding boxes in images",
long_description=readme + '\n\n' + history,
author="TzuTa Lin",
@ -50,7 +64,7 @@ setup(
]
},
include_package_data=True,
install_requires=requirements,
install_requires=REQUIRED,
license="MIT license",
zip_safe=False,
keywords='labelImg labelTool development annotation deeplearning',