Make __main__ functional again and install a script entry point.

This commit is contained in:
Chintalagiri Shashank 2019-05-11 04:23:19 +05:30
parent 2601ae8eab
commit 9cc42d9b77
No known key found for this signature in database
GPG key ID: 19ACD9266B853BD4
3 changed files with 118 additions and 26 deletions

View file

@ -16,6 +16,7 @@
# limitations under the License.
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
@ -25,13 +26,13 @@ METADATA = {
'version': 0.1,
'author': 'Paulo Henrique Silva <ph.silva@gmail.com>, Hamilton Kibbe <ham@hamiltonkib.be>',
'author_email': "ph.silva@gmail.com, ham@hamiltonkib.be",
'description': ("Utilities to handle Gerber (RS-274X) files."),
'description': "Utilities to handle Gerber (RS-274X) files.",
'license': "Apache",
'keywords': "pcb gerber tools",
'url': "http://github.com/curtacircuitos/pcb-tools",
'packages': ['gerber', 'gerber.render'],
'long_description': read('README.md'),
'classifiers':[
'classifiers': [
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: Apple Public Source License",
@ -40,6 +41,11 @@ METADATA = {
SETUPTOOLS_METADATA = {
'install_requires': ['cairocffi==0.6'],
'entry_points': {
'console_scripts': [
'gerber-render = gerber.__main__:main',
],
},
}
@ -53,9 +59,10 @@ def install():
except ImportError:
from sys import stderr
stderr.write('Could not import setuptools, using distutils')
stderr.write('NOTE: You will need to install dependencies manualy')
stderr.write('NOTE: You will need to install dependencies manually')
from distutils.core import setup
setup(**METADATA)
if __name__ == '__main__':
install()