diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d4222f578db43051424f39029d3a6f5c72082228
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+language: python
+python:
+ - "3.4"
+env:
+
+before_script:
+
+install:
+ - pip install -q -r requirements.txt
+ - pip install .
+
+script:
+ # fixme:
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000000000000000000000000000000000000..95b6893b02ededc990121c940af74e9967c65493
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,29 @@
+include .gitignore
+include .pyflymakerc
+include CHANGES.txt
+include GPL-V3.0.txt
+include LICENSE.txt
+include MANIFEST.in
+include README.html
+include README.rst
+include README.txt
+include TODO.rst
+include make-release.sh
+include pylintrc.ini
+include setenv.sh start.sh
+include setup_data.py
+include requirements.txt requirements-dev.txt
+include .travis.yml
+include bower/bower.json
+recursive-include PythonicGCodeMachine *.py *.yml *py.in
+recursive-include doc *
+recursive-include doc/sphinx/source/_static *
+recursive-include doc/sphinx/source/_templates *
+recursive-include tools *
+recursive-include unit-test *.py
+global-exclude *~
+global-exclude *__pycache__*
+global-exclude *.pyc
+prune build
+prune doc/sphinx/build
+prune doc/sphinx/source/api
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..17bf7fdca15b5a1079119e2ae2ac63fcb0957fab
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+PyYAML>=3.10
diff --git a/setenv.sh b/setenv.sh
new file mode 100644
index 0000000000000000000000000000000000000000..aa650fe633fed8435b56b323ac7bb5bf546f4815
--- /dev/null
+++ b/setenv.sh
@@ -0,0 +1,3 @@
+py36
+append_to_python_path_if_not ${PWD}
+append_to_python_path_if_not ${PWD}/tools
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..2a9acf13daa95e85642ea255d3e3bd1ef8252804
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal = 1
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000000000000000000000000000000000000..fe421b232e5c69b7098330f618daba410841c8f4
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,89 @@
+#! /usr/bin/env python3
+
+####################################################################################################
+#
+# PythonicGCodeMachine - @licence_header_description@
+# Copyright (C) 2018 Fabrice Salvaire
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+####################################################################################################
+
+####################################################################################################
+
+import glob
+import sys
+
+from setuptools import setup, find_packages
+setuptools_available = True
+
+####################################################################################################
+
+if sys.version_info < (3,):
+ print('PythonicGCodeMachine requires Python 3', file=sys.stderr)
+ sys.exit(1)
+
+exec(compile(open('setup_data.py').read(), 'setup_data.py', 'exec'))
+
+####################################################################################################
+
+def read_requirement():
+ return [requirement.strip() for requirement in open('requirements.txt').readlines()]
+
+####################################################################################################
+
+setup_dict.update(dict(
+ # include_package_data=True, # Look in MANIFEST.in
+ packages=find_packages(exclude=['unit-test']),
+ scripts=glob.glob('bin/*'),
+ # [
+ # 'bin/...',
+ # ],
+ package_data={
+ 'PythonicGCodeMachine.Config': ['logging.yml'],
+ },
+
+ platforms='any',
+ zip_safe=False, # due to data files
+
+ # cf. http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ 'Topic :: Scientific/Engineering',
+ 'Intended Audience :: Education',
+
+ 'Development Status :: 1 - Planning',
+ 'Development Status :: 2 - Pre-Alpha',
+ 'Development Status :: 3 - Alpha',
+ 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
+ 'Development Status :: 6 - Mature',
+ 'Development Status :: 7 - Inactive',
+
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
+
+ 'Operating System :: OS Independent',
+
+ 'Programming Language :: Python :: 3.6',
+ ],
+
+ install_requires=read_requirement(),
+ # [
+ # 'PyYAML',
+ # ],
+))
+
+####################################################################################################
+
+setup(**setup_dict)
diff --git a/setup_data.py b/setup_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..b6b111abd3e448e7fc3c793004e94b54dc8c77e2
--- /dev/null
+++ b/setup_data.py
@@ -0,0 +1,83 @@
+####################################################################################################
+#
+# PythonicGCodeMachine - @licence_header_description@
+# Copyright (C) 2018 Fabrice Salvaire
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+####################################################################################################
+
+####################################################################################################
+
+import os
+
+####################################################################################################
+
+def merge_include(src_lines, doc_path, included_rst_files=None):
+ if included_rst_files is None:
+ included_rst_files = {}
+ text = ''
+ for line in src_lines:
+ if line.startswith('.. include::'):
+ include_file_name = line.split('::')[-1].strip()
+ if include_file_name not in included_rst_files:
+ # print "include", include_file_name
+ with open(os.path.join(doc_path, include_file_name)) as f:
+ included_rst_files[include_file_name] = True
+ text += merge_include(f.readlines(), doc_path, included_rst_files)
+ else:
+ text += line
+ return text
+
+####################################################################################################
+
+# Utility function to read the README file.
+# Used for the long_description.
+def read_readme(file_name):
+
+ source_path = os.path.dirname(os.path.realpath(__file__))
+ if os.path.basename(source_path) == 'tools':
+ source_path = os.path.dirname(source_path)
+ elif 'build/bdist' in source_path:
+ source_path = source_path[:source_path.find('build/bdist')]
+ absolut_file_name = os.path.join(source_path, file_name)
+ doc_path = os.path.join(source_path, 'doc', 'sphinx', 'source')
+
+ # Read and merge includes
+ with open(absolut_file_name) as f:
+ lines = f.readlines()
+ text = merge_include(lines, doc_path)
+
+ return text
+
+####################################################################################################
+
+if not __file__.endswith('conf.py'):
+ long_description = read_readme('README.txt')
+else:
+ long_description = ''
+
+####################################################################################################
+
+setup_dict = dict(
+ name='PythonicGCodeMachine',
+ version='0.1.0',
+ author='Fabrice Salvaire',
+ author_email='fabrice.salvaire@orange.fr',
+ description='...',
+ license='GPLv3',
+ keywords= 'foo bar',
+ url='https://github.com/FabriceSalvaire/PythonicGCodeMachine',
+ long_description=long_description,
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000000000000000000000000000000000000..a0b9b4d57ee3edeec5cbacbbc2c101266ac2ed32
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,11 @@
+# tox (https://tox.readthedocs.io/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py36
+
+[testenv]
+commands = pytest unit-test
+deps = pytest