Skip to content

Commit b3edd80

Browse files
committed
Migrate most of the project to pyproject.toml
1 parent 5bd2301 commit b3edd80

File tree

2 files changed

+56
-40
lines changed

2 files changed

+56
-40
lines changed

pyproject.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
[build-system]
2+
requires = ["setuptools>=60", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sccontroller"
7+
version = "0.4.9.3" # Replace with DAEMON_VERSION or vice versa?
8+
description = "User-mode driver, mapper and GTK3 based GUI for Steam Controller, DS4 and similar controllers."
9+
authors = [{name = "C0rn3j", email = "martin@rys.rs"}]
10+
license = {text = "GPL-2.0-only"}
11+
keywords = ["controller", "mapping", "tools"]
12+
classifiers = [
13+
"Programming Language :: Python :: 3",
14+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
15+
"Operating System :: POSIX :: Linux"
16+
]
17+
requires-python = ">=3.8"
18+
#platforms = ["Linux"]
19+
20+
[tool.setuptools]
21+
packages = [
22+
"scc",
23+
"scc.drivers",
24+
"scc.lib",
25+
"scc.x11",
26+
"scc.osd",
27+
"scc.foreign",
28+
"scc.gui",
29+
"scc.gui.ae",
30+
"scc.gui.importexport",
31+
"scc.gui.creg"
32+
]
33+
34+
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts
35+
[project.scripts]
36+
scc-daemon = "scripts.scc_daemon"
37+
sc-controller = "scripts.sc_controller"
38+
scc = "scripts.scc"
39+
scc-osd-dialog = "scripts.scc_osd_dialog"
40+
scc-osd-keyboard = "scripts.scc_osd_keyboard"
41+
scc-osd-launcher = "scripts.scc_osd_launcher"
42+
scc-osd-menu = "scripts.scc_osd_menu"
43+
scc-osd-message = "scripts.scc_osd_message"
44+
scc-osd-radial-menu = "scripts.scc_osd_radial_menu"
45+
scc-osd-show-bindings = "scripts.scc_osd_show_bindings"
46+
147
[tool.ruff]
248
# Target non-EOL releases at minimum, or later if needed
349
# https://devguide.python.org/versions/

setup.py

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
from setuptools import Extension, setup
55

6-
from scc.constants import DAEMON_VERSION
7-
86
data_files = [
97
("share/scc/glade", glob.glob("glade/*.glade")),
108
("share/scc/glade/ae", glob.glob("glade/ae/*.glade")),
@@ -35,43 +33,15 @@
3533
) for x in glob.glob("images/menu-icons/*")
3634
]
3735

38-
39-
packages = [
40-
# Required
41-
"scc", "scc.drivers", "scc.lib",
42-
# Useful
43-
"scc.x11", "scc.osd", "scc.foreign",
44-
# GUI
45-
"scc.gui", "scc.gui.ae", "scc.gui.importexport", "scc.gui.creg",
36+
extensions = [
37+
Extension("libuinput", sources=["scc/uinput.c"]),
38+
Extension("libcemuhook", define_macros=[("PYTHON", "1")], sources=["scc/cemuhook_server.c"], libraries=["z"]),
39+
Extension("libhiddrv", sources=["scc/drivers/hiddrv.c"]),
40+
Extension("libsc_by_bt", sources=["scc/drivers/sc_by_bt.c"]),
41+
Extension("libremotepad", sources=["scc/drivers/remotepad_controller.c"]),
4642
]
4743

48-
if __name__ == "__main__":
49-
setup(name = "sccontroller",
50-
version = DAEMON_VERSION,
51-
description = "Standalone controller maping tool",
52-
author = "C0rn3j",
53-
packages = packages,
54-
data_files = data_files,
55-
scripts = [
56-
"scripts/scc-daemon",
57-
"scripts/sc-controller",
58-
"scripts/scc",
59-
"scripts/scc-osd-dialog",
60-
"scripts/scc-osd-keyboard",
61-
"scripts/scc-osd-launcher",
62-
"scripts/scc-osd-menu",
63-
"scripts/scc-osd-message",
64-
"scripts/scc-osd-radial-menu",
65-
"scripts/scc-osd-show-bindings",
66-
],
67-
license = "GPL-2.0-only",
68-
platforms = ["Linux"],
69-
ext_modules = [
70-
Extension("libuinput", sources = ["scc/uinput.c"]),
71-
Extension("libcemuhook", define_macros = [("PYTHON", 1)],
72-
sources = ["scc/cemuhook_server.c"], libraries = ["z"]),
73-
Extension("libhiddrv", sources = ["scc/drivers/hiddrv.c"]),
74-
Extension("libsc_by_bt", sources = ["scc/drivers/sc_by_bt.c"]),
75-
Extension("libremotepad", sources = ["scc/drivers/remotepad_controller.c"]),
76-
],
77-
)
44+
setup(
45+
ext_modules=extensions,
46+
data_files = data_files,
47+
)

0 commit comments

Comments
 (0)