Skip to content

Commit

Permalink
pyproject.toml: switch over the package build to pyproject.toml
Browse files Browse the repository at this point in the history
This removes fastentrypoints.py and moves the dependency management
to the pyproject.toml (for the usbsdmux package) or the Makefile
for the packaging and qa jobs (just so we do not have any
REQUIREMENTS.txt files anymore).

Signed-off-by: Leonard Göhrs <[email protected]>
  • Loading branch information
hnez committed Apr 29, 2024
1 parent bcf9ec0 commit 0428f47
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 150 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
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 0428f47

Please sign in to comment.