Skip to content

Commit 03e4e07

Browse files
move setuptools metadata (#323)
* happy new year * move setuptools metadata * update tox config * bump luma.core to 2.2.0 * add pyproject * include file in manifest * fix typo
1 parent 73e909c commit 03e4e07

File tree

6 files changed

+55
-96
lines changed

6 files changed

+55
-96
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg pytest.ini .coveragerc
1+
include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg pyproject.toml pytest.ini .coveragerc
22

33
recursive-include luma *.py
44

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ License
9797
-------
9898
The MIT License (MIT)
9999

100-
Copyright (c) 2014-2020 Richard Hull and contributors
100+
Copyright (c) 2014-2021 Richard Hull and contributors
101101

102102
Permission is hereby granted, free of charge, to any person obtaining a copy
103103
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools >= 40.6.0", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
[metadata]
2+
name = luma.oled
3+
version = attr: luma.oled.__version__
4+
description = A small library to drive an OLED device with either SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1331, SSD1351, SSD1362, SH1106 or WS0010 chipset
5+
long_description = file: README.rst, CONTRIBUTING.rst, CHANGES.rst
6+
long_description_content_type = text/x-rst
7+
keywords = raspberry pi, rpi, oled, display, screen, rgb, monochrome, greyscale, color, ssd1306, ssd1309, ssd1322, ssd1325, ssd1327, ssd1331, ssd1351, sh1106, ws0010, WEH001602A, WEG010016A, spi, i2c, parallel6800, pcf8574
8+
author = Richard Hull
9+
author_email = richard.hull@destructuring-bind.org
10+
url = https://github.com/rm-hull/luma.oled
11+
license = MIT
12+
classifiers =
13+
License :: OSI Approved :: MIT License
14+
Development Status :: 5 - Production/Stable
15+
Intended Audience :: Education
16+
Intended Audience :: Developers
17+
Topic :: Education
18+
Topic :: System :: Hardware
19+
Topic :: System :: Hardware :: Hardware Drivers
20+
Programming Language :: Python :: 3
21+
Programming Language :: Python :: 3.6
22+
Programming Language :: Python :: 3.7
23+
Programming Language :: Python :: 3.8
24+
Programming Language :: Python :: 3.9
25+
26+
[options]
27+
zip_safe = False
28+
packages = find:
29+
python_requires = >=3.6, <4
30+
namespace_packages = luma
31+
install_requires =
32+
luma.core>=2.2.0
33+
tests_require =
34+
pytest
35+
pytest-cov
36+
pytest-timeout
37+
38+
[options.extras_require]
39+
docs = sphinx>=1.5.1
40+
qa = flake8; rstcheck
41+
test = pytest; pytest-cov; pytest-timeout
42+
143
[bdist_wheel]
244
universal = 1
345

setup.py

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import re
5-
import os
6-
import sys
7-
from io import open
8-
from setuptools import setup, find_packages
4+
import setuptools
95

10-
11-
def read_file(fpath):
12-
with open(fpath, encoding='utf-8') as r:
13-
return r.read()
14-
15-
16-
def find_version(*file_paths):
17-
fpath = os.path.join(os.path.dirname(__file__), *file_paths)
18-
version_file = read_file(fpath)
19-
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
20-
version_file, re.M)
21-
if version_match:
22-
return version_match.group(1)
23-
24-
err_msg = 'Unable to find version string in {}'.format(fpath)
25-
raise RuntimeError(err_msg)
26-
27-
28-
README = read_file('README.rst')
29-
CONTRIB = read_file('CONTRIBUTING.rst')
30-
CHANGES = read_file('CHANGES.rst')
31-
version = find_version('luma', 'oled', '__init__.py')
32-
project_url = 'https://github.com/rm-hull/luma.oled'
33-
34-
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
35-
pytest_runner = ['pytest-runner'] if needs_pytest else []
36-
test_deps = [
37-
'pytest',
38-
'pytest-cov',
39-
'pytest-timeout'
40-
]
41-
42-
setup(
43-
name="luma.oled",
44-
version=version,
45-
author="Richard Hull",
46-
author_email="richard.hull@destructuring-bind.org",
47-
description=("A small library to drive an OLED device with either "
48-
"SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1331, "
49-
"SSD1351, SSD1362, SH1106 or WS0010 chipset"),
50-
long_description="\n\n".join([README, CONTRIB, CHANGES]),
51-
long_description_content_type="text/x-rst",
52-
python_requires='>=3.6, <4',
53-
license="MIT",
54-
keywords=("raspberry pi rpi oled display screen "
55-
"rgb monochrome greyscale color "
56-
"ssd1306 ssd1309 ssd1322 ssd1325 ssd1327 ssd1331 ssd1351 sh1106 "
57-
"ws0010 WEH001602A WEG010016A "
58-
"spi i2c parallel 6800 pcf8574 "),
59-
60-
url=project_url,
61-
download_url=project_url + "/tarball/" + version,
62-
project_urls={
63-
'Documentation': 'https://luma-oled.readthedocs.io',
64-
'Source': project_url,
65-
'Issue Tracker': project_url + '/issues',
66-
},
67-
packages=find_packages(),
68-
namespace_packages=["luma"],
69-
zip_safe=False,
70-
install_requires=["luma.core>=2.0.0"],
71-
setup_requires=pytest_runner,
72-
tests_require=test_deps,
73-
extras_require={
74-
'docs': [
75-
'sphinx >= 1.5.1'
76-
],
77-
'qa': [
78-
'rstcheck',
79-
'flake8'
80-
],
81-
'test': test_deps
82-
},
83-
classifiers=[
84-
"License :: OSI Approved :: MIT License",
85-
"Development Status :: 5 - Production/Stable",
86-
"Intended Audience :: Education",
87-
"Intended Audience :: Developers",
88-
"Topic :: Education",
89-
"Topic :: System :: Hardware",
90-
"Programming Language :: Python :: 3",
91-
"Programming Language :: Python :: 3.6",
92-
"Programming Language :: Python :: 3.7",
93-
"Programming Language :: Python :: 3.8",
94-
"Programming Language :: Python :: 3.9"
95-
]
96-
)
6+
if __name__ == "__main__":
7+
setuptools.setup()

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2014-2020 Richard Hull and contributors
1+
# Copyright (c) 2014-2021 Richard Hull and contributors
22
# See LICENSE.rst for details.
33

44
[tox]
@@ -7,12 +7,15 @@ skip_missing_interpreters = True
77

88
[testenv]
99
usedevelop = true
10+
allowlist_externals =
11+
py.test
12+
coverage
1013
setenv =
1114
PYTHONDEVMODE=1
1215
commands =
1316
coverage erase
1417
python setup.py install
15-
pytest --cov=luma
18+
py.test --cov=luma
1619
coverage html
1720
deps = .[test]
1821

0 commit comments

Comments
 (0)