diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..b410f47e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include MANIFEST.in +include LICENSE +include README.md diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..00661e2c --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +#!/usr/bin/make + +deb: + fakeroot dpkg-buildpackage -uc -b + +deb_clean: + fakeroot debian/rules clean + +.PHONY: deb deb_clean diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 00000000..04f200ce --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +kiplot.inti-cmnb for Debian + +This is a KiCad plotter that uses the Python interface to plot gerbers and +other files. + + -- Salvador Eduardo Tropea Tue, 10 Mar 2020 13:27:48 -0300 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..d153fa0b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +kiplot.inti-cmnb (0.1.0-1) testing; urgency=low + + * Initial release. + + -- Salvador Eduardo Tropea Tue, 10 Mar 2020 13:27:48 -0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..b4de3947 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..26521489 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: kiplot.inti-cmnb +Section: electronics +Priority: optional +Maintainer: Salvador Eduardo Tropea +Build-Depends: debhelper (>=11~), dh-python, python3-all, python3-setuptools +Standards-Version: 4.1.4 +Homepage: https://github.com/INTI-CMNB/kiplot +X-Python3-Version: >= 3.2 + +Package: kiplot.inti-cmnb +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends}, ${python3:Depends}, python3-yaml +Description: KiCad Plotter (KiPlot) + KiPlot is a program which helps you to plot your KiCad PCBs to output + formats easily, repeatable, and most of all, scriptably. + . + This means you can use a Makefile to export your KiCad PCBs just as + needed. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..b6c83b68 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: kiplot.inti-cmnb +Source: https://github.com/INTI-CMNB/kiplot + +Files: README.md + docs/samples/generic_plot.kiplot.yaml + setup.cfg + setup.py + src/kiplot + src/kiplot_module/__init__.py + src/kiplot_module/__main__.py + src/kiplot_module/__version__.py + src/kiplot_module/config_reader.py + src/kiplot_module/error.py + src/kiplot_module/kiplot.py + src/kiplot_module/plot_config.py + tests/board_samples/simple_2layer.kicad_pcb + tests/conftest.py + tests/test_plot/README.md + tests/test_plot/__init__.py + tests/test_plot/plotting_test_utils.py + tests/test_plot/test_simple_2layer.py + tests/test_yaml.py + tests/yaml_samples/simple_2layer.kiplot.yaml +Copyright: 2018 John Beard +License: GPL-3.0 + + diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..b43bf86b --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..4a97dfa7 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +# You must remove unused comment lines for the released package. diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..158e311d --- /dev/null +++ b/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f +# You must remove unused comment lines for the released package. +#export DH_VERBOSE = 1 + +%: + dh $@ --with python3 --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/local-options b/debian/source/local-options new file mode 100644 index 00000000..00131ee8 --- /dev/null +++ b/debian/source/local-options @@ -0,0 +1,2 @@ +#abort-on-upstream-changes +#unapply-patches diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..0c9476ad --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +# You must remove unused comment lines for the released package. +version=3 +https://github.com/INTI-CMNB/kiplot/tags .*/(\d[\d\.]*)\.(?:tar.gz|tar.bz2|tar.xz) diff --git a/src/kiplot/__init__.py b/kiplot/__init__.py similarity index 100% rename from src/kiplot/__init__.py rename to kiplot/__init__.py diff --git a/src/kiplot/__main__.py b/kiplot/__main__.py similarity index 100% rename from src/kiplot/__main__.py rename to kiplot/__main__.py diff --git a/src/kiplot/__version__.py b/kiplot/__version__.py similarity index 100% rename from src/kiplot/__version__.py rename to kiplot/__version__.py diff --git a/src/kiplot/config_reader.py b/kiplot/config_reader.py similarity index 100% rename from src/kiplot/config_reader.py rename to kiplot/config_reader.py diff --git a/src/kiplot/error.py b/kiplot/error.py similarity index 100% rename from src/kiplot/error.py rename to kiplot/error.py diff --git a/src/kiplot/kiplot.py b/kiplot/kiplot.py similarity index 100% rename from src/kiplot/kiplot.py rename to kiplot/kiplot.py diff --git a/src/kiplot/plot_config.py b/kiplot/plot_config.py similarity index 100% rename from src/kiplot/plot_config.py rename to kiplot/plot_config.py diff --git a/setup.py b/setup.py index a4200c95..9b5c2027 100644 --- a/setup.py +++ b/setup.py @@ -1,71 +1,45 @@ -# -*- coding: utf-8 -*- - +#!/usr/bin/python3 import io import os - -from setuptools import setup, find_packages +from distutils.core import setup # Package meta-data. NAME = 'kiplot' DESCRIPTION = 'Plotting driver for KiCad' -URL = 'https://github.com/johnbeard/kiplot' +URL = 'https://github.com/INTI-CMNB/kiplot/' EMAIL = 'john.j.beard@gmail.com' AUTHOR = 'John Beard' -REQUIRES_PYTHON = '>=2.7.0' - - -# What packages are required for this module to be executed? -REQUIRED = [ - 'pyyaml', - # 'pcbnew' -] here = os.path.abspath(os.path.dirname(__file__)) - # Import the README and use it as the long-description. # Note: this will only work if 'README.md' is present in your MANIFEST.in file! with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = '\n' + f.read() - - + long_description = '\n' + f.read() about = {} -with open(os.path.join(here, 'src', NAME, '__version__.py')) as f: - exec(f.read(), about) +with open(os.path.join(here, NAME, '__version__.py')) as f: + exec(f.read(), about) - -# Where the magic happens: -setup( - name=NAME, +setup(name=NAME, version=about['__version__'], description=DESCRIPTION, long_description=long_description, long_description_content_type='text/markdown', author=AUTHOR, author_email=EMAIL, - python_requires=REQUIRES_PYTHON, url=URL, - packages=find_packages('src'), - package_dir={'': 'src'}, - # If your package is a single module, use this instead of 'packages': - # py_modules=['mypackage'], - - entry_points={ - 'console_scripts': ['kiplot=kiplot.__main__:main'], - }, - install_requires=REQUIRED, - include_package_data=True, - license='MIT', - classifiers=[ - # Trove classifiers - # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers + packages=[NAME], + package_dir={NAME: NAME}, + scripts=['src/kiplot'], + install_requires=['pyyaml'], + classifiers = ['Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)', ], - setup_requires=['pytest-runner'], - tests_require=['pytest'], + platforms = 'POSIX', + license = 'GPL-3.0' ) diff --git a/src/kiplot b/src/kiplot new file mode 100755 index 00000000..86ad576f --- /dev/null +++ b/src/kiplot @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +""" + @package + KiPlot - KiCad Python API plotter + + KiPlot is a program which helps you to plot your KiCad PCBs to output + formats easily, repeatable, and most of all, scriptably. This means you + can use a Makefile to export your KiCad PCBs just as needed. + +""" + +import sys +import os + +here = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(os.path.dirname(here)) + +from kiplot.__main__ import main + +main()