Skip to content

Commit

Permalink
Convert build to hatch
Browse files Browse the repository at this point in the history
Signed-off-by: Aarni Koskela <[email protected]>
  • Loading branch information
akx committed Dec 21, 2023
1 parent a2d01de commit ed82804
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 72 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include edl-v10 epl-v10
include README.rst
include CONTRIBUTING.md
include setup.py
include notice.html
include LICENSE.txt
include about.html
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ PYTHON?=python3
.PHONY : all clean clean-build clean-pyc clean-test install test upload

all :
$(PYTHON) ./setup.py build

install : all
$(PYTHON) ./setup.py install --root=${DESTDIR}
$(PYTHON) -m pip install -e .

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

Expand All @@ -32,8 +31,9 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/

test :
$(PYTHON) setup.py test
$(PYTHON) -m pytest .
$(MAKE) -C test test

upload : test
$(PYTHON) ./setup.py sdist upload
$(PYTHON) -m hatch build
$(PYTHON) -m hatch publish
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Once you have the code, it can be installed from your repository as well:
::

cd paho.mqtt.python
python setup.py install
pip install -e .

To perform all test (including MQTT v5 test), you also need to clone paho.mqtt.testing in paho.mqtt.python folder::

Expand Down
70 changes: 70 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "paho-mqtt"
dynamic = ["version"]
description = "MQTT version 5.0/3.1.1 client class"
readme = "README.rst"
# see https://lists.spdx.org/g/Spdx-legal/topic/request_for_adding_eclipse/67981884
# for why Eclipse Distribution License v1.0 is listed as BSD-3-Clause
license = "EPL-2.0 OR BSD-3-Clause"
requires-python = ">=3.7"
authors = [
{ name = "Roger Light", email = "[email protected]" },
]
keywords = [
"paho",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Communications",
"Topic :: Internet",
]
dependencies = []

[project.optional-dependencies]
proxy = [
"PySocks",
]

[project.urls]
Homepage = "http://eclipse.org/paho"

[tool.hatch.version]
path = "src/paho/mqtt/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/src",
"/examples",
"about.html",
"CONTRIBUTING.md",
"edl-v10",
"epl-v10",
"LICENSE.txt",
"notice.html",
"README.rst",
]

[tool.hatch.build.targets.wheel]
include = [
"/src",
]

[tool.pytest.ini_options]
addopts = ["-r", "xs"]
testpaths = "tests src"
8 changes: 0 additions & 8 deletions setup.cfg

This file was deleted.

57 changes: 0 additions & 57 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ commands =
# $EXCLUDE is defined above in testenv:py27 as a workaround for Python 2
# which does not support asyncio and type hints
flake8 . --count --select=E9,F63,F7,F822,F823 --show-source --statistics {env:EXCLUDE:}
python setup.py test
pytest
make -C test test
# TODO (cclauss) Fix up all these undefined names
flake8 . --count --exit-zero --select=F821 --show-source --statistics
Expand Down

0 comments on commit ed82804

Please sign in to comment.