Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Switch to setuptools and add cythonize to build
Distutils is not fully supported by pip anymore and on newer versions of
pip packages installed that are using distuils can't be uninstalled.
This can be avoided by switching to setuptools to handle the packaging,
which this commit does.

Also, to enable working on newer versions of python this commit
integrates cythonize to the build workflow. This way regardless of
versions the c source file will be generated at build time by cython
and then compiled instead of manually generating them before the build.
The only tradeoff with this is that Cython becomes a build dependency
and must be installed prior to trying to build python-lirc.
  • Loading branch information
mtreinish committed Apr 7, 2019
commit 35a6c2084b88b12490a3aa561a991bf0af5aba57
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lirc/lirc.c
dist/
python_lirc.egg-info/
build/
5 changes: 0 additions & 5 deletions MANIFEST

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Cython==0.28.2
Cython>=0.28.2
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import sys
from distutils.core import setup, Extension
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize


lirc_ext = Extension(
'lirc',
include_dirs=['/usr/include/lirc/'],
libraries=['lirc_client'],
library_dirs=['/usr/lib'],
sources=['lirc/lirc.c']
sources=['lirc/lirc.pyx']
)

setup(
Expand All @@ -18,7 +19,10 @@
author_email='thomasmarkpreston@gmail.com',
license='GPLv3+',
url='https://github.com/tompreston/python-lirc',
ext_modules=[lirc_ext],
setup_requires=['Cython>=0.28.2'],
packages=find_packages(),
ext_modules=cythonize([lirc_ext]),
zip_safe=False,
long_description=open('README.md').read() + open('CHANGELOG').read(),
classifiers=[
"License :: OSI Approved :: GNU Affero General Public License v3 or "
Expand Down