1+ """A setuptools based setup module.
2+ See:
3+ https://packaging.python.org/en/latest/distributing.html
4+ https://github.com/pypa/sampleproject
5+ """
6+
7+ from os import path
8+
9+ from setuptools import setup , find_packages
10+ from six import raise_from
11+
12+ here = path .abspath (path .dirname (__file__ ))
13+
14+ # *************** Dependencies *********
15+ INSTALL_REQUIRES = ['pyyaml' ] # 'typing_inspect' is now copied internally so as to be compliant with very old versions of typing module
16+ DEPENDENCY_LINKS = []
17+ SETUP_REQUIRES = ['pytest-runner' , 'setuptools_scm' , 'pypandoc' , 'pandoc' ]
18+ TESTS_REQUIRE = ['pytest' , 'pytest-logging' , 'pytest-cov' ]
19+ EXTRAS_REQUIRE = {}
20+
21+ # simple check
22+ try :
23+ from setuptools_scm import get_version
24+ except Exception as e :
25+ raise_from (Exception ('Required packages for setup not found. You may wish you execute '
26+ '"pip install -r ci_tools/requirements-setup.txt" to install them or alternatively install '
27+ 'them manually using conda or other system. The list is : ' + str (SETUP_REQUIRES )), e )
28+
29+ # ************** ID card *****************
30+ DISTNAME = 'yamlable'
31+ DESCRIPTION = 'A thin wrapper of PyYaml to convert Python objects to YAML and back.'
32+ MAINTAINER = 'Sylvain Marié'
33+ MAINTAINER_EMAIL = 'sylvain.marie@schneider-electric.com'
34+ URL = 'https://github.com/smarie/python-yamlable'
35+ LICENSE = 'BSD 3-Clause'
36+ LICENSE_LONG = 'License :: OSI Approved :: BSD License'
37+
38+ version_for_download_url = get_version ()
39+ DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url
40+
41+ KEYWORDS = 'yaml file parsing parse load dump read object oo oriented codec format plugin pyYaml'
42+ # --Get the long description from the README file
43+ # with open(path.join(here, 'README.md'), encoding='utf-8') as f:
44+ # LONG_DESCRIPTION = f.read()
45+ try :
46+ import pypandoc
47+ LONG_DESCRIPTION = pypandoc .convert (path .join (here , 'README.md' ), 'rst' ).replace ('\r ' , '' )
48+ except (ImportError ):
49+ from warnings import warn
50+ warn ('WARNING pypandoc could not be imported - we recommend that you install it in order to package the '
51+ 'documentation correctly' )
52+ LONG_DESCRIPTION = open ('README.md' ).read ()
53+
54+ # ************* VERSION A **************
55+ # --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4.
56+ # THIS IS DEPRECATED AS WE NOW USE GIT TO MANAGE VERSION
57+ # with open(path.join(here, 'VERSION')) as version_file:
58+ # VERSION = version_file.read().strip()
59+ OBSOLETES = []
60+
61+ setup (
62+ name = DISTNAME ,
63+ description = DESCRIPTION ,
64+ long_description = LONG_DESCRIPTION ,
65+
66+ # Versions should comply with PEP440. For a discussion on single-sourcing
67+ # the version across setup.py and the project code, see
68+ # https://packaging.python.org/en/latest/single_source_version.html
69+ # version=VERSION, NOW HANDLED BY GIT
70+
71+ maintainer = MAINTAINER ,
72+ maintainer_email = MAINTAINER_EMAIL ,
73+
74+ license = LICENSE ,
75+ url = URL ,
76+ download_url = DOWNLOAD_URL ,
77+
78+ # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
79+ classifiers = [
80+ # How mature is this project? Common values are
81+ # 3 - Alpha
82+ # 4 - Beta
83+ # 5 - Production/Stable
84+ 'Development Status :: 5 - Production/Stable' ,
85+
86+ # Indicate who your project is intended for
87+ 'Intended Audience :: Developers' ,
88+ 'Topic :: Software Development :: Libraries :: Python Modules' ,
89+
90+ # Pick your license as you wish (should match "license" above)
91+ LICENSE_LONG ,
92+
93+ # Specify the Python versions you support here. In particular, ensure
94+ # that you indicate whether you support Python 2, Python 3 or both.
95+ # 'Programming Language :: Python :: 2',
96+ # 'Programming Language :: Python :: 2.6',
97+ # 'Programming Language :: Python :: 2.7',
98+ # 'Programming Language :: Python :: 3',
99+ # 'Programming Language :: Python :: 3.3',
100+ # 'Programming Language :: Python :: 3.4',
101+ 'Programming Language :: Python :: 3.5' ,
102+ 'Programming Language :: Python :: 3.6' ,
103+ ],
104+
105+ # What does your project relate to?
106+ keywords = KEYWORDS ,
107+
108+ # You can just specify the packages manually here if your project is
109+ # simple. Or you can use find_packages().
110+ packages = find_packages (exclude = ['contrib' , 'docs' , 'tests' ]),
111+
112+ # Alternatively, if you want to distribute just a my_module.py, uncomment
113+ # this:
114+ # py_modules=["my_module"],
115+
116+ # List run-time dependencies here. These will be installed by pip when
117+ # your project is installed. For an analysis of "install_requires" vs pip's
118+ # requirements files see:
119+ # https://packaging.python.org/en/latest/requirements.html
120+ install_requires = INSTALL_REQUIRES ,
121+ dependency_links = DEPENDENCY_LINKS ,
122+
123+ # we're using git
124+ use_scm_version = True , # this provides the version + adds the date if local non-commited changes.
125+ # use_scm_version={'local_scheme':'dirty-tag'}, # provides the version + adds '+dirty' if local non-commited changes
126+ setup_requires = SETUP_REQUIRES ,
127+
128+ # test
129+ # test_suite='nose.collector',
130+ tests_require = TESTS_REQUIRE ,
131+
132+ # List additional groups of dependencies here (e.g. development
133+ # dependencies). You can install these using the following syntax,
134+ # for example:
135+ # $ pip install -e .[dev,test]
136+ extras_require = EXTRAS_REQUIRE ,
137+
138+ obsoletes = OBSOLETES
139+
140+ # If there are data files included in your packages that need to be
141+ # installed, specify them here. If using Python 2.6 or less, then these
142+ # have to be included in MANIFEST.in as well.
143+ # package_data={
144+ # 'sample': ['package_data.dat'],
145+ # },
146+
147+ # Although 'package_data' is the preferred approach, in some case you may
148+ # need to place data files outside of your packages. See:
149+ # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
150+ # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
151+ # data_files=[('my_data', ['data/data_file'])],
152+
153+ # To provide executable scripts, use entry points in preference to the
154+ # "scripts" keyword. Entry points provide cross-platform support and allow
155+ # pip to create the appropriate form of executable for the target platform.
156+ # entry_points={
157+ # 'console_scripts': [
158+ # 'sample=sample:main',
159+ # ],
160+ # },
161+ )
0 commit comments