Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move setuptools metadata #247

Merged
merged 5 commits into from Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -43,14 +43,14 @@ jobs:
TOX_ENV: qa,doc
run: python -m tox -e $TOX_ENV
- name: Upload Coverage
run: coveralls
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true

coveralls:
name: Finish Coveralls
name: Coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
@@ -1,7 +1,7 @@
The MIT License (MIT)
---------------------

Copyright (c) 2013-2020 Richard Hull and contributors
Copyright (c) 2013-2021 Richard Hull and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1,4 +1,4 @@
include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg pytest.ini .coveragerc
include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg pyproject.toml pytest.ini .coveragerc

recursive-include luma *.py

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -28,7 +28,7 @@ Luma.LED_Matrix
.. image:: https://img.shields.io/pypi/dm/luma.led_matrix
:target: https://pypi.python.org/project/luma.led_matrix

.. image:: https://img.shields.io/maintenance/yes/2020.svg?maxAge=2592000
.. image:: https://img.shields.io/maintenance/yes/2021.svg?maxAge=2592000

Python 3 library interfacing LED matrix displays with the MAX7219 driver (using
SPI), WS2812 (NeoPixels, inc Pimoroni Unicorn pHat/Hat and Unicorn Hat HD) and
Expand Down Expand Up @@ -88,7 +88,7 @@ License
-------
The MIT License (MIT)

Copyright (c) 2013-2020 Richard Hull & Contributors
Copyright (c) 2013-2021 Richard Hull & Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Expand Up @@ -19,7 +19,7 @@ Luma.LED_Matrix: Display drivers for MAX7219, WS2812, APA102
.. image:: https://img.shields.io/pypi/dm/luma.led_matrix
:target: https://pypi.python.org/project/luma.led_matrix

.. image:: https://img.shields.io/maintenance/yes/2020.svg?maxAge=2592000
.. image:: https://img.shields.io/maintenance/yes/2021.svg?maxAge=2592000

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion doc/intro.rst
Expand Up @@ -12,7 +12,7 @@ support:
* terminal-style printing,
* state management,
* dithering to monochrome,
* Python 2.7 and 3.4+ are both supported
* Python 3.6+ is supported

.. image:: https://raw.githubusercontent.com/rm-hull/luma.led_matrix/master/doc/images/devices.jpg
:alt: max7219 matrix
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"
44 changes: 44 additions & 0 deletions setup.cfg
@@ -1,3 +1,47 @@
[metadata]
name = luma.led_matrix
version = attr: luma.led_matrix.__version__
description = A library to drive a MAX7219 LED serializer (using SPI) and WS2812 NeoPixels (using DMA)
long_description = file: README.rst, CONTRIBUTING.rst, CHANGES.rst
long_description_content_type = text/x-rst
keywords = raspberry pi, rpi, led, max7219, matrix, seven segment, 7 segment, neopixel, neosegment, ws2812, ws281x, apa102, unicorn-phat, unicorn-hat, unicorn-hat-hd
author = Richard Hull
author_email = richard.hull@destructuring-bind.org
url = https://github.com/rm-hull/luma.led_matrix
license = MIT
classifiers =
License :: OSI Approved :: MIT License
Development Status :: 5 - Production/Stable
Intended Audience :: Education
Intended Audience :: Developers
Topic :: Education
Topic :: System :: Hardware
Topic :: System :: Hardware :: Hardware Drivers
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9

[options]
zip_safe = False
packages = find:
python_requires = >=3.6, <4
namespace_packages = luma
install_requires =
luma.core>=2.2.0
ws2812; platform_machine=="armv7l" and platform_system=="Linux"
rpi_ws281x; platform_machine=="armv7l" and platform_system=="Linux"
tests_require =
pytest
pytest-cov
pytest-timeout

[options.extras_require]
docs = sphinx>=1.5.1
qa = flake8; rstcheck
test = pytest; pytest-cov; pytest-timeout

[bdist_wheel]
universal = 1

Expand Down
99 changes: 3 additions & 96 deletions setup.py
@@ -1,100 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re
import os
import sys
from io import open
from setuptools import setup, find_packages
import setuptools


def read_file(fname, encoding='utf-8'):
with open(fname, encoding=encoding) as r:
return r.read()


def find_version(*file_paths):
fpath = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = read_file(fpath)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)

err_msg = 'Unable to find version string in {}'.format(fpath)
raise RuntimeError(err_msg)


README = read_file('README.rst')
CONTRIB = read_file('CONTRIBUTING.rst')
CHANGES = read_file('CHANGES.rst')
version = find_version('luma', 'led_matrix', '__init__.py')
project_url = 'https://github.com/rm-hull/luma.led_matrix'

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
test_deps = [
'pytest',
'pytest-cov',
'pytest-timeout'
]

setup(
name="luma.led_matrix",
version=version,
author="Richard Hull",
author_email="richard.hull@destructuring-bind.org",
description="A library to drive a MAX7219 LED serializer (using SPI) and WS2812 NeoPixels (using DMA)",
long_description="\n\n".join([README, CONTRIB, CHANGES]),
long_description_content_type="text/x-rst",
license="MIT",
keywords=[
"raspberry pi", "rpi", "led", "max7219", "matrix", "seven segment", "7 segment",
"neopixel", "neosegment", "ws2812", "ws281x", "apa102", "unicorn-phat",
"unicorn-hat", "unicorn-hat-hd"
],
url=project_url,
download_url=project_url + '/tarball/' + version,
project_urls={
'Documentation': 'https://luma-led-matrix.readthedocs.io',
'Source': project_url,
'Issue Tracker': project_url + '/issues',
},
packages=find_packages(),
namespace_packages=["luma"],
install_requires=["luma.core>=1.14.0"],
setup_requires=pytest_runner,
tests_require=test_deps,
extras_require={
':platform_machine=="armv7l" and platform_system=="Linux"': [
'ws2812', 'rpi_ws281x'
],
'docs': [
'sphinx >= 1.5.1'
],
'qa': [
'rstcheck',
'flake8'
],
'test': test_deps
},
zip_safe=False,
python_requires='>=3.6, <4',
classifiers=[
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Education",
"Topic :: System :: Hardware",
"Topic :: System :: Hardware :: Hardware Drivers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: POSIX",
"Operating System :: Unix"
]
)
if __name__ == "__main__":
setuptools.setup()