Skip to content

Commit 71e3a4a

Browse files
committed
update packaging standard to 2026
1 parent 06c8055 commit 71e3a4a

8 files changed

Lines changed: 107 additions & 77 deletions

File tree

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
*.egg
2-
*.egg-info
2+
*.egg-info/
33
__pycache__
44
.vscode
55
.coverage
66
.tox
7-
build
8-
dist
7+
build/
8+
dist/
99
htmlcov

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include pyproject.toml
12
include AUTHORS
23
include CHANGELOG.rst
34
include COPYING

README.rst

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ Installation
8484
8585
$ pip install launchd
8686
87-
or, if you want to work using the source tarball:
87+
or, if you prefer working from a local checkout:
8888

8989
.. code-block:: bash
9090
91-
$ python setup.py install
91+
$ python -m build
92+
$ pip install dist/launchd-*.whl
9293
9394
9495
Requirements
@@ -101,3 +102,30 @@ SMAppService integration
101102
=======================
102103

103104
Job metadata is now collected through Apple’s `SMAppService <https://developer.apple.com/documentation/servicemanagement/smappservice>`_ API. Because that interface only exposes helper plists that the calling bundle can manage, `launchd.jobs()` now reports the property lists SMAppService can inspect (status, bundled configuration, etc.). `pid`/`LastExitStatus` therefore remain ``None`` in most cases, but ``properties["Config"]`` still contains the original plist contents. The low-level `launchctl` binary remains the implementation for ``load()``/``unload()`` until Apple publishes a direct replacement.
105+
106+
Development
107+
===========
108+
109+
Run the unit tests (example uses Python 3.10):
110+
111+
.. code-block:: bash
112+
113+
$ tox -e py310
114+
115+
Verify style/lint checks:
116+
117+
.. code-block:: bash
118+
119+
$ tox -e style
120+
121+
Build the source distribution and wheel:
122+
123+
.. code-block:: bash
124+
125+
$ python -m build
126+
127+
Publish via Twine (this rebuilds as part of the command):
128+
129+
.. code-block:: bash
130+
131+
$ tox -e release

pyproject.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[build-system]
2+
requires = ["setuptools>=70.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "launchd"
7+
dynamic = ["version"]
8+
description = "pythonic interface for macOS launchd"
9+
readme = { file = "README.rst", content-type = "text/x-rst" }
10+
requires-python = ">=3.10"
11+
license = "MIT"
12+
dependencies = ["pyobjc-framework-ServiceManagement"]
13+
keywords = ["launchd", "macOS", "ServiceManagement", "pyobjc"]
14+
classifiers = [
15+
"Development Status :: 3 - Alpha",
16+
"Intended Audience :: Developers",
17+
"Intended Audience :: System Administrators",
18+
"Topic :: Software Development :: Libraries :: Python Modules",
19+
"Environment :: MacOS X",
20+
"Natural Language :: English",
21+
"Operating System :: MacOS :: MacOS X",
22+
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: Implementation :: CPython",
27+
]
28+
authors = [
29+
{ name = "Paul Kremer", email = "paul@spurious.biz" },
30+
]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/infothrill/python-launchd"
34+
Repository = "https://github.com/infothrill/python-launchd"
35+
Issues = "https://github.com/infothrill/python-launchd/issues"
36+
37+
[tool.setuptools.dynamic]
38+
version = { attr = "launchd.__version__" }
39+
40+
[tool.setuptools.packages.find]
41+
where = ["."]
42+
include = ["launchd", "launchd.*"]
43+
44+
[tool.flake8]
45+
ignore = [
46+
"D100",
47+
"D101",
48+
"D102",
49+
"D103",
50+
"D104",
51+
"D200",
52+
"D204",
53+
"D205",
54+
]
55+
exclude = [".git", "__pycache__", "build", "dist", ".tox", ".eggs", ".direnv"]
56+
max-line-length = 120
57+
inline-quotes = "double"
58+
per-file-ignores = ["example.py:T201"]
59+
60+
[tool.check-manifest]
61+
ignore = [
62+
".coveragerc",
63+
".pre-commit-config.yaml",
64+
".pylintrc",
65+
".renovaterc.json",
66+
".github",
67+
"tox.ini",
68+
"requirements-style.txt",
69+
]

requirements-style.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pip
22
flake8>=3.7.5
3+
Flake8-pyproject>=1.2.4
34
pydocstyle==6.3.0
45
flake8-bandit>=1.0.1
56
flake8-bugbear>=17.12.0

setup.cfg

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

setup.py

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

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ commands = flake8 {posargs} --count --statistics
1919
skip_install = true
2020
allowlist_externals = rm
2121
deps =
22-
wheel
23-
setuptools
22+
build
2423
commands =
25-
rm -rf dist
26-
python setup.py -q sdist bdist_wheel
24+
rm -rf build dist
25+
python -m build --sdist --wheel
2726

2827
[testenv:release]
2928
skip_install = true

0 commit comments

Comments
 (0)