Commit 853fc87c authored by Fabrice Salvaire's avatar Fabrice Salvaire

added setup files

parent b6d499de
language: python
python:
- "3.4"
env:
before_script:
install:
- pip install -q -r requirements.txt
- pip install .
script:
# fixme:
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
py36
append_to_python_path_if_not ${PWD}
append_to_python_path_if_not ${PWD}/tools
[bdist_wheel]
universal = 1
#! /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 <http://www.gnu.org/licenses/>.
#
####################################################################################################
####################################################################################################
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)
####################################################################################################
#
# 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 <http://www.gnu.org/licenses/>.
#
####################################################################################################
####################################################################################################
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,
)
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment