Reformat setup.py according to PEP

This commit is contained in:
Marius Bergmann 2017-05-05 07:59:50 +02:00 committed by Florian Festi
parent e544b9f989
commit d947c0ff19
1 changed files with 33 additions and 29 deletions

View File

@ -1,15 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import glob
import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
from setuptools.command.build_py import build_py from setuptools.command.build_py import build_py
import os
import glob
class CustomBuildExtCommand(build_py): class CustomBuildExtCommand(build_py):
"""Customized setuptools install command - prints a friendly greeting.""" """Customized setuptools install command - prints a friendly greeting."""
def buildInkscapeExt(self): def buildInkscapeExt(self):
os.system("%s %s" % (os.path.join("scripts", "boxes2inkscape"), "inkex")) os.system("%s %s" % (os.path.join("scripts", "boxes2inkscape"),
"inkex"))
def run(self): def run(self):
self.execute(self.buildInkscapeExt, ()) self.execute(self.buildInkscapeExt, ())
@ -17,31 +19,33 @@ class CustomBuildExtCommand(build_py):
if self.distribution.data_files is None: if self.distribution.data_files is None:
self.distribution.data_files = [] self.distribution.data_files = []
self.distribution.data_files.append( self.distribution.data_files.append(
("/usr/share/inkscape/extensions/", [i for i in glob.glob(os.path.join("inkex", "*.inx"))])) ("/usr/share/inkscape/extensions/",
[i for i in glob.glob(os.path.join("inkex", "*.inx"))]))
build_py.run(self) build_py.run(self)
setup(name='boxes',
version='0.1', setup(
description='Boxes generator for laser cutters', name='boxes',
author='Florian Festi', version='0.1',
author_email='florian@festi.info', description='Boxes generator for laser cutters',
url='https://github.com/florianfesti/boxes', author='Florian Festi',
packages=find_packages(), author_email='florian@festi.info',
install_requires=['cairocffi'], url='https://github.com/florianfesti/boxes',
scripts=['scripts/boxes', 'scripts/boxesserver'], packages=find_packages(),
cmdclass={ install_requires=['cairocffi'],
'build_py': CustomBuildExtCommand, scripts=['scripts/boxes', 'scripts/boxesserver'],
}, cmdclass={
classifiers=[ 'build_py': CustomBuildExtCommand,
"Development Status :: 4 - Beta", },
"Environment :: Console", classifiers=[
"Environment :: Web Environment", "Development Status :: 4 - Beta",
"Intended Audience :: Manufacturing", "Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Environment :: Web Environment",
"Programming Language :: Python :: 3", "Intended Audience :: Manufacturing",
"Topic :: Multimedia :: Graphics :: Editors :: Vector-Based", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Topic :: Scientific/Engineering", "Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Computer Aided Design", "Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
], "Topic :: Scientific/Engineering",
keywords=["boxes", "box", "generator", "svg", "laser cutter"], "Topic :: Scientific/Engineering :: Computer Aided Design",
) ],
keywords=["boxes", "box", "generator", "svg", "laser cutter"], )