Skip to content

Commit

Permalink
Merge pull request #76 from hnez/pyproject-toml
Browse files Browse the repository at this point in the history
pyproject.toml: switch over from setup.py
  • Loading branch information
SmithChart authored May 8, 2024
2 parents b0c2903 + f1a2895 commit 2da3f46
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 152 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include COPYING
include fastentrypoints.py
graft contrib

global-exclude .*
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ PYTHON_QA_ENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-qa-env
# packaging environment #######################################################
.PHONY: packaging-env build _release

$(PYTHON_PACKAGING_VENV)/.created: REQUIREMENTS.packaging.txt
$(PYTHON_PACKAGING_VENV)/.created:
rm -rf $(PYTHON_PACKAGING_VENV) && \
$(PYTHON) -m venv $(PYTHON_PACKAGING_VENV) && \
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
$(PYTHON) -m pip install --upgrade pip && \
$(PYTHON) -m pip install -r REQUIREMENTS.packaging.txt
$(PYTHON) -m pip install build twine
date > $(PYTHON_PACKAGING_VENV)/.created

.PHONY: packaging-env build _release

packaging-env: $(PYTHON_PACKAGING_VENV)/.created

build: packaging-env
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
rm -rf dist *.egg-info && \
./setup.py sdist
$(PYTHON) -m build

_release: build
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
Expand All @@ -37,12 +39,12 @@ envs: packaging-env qa-env
# testing #####################################################################
.PHONY: qa qa-env qa-codespell qa-pytest qa-ruff

$(PYTHON_QA_ENV)/.created: REQUIREMENTS.qa.txt
$(PYTHON_QA_ENV)/.created:
rm -rf $(PYTHON_QA_ENV) && \
$(PYTHON) -m venv $(PYTHON_QA_ENV) && \
. $(PYTHON_QA_ENV)/bin/activate && \
$(PYTHON) -m pip install pip --upgrade && \
$(PYTHON) -m pip install -r ./REQUIREMENTS.qa.txt && \
$(PYTHON) -m pip install codespell ruff pytest pytest-mock && \
date > $(PYTHON_QA_ENV)/.created

qa-env: $(PYTHON_QA_ENV)/.created
Expand Down
15 changes: 13 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,20 @@ MQTT Statistics
---------------

This tool can be configured to send certain statistics to a MQTT broker.
To enable this function create a config file at ``/etc/usbsdmux.config`` or use ``--config`` specify a file location.
To use this feature the `usbsdmux` util has to be installed with some
additional dependencies:

See example config file `usbsdmux.config <contrib/usbsdmux.config>`_.
.. code-block:: bash
$ python3 -m venv venv
$ source venv/bin/activate
$ python3 -m pip install "usbsdmux[mqtt]"
To enable this feature create a config file at ``/etc/usbsdmux.config``
or use ``--config`` to specify a file location.

See the example config file `usbsdmux.config <contrib/usbsdmux.config>`_
for available configuration options.


Troubleshooting
Expand Down
1 change: 0 additions & 1 deletion REQUIREMENTS.mqtt.txt

This file was deleted.

2 changes: 0 additions & 2 deletions REQUIREMENTS.packaging.txt

This file was deleted.

110 changes: 0 additions & 110 deletions fastentrypoints.py

This file was deleted.

39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "usbsdmux"
description = "Tool to control an USB-SD-Mux from the command line"
version = "24.01.1"
authors = [
{ name = "Chris Fiege", email = "[email protected]" },
]
readme = "README.rst"
license = { "text" = "LGPL-2.1-or-later" }
dependencies = []
classifiers = [
"Environment :: Console",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
]

[project.optional-dependencies]
mqtt = ["paho-mqtt"]

[project.urls]
homepage="https://github.com/linux-automation/usbsdmux"
documentation="https://www.linux-automation.com/usbsdmux-M01/"

[project.scripts]
usbsdmux = "usbsdmux.__main__:main"
usbsdmux-configure = "usbsdmux.usb2642eeprom:main"
usbsdmux-service = "usbsdmux.service:main"

[tool.setuptools]
packages = [
"usbsdmux",
]
include-package-data = true

[tool.ruff]
line-length = 119
exclude = [
Expand Down
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

24 changes: 0 additions & 24 deletions setup.py

This file was deleted.

0 comments on commit 2da3f46

Please sign in to comment.