Skip to content

Commit 715737c

Browse files
committed
Migrate setup.py to setup.cfg
1 parent 0b9df72 commit 715737c

File tree

2 files changed

+74
-92
lines changed

2 files changed

+74
-92
lines changed

setup.cfg

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[metadata]
2+
name = sense-emu
3+
version = attr: sense_emu.__version__
4+
description = The Raspberry Pi Sense HAT Emulator library
5+
long_description = file: README.rst
6+
author = Raspberry Pi Foundation
7+
author_email = [email protected]
8+
url = https://sense-emu.readthedocs.io/
9+
project_urls =
10+
Documentation = https://sense-emu.readthedocs.io/
11+
Source Code = https://github.com/astro-pi/python-sense-emu
12+
Issue Tracker = https://github.com/astro-pi/python-sense-emu/issues
13+
keywords = raspberrypi sense hat
14+
license = GPL-2.0-or-later
15+
classifiers =
16+
Development Status :: 5 - Production/Stable
17+
Environment :: Console
18+
Environment :: X11 Applications :: GTK
19+
Intended Audience :: Developers
20+
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
21+
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
22+
Operating System :: POSIX :: Linux
23+
Operating System :: MacOS :: MacOS X
24+
Operating System :: Microsoft :: Windows
25+
Programming Language :: Python :: 2.7
26+
Programming Language :: Python :: 3.2
27+
Programming Language :: Python :: 3.3
28+
Programming Language :: Python :: 3.4
29+
Programming Language :: Python :: 3.5
30+
Topic :: Scientific/Engineering
31+
32+
[options]
33+
packages = find:
34+
install_requires =
35+
numpy
36+
Pillow
37+
38+
[options.package_data]
39+
40+
[options.extras_require]
41+
test =
42+
pytest
43+
pytest-cov
44+
mock
45+
doc =
46+
sphinx
47+
sphinx-rtd-theme
48+
49+
[options.entry_points]
50+
console_scripts =
51+
sense_rec = sense_emu.record:app
52+
sense_play = sense_emu.play:app
53+
sense_csv = sense_emu.dump:app
54+
gui_scripts =
55+
sense_emu_gui = sense_emu.gui:main
56+
57+
[tool:pytest]
58+
addopts = --cov --tb=short
59+
testpaths = tests
60+
61+
[coverage:run]
62+
source = sense_emu
63+
branch = true
64+
65+
[coverage:report]
66+
ignore_errors = true
67+
show_missing = true
68+
exclude_lines =
69+
assert False
70+
raise NotImplementedError
71+
pass

setup.py

+3-92
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,6 @@
1-
#!/usr/bin/env python3
2-
3-
# vim: set et sw=4 sts=4 fileencoding=utf-8:
4-
#
51
# Raspberry Pi Sense HAT Emulator library for the Raspberry Pi
6-
# Copyright (c) 2016 Raspberry Pi Foundation <[email protected]>
7-
#
8-
# All Rights Reserved.
9-
10-
"""An emulator for the Raspberry Pi Sense HAT."""
11-
12-
import os
13-
import sys
14-
from setuptools import setup, find_packages
15-
16-
if sys.version_info[0] == 2:
17-
if not sys.version_info >= (2, 7):
18-
raise ValueError('This package requires Python 2.7 or newer')
19-
elif sys.version_info[0] == 3:
20-
if not sys.version_info >= (3, 2):
21-
raise ValueError('This package requires Python 3.2 or newer')
22-
else:
23-
raise ValueError('Unrecognized major version of Python')
24-
25-
HERE = os.path.abspath(os.path.dirname(__file__))
26-
27-
# Workaround <http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html>
28-
try:
29-
import multiprocessing
30-
except ImportError:
31-
pass
32-
33-
# Mock out dependency modules while installing
34-
class Mock(object):
35-
__all__ = []
36-
37-
def __init__(self, *args, **kw):
38-
pass
39-
40-
def __call__(self, *args, **kw):
41-
return Mock()
42-
43-
def __mul__(self, other):
44-
return Mock()
45-
46-
def __and__(self, other):
47-
return Mock()
48-
49-
def __bool__(self):
50-
return False
51-
52-
def __nonzero__(self):
53-
return False
54-
55-
@classmethod
56-
def __getattr__(cls, name):
57-
if name in ('__file__', '__path__'):
58-
return '/dev/null'
59-
else:
60-
return Mock()
61-
62-
def main():
63-
sys.modules['numpy'] = Mock()
64-
sys.modules['RTIMU'] = Mock()
65-
sys.modules['PIL'] = Mock()
66-
import io
67-
import sense_emu as app
68-
with io.open(os.path.join(HERE, 'README.rst'), 'r') as readme:
69-
setup(
70-
name = app.__project__,
71-
version = app.__version__,
72-
description = app.__doc__,
73-
long_description = readme.read(),
74-
classifiers = app.__classifiers__,
75-
author = app.__author__,
76-
author_email = app.__author_email__,
77-
url = app.__url__,
78-
license = [
79-
c.rsplit('::', 1)[1].strip()
80-
for c in app.__classifiers__
81-
if c.startswith('License ::')
82-
][0],
83-
keywords = app.__keywords__,
84-
packages = find_packages(),
85-
include_package_data = True,
86-
platforms = app.__platforms__,
87-
install_requires = app.__requires__,
88-
extras_require = app.__extra_requires__,
89-
entry_points = app.__entry_points__,
90-
)
91-
2+
# Copyright (c) 2016-2021 Raspberry Pi Foundation <[email protected]>
923

93-
if __name__ == '__main__':
94-
main()
4+
from setuptools import setup
955

6+
setup()

0 commit comments

Comments
 (0)