diff --git a/.gitignore b/.gitignore index f6f8b639..64cefe08 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ icons/.DS_Store resources.py +.idea* +labelImg.egg-info* + *.pyc .*.swp diff --git a/contributors.txt b/CONTRIBUTING.rst similarity index 100% rename from contributors.txt rename to CONTRIBUTING.rst diff --git a/HISTORY.rst b/HISTORY.rst new file mode 100644 index 00000000..ccab11fc --- /dev/null +++ b/HISTORY.rst @@ -0,0 +1,13 @@ +======= +History +======= + +1.2.3 (2017-04-22) +------------------ + +* Fix issues + +1.2.2 (2017-01-09) +------------------ + +* Fix issues diff --git a/LICENSE.md b/LICENSE similarity index 96% rename from LICENSE.md rename to LICENSE index a4dfe2dc..0ffc8fe0 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) <2015-2016> Tzutalin +Copyright (c) <2015-Present> Tzutalin Copyright (C) 2013 MIT, Computer Science and Artificial Intelligence Laboratory. Bryan Russell, Antonio Torralba, William T. Freeman diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..a3063081 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,14 @@ +include CONTRIBUTING.rst +include LICENSE +include README.rst + +include resources.qrc + +recursive-include data * +recursive-include icons * +recursive-include libs * + +recursive-exclude build-tools * +recursive-exclude tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/README.md b/README.rst similarity index 96% rename from README.md rename to README.rst index 52e6fb51..99c482d3 100644 --- a/README.md +++ b/README.rst @@ -16,8 +16,7 @@ Annotations are saved as XML files in PASCAL VOC format, the format used by [Ima ### Download prebuilt binaries -* Windows & Linux - * [http://tzutalin.github.io/labelImg/](http://tzutalin.github.io/labelImg/) +* [Windows & Linux](http://tzutalin.github.io/labelImg/) * OS X * Binaries for OS X are not yet available. Help would be appreciated. At present it must be [built from source](#os-x). diff --git a/__init__.py b/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/_init_path.py b/_init_path.py deleted file mode 100644 index 9a0ab467..00000000 --- a/_init_path.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Set up paths""" -import sys - - -def add_path(path): - if path not in sys.path: - sys.path.insert(0, path) - -add_path('libs') diff --git a/labelImg.py b/labelImg.py index b8073c54..b4cc5703 100644 --- a/labelImg.py +++ b/labelImg.py @@ -26,7 +26,8 @@ except ImportError: from PyQt4.QtCore import * import resources - +# Add internal libs +sys.path.insert(0, 'libs') from lib import struct, newAction, newIcon, addActions, fmtShortcut from shape import Shape, DEFAULT_LINE_COLOR, DEFAULT_FILL_COLOR from canvas import Canvas @@ -1285,7 +1286,7 @@ def get_main_app(argv=[]): return app, win -def main(argv): +def main(argv=[]): '''construct main app and run it''' app, _win = get_main_app(argv) return app.exec_() diff --git a/libs/pascal_voc_io.py b/libs/pascal_voc_io.py index 0a16c4cb..d47fe587 100644 --- a/libs/pascal_voc_io.py +++ b/libs/pascal_voc_io.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf8 -*- -import _init_path import sys from xml.etree import ElementTree from xml.etree.ElementTree import Element, SubElement diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..71c98697 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,11 @@ +[bumpversion] +current_version = 1.2.3 +commit = True +tag = True + +[bumpversion:file:setup.py] +search = version='{current_version}' +replace = version='{new_version}' + +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..9ef41ad6 --- /dev/null +++ b/setup.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from setuptools import setup + +with open('README.rst') as readme_file: + readme = readme_file.read() + +with open('HISTORY.rst') as history_file: + history = history_file.read() + +requirements = [ + # TODO: put package requirements here +] + +test_requirements = [ + 'qt', + 'qt4', + 'libxml2' +] + +setup( + name='labelImg', + version='1.2.3', + description="LabelImg is a graphical image annotation tool and label object bounding boxes in images", + long_description=readme + '\n\n' + history, + author="TzuTa Lin", + author_email='tzu.ta.lin@gmail.com', + url='https://github.com/tzutalin/labelImg', + packages=[ + 'labelImg', + ], + package_dir={'labelImg': + '.'}, + entry_points={ + 'console_scripts': [ + 'labelImg=labelImg.labelImg:main' + ] + }, + include_package_data=True, + install_requires=requirements, + license="MIT license", + zip_safe=False, + keywords='labelImg', + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + "Programming Language :: Python :: 2", + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], + test_suite='tests', + tests_require=test_requirements +)