-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·88 lines (81 loc) · 2.72 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3
import os
import glob
from setuptools import setup
from setuptools.command.test import test as TestCommand
from setuptools.command.build_py import build_py as BuildCommand
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
class NoseTestCommand(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests'])
class BuildWithVersionCommand(BuildCommand):
def run(self):
BuildCommand.run(self)
if not self.dry_run:
version_fname = os.path.join(self.build_lib, 'vhdmmio', 'version.py')
with open(version_fname, 'w') as fildes:
fildes.write('__version__ = """' + self.distribution.metadata.version + '"""\n')
with open('MANIFEST.in', 'w') as fil:
for filename in glob.glob('vhdmmio/**/*.template.*', recursive=True):
fil.write('include %s\n' % filename)
setup(
name = 'vhdmmio',
version_config={
'version_format': '{tag}+{sha}',
'starting_version': '0.0.1'
},
author = 'Jeroen van Straten',
author_email = 'j.vanstraten-1@tudelft.nl',
description = (
'VHDL code generator for AXI4-lite compatible memory-mapped I/O (MMIO)'
'register files and bus infrastructure.'
),
license = 'Apache',
keywords = 'vhdl mmio registers generator',
url = 'https://github.com/abs-tudelft/vhdmmio',
long_description = read('README.md'),
long_description_content_type = 'text/markdown',
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Code Generators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
],
project_urls = {
'Source': 'https://github.com/abs-tudelft/vhdmmio',
},
packages = list(map(
lambda path: os.path.dirname(path).replace(os.sep, '.'),
glob.glob('vhdmmio/**/__init__.py', recursive=True))),
include_package_data=True,
entry_points = {'console_scripts': ['vhdmmio=vhdmmio:run_cli']},
python_requires = '>=3.5',
install_requires = [
'pyyaml',
'markdown2'
],
setup_requires = [
'wheel',
'setuptools-lint',
'pylint',
'better-setuptools-git-version'
],
tests_require = [
'nose',
'coverage',
'vhdeps'
],
cmdclass = {
'test': NoseTestCommand,
'build_py': BuildWithVersionCommand,
},
)