Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
branches:
- master
tags:
- "^[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build_and_deploy:
uses: sensirion/.github/.github/workflows/driver.python.pypi_publish.yml@main
uses: sensirion/.github/.github/workflows/python_package.pypi_publish.yml@main
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
---------

0.1.6
:::::
- Update project structure

0.1.5
:::::
- Move parts of ``ShdlcDevice`` into new base class ``ShdlcDeviceBase``
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This repository contains the base driver for Sensirion SHDLC devices as a Python
package. For details, please read the package description in
[README.rst](README.rst).
[README.rst](https://github.com/Sensirion/python-shdlc-driver/blob/master/README.rst).

## Usage

See package description in [README.rst](README.rst) and user manual at
See package description in [README.rst](https://github.com/Sensirion/python-shdlc-driver/blob/master/README.rst) and user manual at
https://sensirion.github.io/python-shdlc-driver/.

## Development
Expand Down Expand Up @@ -70,4 +70,4 @@ sphinx-versioning build docs docs/_build/html # Build documentation

## License

See [LICENSE](LICENSE).
See [LICENSE](https://github.com/Sensirion/python-shdlc-driver/blob/master/LICENSE).
12 changes: 6 additions & 6 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def pytest_addoption(parser):
"""
Register command line options
"""
parser.addoption("--serial-port", action="store", type="string")
parser.addoption("--serial-bitrate", action="store", type="int",
parser.addoption("--serial-port", action="store", type=str)
parser.addoption("--serial-bitrate", action="store", type=int,
default=115200)
parser.addoption("--serial-address", action="store", type="int", default=0)
parser.addoption("--tcp-ip", action="store", type="string")
parser.addoption("--tcp-port", action="store", type="int")
parser.addoption("--tcp-address", action="store", type="int", default=0)
parser.addoption("--serial-address", action="store", type=int, default=0)
parser.addoption("--tcp-ip", action="store", type=str)
parser.addoption("--tcp-port", action="store", type=int)
parser.addoption("--tcp-address", action="store", type=int, default=0)


def _get_serial_port(config, validate=False):
Expand Down
54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[build-system]
requires = ["hatchling >= 1.26", "wheel >= 0.45.0"]
build-backend = "hatchling.build"

[project]
name = "sensirion-shdlc-driver"
description = "Base Driver for Communicating With SHDLC Devices"

readme = "README.md"
version = "1.0.1"
requires-python = ">=3.8,<4.0"

authors = [
{ name = "Sensirion", email = "info@sensirion.com" },
]

license = "BSD-3-Clause"
license-files = ["LICENSE"]

keywords = ["sensirion", "shldc", "driver"]

classifiers = [
"Intended Audience :: Developers",
"Topic :: System :: Hardware :: Hardware Drivers",
"Topic :: Software Development :: Build Tools",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

dependencies = ['pyserial~=3.0', 'intelhex>=2.3.0']

[project.optional-dependencies]

docs = [

"sphinx-rtd-theme==3.0.2",
"sphinx==8.2.3"
]

test = [
"flake8>=7.1.0",
"mock~=5.2.0",
"pytest>=8.3.5",
"pytest-cov>=5.0.0",
"setuptools>=73.2.0"
]

[project.urls]
Changelog = "https://github.com/Sensirion/python-shdlc-driver/blob/master/CHANGELOG.rst"
Repository = "https://github.com/sensirion/python-shdlc-driver"
Documentation = "https://sensirion.github.io/python-shdlc-driver"

6 changes: 5 additions & 1 deletion sensirion_shdlc_driver/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
# (c) Copyright 2019 Sensirion AG, Switzerland

from __future__ import absolute_import, division, print_function
version = "0.1.6"

import importlib.metadata as metadata
from typing import Final

version: Final[str] = metadata.version("sensirion_shdlc_driver")
64 changes: 2 additions & 62 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,7 @@
# (c) Copyright 2019 Sensirion AG, Switzerland

from __future__ import absolute_import, division, print_function
from setuptools import setup, find_packages
import os
import re

from setuptools import setup

# Read version number from version.py
version_line = open("sensirion_shdlc_driver/version.py", "rt").read()
result = re.search(r"^version = ['\"]([^'\"]*)['\"]", version_line, re.M)
if result:
version_string = result.group(1)
else:
raise RuntimeError("Unable to find version string")


# Use README.rst and CHANGELOG.rst as package description
root_path = os.path.dirname(__file__)
readme = open(os.path.join(root_path, 'README.rst')).read()
changelog = open(os.path.join(root_path, 'CHANGELOG.rst')).read()
long_description = readme.strip() + "\n\n" + changelog.strip() + "\n"


setup(
name='sensirion-shdlc-driver',
version=version_string,
author='Sensirion',
author_email='info@sensirion.com',
description='Base Driver for Communicating With Sensirion SHDLC Devices',
license='BSD',
keywords='shdlc sensirion sensor driver',
url='https://github.com/sensirion/python-shdlc-driver',
packages=find_packages(exclude=['tests', 'tests.*']),
long_description=long_description,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
install_requires=[
'pyserial~=3.0',
],
extras_require={
# Dependencies for the firmware update (optional since not all devices
# support firmware updates)
'fwupdate': [
'intelhex~=2.0',
],
# Dependencies for tests
'test': [
'flake8~=3.7.8',
'intelhex~=2.0', # from the "fwupdate" extra
'mock~=3.0.0',
'pytest~=6.2.5',
'pytest-cov~=3.0.0',
]
},
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: System :: Hardware :: Hardware Drivers'
]
)
setup()
Loading