Skip to content

Commit fc0ab2f

Browse files
authored
Merge pull request #774 from akx/modernize-build
Modernize build (to Hatch)
2 parents 9f401fc + 8da0ff9 commit fc0ab2f

File tree

9 files changed

+96
-83
lines changed

9 files changed

+96
-83
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-python@v4
9+
with:
10+
python-version: 3
11+
- run: pip install build
12+
- run: python -m build .
13+
- uses: actions/upload-artifact@v4
14+
with:
15+
name: dist
16+
path: dist

MANIFEST.in

Lines changed: 0 additions & 10 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ PYTHON?=python3
55
.PHONY : all clean clean-build clean-pyc clean-test install test upload
66

77
all :
8-
$(PYTHON) ./setup.py build
98

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

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

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

3433
test :
35-
$(PYTHON) setup.py test
34+
$(PYTHON) -m pytest .
3635
$(MAKE) -C test test
3736

3837
upload : test
39-
$(PYTHON) ./setup.py sdist upload
38+
$(PYTHON) -m hatch build
39+
$(PYTHON) -m hatch publish

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Once you have the code, it can be installed from your repository as well:
6767
::
6868

6969
cd paho.mqtt.python
70-
python setup.py install
70+
pip install -e .
7171

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

pyproject.toml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,76 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "paho-mqtt"
7+
dynamic = ["version"]
8+
description = "MQTT version 5.0/3.1.1 client class"
9+
readme = "README.rst"
10+
# see https://lists.spdx.org/g/Spdx-legal/topic/request_for_adding_eclipse/67981884
11+
# for why Eclipse Distribution License v1.0 is listed as BSD-3-Clause
12+
license = "EPL-2.0 OR BSD-3-Clause"
13+
requires-python = ">=3.7"
14+
authors = [
15+
{ name = "Roger Light", email = "[email protected]" },
16+
]
17+
keywords = [
18+
"paho",
19+
]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved",
24+
"Natural Language :: English",
25+
"Operating System :: MacOS :: MacOS X",
26+
"Operating System :: Microsoft :: Windows",
27+
"Operating System :: POSIX",
28+
"Programming Language :: Python",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.10",
34+
"Topic :: Communications",
35+
"Topic :: Internet",
36+
]
37+
dependencies = []
38+
39+
[project.optional-dependencies]
40+
proxy = [
41+
"PySocks",
42+
]
43+
44+
[project.urls]
45+
Homepage = "http://eclipse.org/paho"
46+
47+
[tool.hatch.version]
48+
path = "src/paho/mqtt/__init__.py"
49+
50+
[tool.hatch.build.targets.sdist]
51+
include = [
52+
"src/paho",
53+
"/examples",
54+
"/tests",
55+
"about.html",
56+
"CONTRIBUTING.md",
57+
"edl-v10",
58+
"epl-v20",
59+
"LICENSE.txt",
60+
"notice.html",
61+
"README.rst",
62+
]
63+
64+
[tool.hatch.build.targets.wheel]
65+
sources = ["src"]
66+
include = [
67+
"src/paho",
68+
]
69+
70+
[tool.pytest.ini_options]
71+
addopts = ["-r", "xs"]
72+
testpaths = "tests src"
73+
174
[tool.ruff]
275
line-length = 167
376

@@ -28,4 +101,4 @@ extend-select = [
28101
"F841",
29102
"I",
30103
"S",
31-
]
104+
]

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pylama==7.7.1
22
pytest==5.2.2; python_version >= '3.0'
3-
pytest-runner==5.2
43
tox==3.14.0

setup.cfg

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ allowlist_externals =
1111
make
1212
commands =
1313
ruff .
14-
python setup.py test
14+
pytest
1515
make -C test test
1616

1717
[testenv:lint]

0 commit comments

Comments
 (0)