Skip to content

Commit e0da0d7

Browse files
authored
Merge pull request #4 from bobatsar/master
Add setup.py
2 parents dbb4648 + 72c993d commit e0da0d7

File tree

6 files changed

+44
-4
lines changed

6 files changed

+44
-4
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__pycache__/*
2-
src/__pycache__/*
1+
**/__pycache__/*
2+
src/ppk2_api.egg-info

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
3. read stream of data
88
"""
99
import time
10-
from src.ppk2_api import PPK2_API
10+
from ppk2_api.ppk2_api import PPK2_API
1111

1212
ppk2s_connected = PPK2_API.list_devices()
1313
if(len(ppk2s_connected) == 1):

setup.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
3+
from __future__ import absolute_import
4+
from __future__ import print_function
5+
6+
import io
7+
from glob import glob
8+
from os.path import basename
9+
from os.path import dirname
10+
from os.path import join
11+
from os.path import splitext
12+
13+
from setuptools import find_packages
14+
from setuptools import setup
15+
16+
17+
def read(*names, **kwargs):
18+
with io.open(
19+
join(dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8")
20+
) as fh:
21+
return fh.read()
22+
23+
24+
setup(
25+
name="ppk2-api",
26+
version="0.0.1",
27+
description="API for Nordic Semiconductor's Power Profiler Kit II (PPK 2).",
28+
url="https://github.com/IRNAS/ppk2-api-python",
29+
packages=find_packages("src"),
30+
package_dir={"": "src"},
31+
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
32+
install_requires=[
33+
"pyserial",
34+
],
35+
classifiers=[
36+
"Programming Language :: Python :: 3",
37+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
38+
"Operating System :: OS Independent",
39+
],
40+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# import numpy as np
66
# import matplotlib.pyplot as plt
77
# import matplotlib
8-
from src.ppk2_api import PPK2_API
8+
from ppk2_api.ppk2_api import PPK2_API
99

1010
class PowerProfiler():
1111
def __init__(self, serial_port=None, source_voltage_mV=3300, filename=None):

src/ppk2_api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)