diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2a89a0a7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[project] +name = "obd" +version = "0.7.2" +authors = [ + { name="Brendan Whitfield", email="me@brendan-w.com" }, + { name="Alistair Francis", email="alistair@alistair23.me" }, + { name="Paul Bartek" }, + { name="Peter Harris" }, +] +description = "Serial module for handling live sensor data from a vehicle's OBD-II port" +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Operating System :: POSIX :: Linux", + "Topic :: System :: Monitoring", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Development Status :: 3 - Alpha", + "Topic :: System :: Logging", + "Intended Audience :: Developers", +] +keywords = ["obd", "obdii", "obd-ii", "obd2", "car", "serial", "vehicle", "diagnostic"] +dependencies = [ + "pyserial==3.*", + "pint==0.24.*", +] +license = "GPL-2.0-only" +license-files = ["LICENSE"] + +[project.urls] +Homepage = "https://github.com/brendan-w/python-OBD" +Issues = "https://github.com/brendan-w/python-OBD/issues" diff --git a/setup.py b/setup.py deleted file mode 100644 index f16a0232..00000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/env python -# -*- coding: utf-8 -*- - -from setuptools import setup, find_packages - -with open("README.md", "r") as readme: - long_description = readme.read() - -setup( - name="obd", - version="0.7.2", - description=("Serial module for handling live sensor data from a vehicle's OBD-II port"), - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Operating System :: POSIX :: Linux", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - "Topic :: System :: Monitoring", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Development Status :: 3 - Alpha", - "Topic :: System :: Logging", - "Intended Audience :: Developers", - ], - keywords="obd obdii obd-ii obd2 car serial vehicle diagnostic", - author="Brendan Whitfield", - author_email="brendanw@windworksdesign.com", - url="http://github.com/brendan-w/python-OBD", - license="GNU GPLv2", - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=["pyserial==3.*", "pint==0.24.*"], -) diff --git a/tests/README.md b/tests/README.md index 2ecfa72e..5f9c4573 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,10 +1,34 @@ Testing ======= -To test python-OBD, you will need to `pip install pytest` and install the module (preferably in a virtualenv) by running `python setup.py install`. The end-to-end tests will also require [obdsim](http://icculus.org/obdgpslogger/obdsim.html) to be running in the background. When starting obdsim, note the "SimPort name" that it creates, and pass it as an argument to py.test. +To test python-OBD, you will need to install `pytest` and the `obd` module from your local tree (preferably in a virtualenv) by running: -To run all tests, run the following command: +```bash +pip install pytest +pip install build +python -m build +pip install ./dist/obd-0.7.2.tar.gz +``` - $ py.test --port=/dev/pts/ +To run all basic python-only unit tests, run: + +```bash +py.test +``` + +This directory also contains a set of end-to-end tests that require [obdsim](http://icculus.org/obdgpslogger/obdsim.html) to be running in the background. These tests are skipped by default, but can be activated by passing the `--port` flag. + +- Download `obdgpslogger`: https://icculus.org/obdgpslogger/downloads/obdgpslogger-0.16.tar.gz +- Run the following build commands: + ```bash + mkdir build + cd build + cmake .. + make obdsim + ``` +- Start `./bin/obdsim`, note the `SimPort name: /dev/pts/` that it creates. Pass this pseudoterminal path as an argument to py.test: + ```bash + py.test --port=/dev/pts/ + ``` For more information on pytest with virtualenvs, [read more here](https://pytest.org/dev/goodpractises.html) \ No newline at end of file