Skip to content

Commit f967418

Browse files
committed
improve the packaging
1 parent fbb3cf4 commit f967418

File tree

6 files changed

+131
-96
lines changed

6 files changed

+131
-96
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ python:
77

88
deploy:
99
provider: pypi
10+
distributions: sdist
11+
server: https://testpypi.python.org/pypi
1012
user: skyplabs
1113
password:
1214
secure: ZXpnzRdJT0/lc5ZdY7XiGVQKJyFj7tWnRMSLlRC2CMk/kXnh+dC9JVyYowrTtW6Au0QqW1MwitSqaUSbwbnYnPRADc70gzQi6QZ2Of0fuDd9LgMYPmLAGofavFtHNxp4/QWi/mDF44cW+oIJ8aRYxmF18Uq56QRc//AqDGuVzr05norl3aFFxDcir9Eh5VZs9gCEKcqojFkjcltRRHk4OyP2eog1JsLXT2vOPmbmXTXPMDFM4kLQRsg8yh1wijHR6zqNidD4vZmzldDbzDeEYmN2N/kc9OQ4biESqaHDxvnkh0k6kZn0bDhwehP0zVUWC9OJQNeRh6MY5AiLqlvf6DkiI9iSDO0ABPRIzHMC4N13t+nWOERSb6ZX4+G5qWfnEAD6KDrSc0kS14k8GRhQ5ISWXi/7s1XkF6d6QXptwX4B4lLq9WLC6NwP8jYFmFHHVqyquXseKSFo3zgWQdMxNEnaPpJsYkX4X+YO0+lPIMtVLKJnEi98Lu8c362o7AypSsLGY+X3xyECZ3r1TVcPsAWWCJ/5Oo0SzKuEh+dhG3HTYHNIcXuJUxyqV6GHImVdwzNirRt8vbyvz9iTIT14DR1+J76RKiXlO0XywUch4D2WBczpo4BG28mAP5oLNy3kPvrh8wL7NvXthY1T2AMo4jXOpjCP8IfMijMqoB6cNUI=
1315
on:
1416
tags: true
15-
distributions: sdist bdist_wheel
1617
repo: SkypLabs/python4yahdlc
1718

1819
script: python setup.py test

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include src/*.c
22
include lib/*.c
33
include include/*.h
4-
include README.md
4+
include README.rst
5+
include LICENSE

README.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

README.rst

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
=============
2+
python4yahdlc
3+
=============
4+
5+
|Build Status|
6+
7+
python4yahdlc is a Python bindings for the
8+
`yahdlc <https://github.com/bang-olufsen/yahdlc>`__ library.
9+
10+
Dependencies
11+
============
12+
13+
To build and make the Python module work, you need the following
14+
elements :
15+
16+
- Python 3
17+
- The `setuptools <https://pypi.python.org/pypi/setuptools>`__ package
18+
19+
On Fedora
20+
---------
21+
22+
::
23+
24+
yum install python3-setuptools
25+
26+
On Debian
27+
---------
28+
29+
::
30+
31+
aptitude install python3-setuptools
32+
33+
Installation
34+
============
35+
36+
With pip (recommanded)
37+
----------------------
38+
39+
::
40+
41+
pip3 install python4yahdlc
42+
43+
From sources
44+
------------
45+
46+
::
47+
48+
git clone https://github.com/SkypLabs/python4yahdlc.git
49+
cd python4yahdlc
50+
python3 setup.py install
51+
52+
Usage
53+
=====
54+
55+
To generate a new HDLC data frame :
56+
57+
::
58+
59+
from yahdlc import *
60+
61+
frame = frame_data('hello world!')
62+
63+
To generate a new HDLC ACK frame with a specific sequence number :
64+
65+
::
66+
67+
frame = frame_data('', FRAME_ACK, 3)
68+
69+
The highest sequence number is 7 and the following frame types are
70+
available :
71+
72+
- FRAME\_DATA
73+
- FRAME\_ACK
74+
- FRAME\_NACK
75+
76+
Note that when you generate an ACK or NACK frame, the payload is
77+
useless.
78+
79+
To decode a received HDLC frame :
80+
81+
::
82+
83+
data, type, seq_no = get_data(frame)
84+
85+
For a more advanced use, take a look at the examples available in the
86+
`examples <https://github.com/SkypLabs/python4yahdlc/tree/master/examples>`__
87+
folder.
88+
89+
License
90+
=======
91+
92+
This project is released under the `GPL version
93+
3 <https://www.gnu.org/licenses/gpl.txt>`__ license. The
94+
`yahdlc <https://github.com/bang-olufsen/yahdlc>`__ library is released
95+
under the
96+
`MIT <https://github.com/bang-olufsen/yahdlc/blob/master/LICENSE>`__
97+
license.
98+
99+
.. |Build Status| image:: https://travis-ci.org/SkypLabs/python4yahdlc.svg
100+
:target: https://travis-ci.org/SkypLabs/python4yahdlc

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
#!/usr/bin/env python3
22

33
from setuptools import setup, Extension
4-
from os.path import dirname, abspath
4+
from os.path import dirname, abspath, join
5+
from codecs import open
56

67
DIR = dirname(abspath(__file__))
7-
VERSION = '1.0.3'
8+
VERSION = '1.0.4'
89

910
yahdlc = Extension(
10-
'yahdlc',
11-
sources = [
12-
DIR + '/src/python4yahdlc.c',
13-
DIR + '/lib/fcs16.c',
14-
DIR + '/lib/yahdlc.c'
15-
],
16-
include_dirs = [
17-
DIR + '/include/'
18-
],
11+
'yahdlc',
12+
sources = [
13+
DIR + '/src/python4yahdlc.c',
14+
DIR + '/lib/fcs16.c',
15+
DIR + '/lib/yahdlc.c'
16+
],
17+
include_dirs = [
18+
DIR + '/include/'
19+
],
1920
)
2021

22+
with open(join(DIR, 'README.rst'), encoding='utf-8') as f:
23+
long_description = f.read()
24+
2125
setup(
22-
name = 'python4yahdlc',
23-
version = VERSION,
24-
description = 'Python bindings for the yahdlc library',
25-
license = 'GPLv3',
26-
keywords = 'hdlc yahdlc bindings',
27-
author = 'Paul-Emmanuel Raoul',
28-
author_email = 'skyper@skyplabs.net',
29-
url = 'https://github.com/SkypLabs/python4yahdlc',
30-
download_url = 'https://github.com/SkypLabs/python4yahdlc/archive/v{0}.zip'.format(VERSION),
31-
setup_requires = ['setuptools-markdown'],
32-
long_description_markdown_filename = 'README.md',
33-
ext_modules = [yahdlc],
34-
test_suite = 'test',
26+
name = 'python4yahdlc',
27+
version = VERSION,
28+
description = 'Python bindings for the yahdlc library',
29+
long_description = long_description,
30+
license = 'GPLv3',
31+
keywords = 'hdlc yahdlc bindings',
32+
author = 'Paul-Emmanuel Raoul',
33+
author_email = 'skyper@skyplabs.net',
34+
url = 'https://github.com/SkypLabs/python4yahdlc',
35+
download_url = 'https://github.com/SkypLabs/python4yahdlc/archive/v{0}.zip'.format(VERSION),
36+
ext_modules = [yahdlc],
37+
test_suite = 'test',
3538
)

0 commit comments

Comments
 (0)