Skip to content

Commit

Permalink
Migrate most of the project to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Sep 28, 2024
1 parent 5bd2301 commit b3edd80
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 40 deletions.
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
[build-system]
requires = ["setuptools>=60", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "sccontroller"
version = "0.4.9.3" # Replace with DAEMON_VERSION or vice versa?
description = "User-mode driver, mapper and GTK3 based GUI for Steam Controller, DS4 and similar controllers."
authors = [{name = "C0rn3j", email = "[email protected]"}]
license = {text = "GPL-2.0-only"}
keywords = ["controller", "mapping", "tools"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux"
]
requires-python = ">=3.8"
#platforms = ["Linux"]

[tool.setuptools]
packages = [
"scc",
"scc.drivers",
"scc.lib",
"scc.x11",
"scc.osd",
"scc.foreign",
"scc.gui",
"scc.gui.ae",
"scc.gui.importexport",
"scc.gui.creg"
]

# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts
[project.scripts]
scc-daemon = "scripts.scc_daemon"
sc-controller = "scripts.sc_controller"
scc = "scripts.scc"
scc-osd-dialog = "scripts.scc_osd_dialog"
scc-osd-keyboard = "scripts.scc_osd_keyboard"
scc-osd-launcher = "scripts.scc_osd_launcher"
scc-osd-menu = "scripts.scc_osd_menu"
scc-osd-message = "scripts.scc_osd_message"
scc-osd-radial-menu = "scripts.scc_osd_radial_menu"
scc-osd-show-bindings = "scripts.scc_osd_show_bindings"

[tool.ruff]
# Target non-EOL releases at minimum, or later if needed
# https://devguide.python.org/versions/
Expand Down
50 changes: 10 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from setuptools import Extension, setup

from scc.constants import DAEMON_VERSION

data_files = [
("share/scc/glade", glob.glob("glade/*.glade")),
("share/scc/glade/ae", glob.glob("glade/ae/*.glade")),
Expand Down Expand Up @@ -35,43 +33,15 @@
) for x in glob.glob("images/menu-icons/*")
]


packages = [
# Required
"scc", "scc.drivers", "scc.lib",
# Useful
"scc.x11", "scc.osd", "scc.foreign",
# GUI
"scc.gui", "scc.gui.ae", "scc.gui.importexport", "scc.gui.creg",
extensions = [
Extension("libuinput", sources=["scc/uinput.c"]),
Extension("libcemuhook", define_macros=[("PYTHON", "1")], sources=["scc/cemuhook_server.c"], libraries=["z"]),
Extension("libhiddrv", sources=["scc/drivers/hiddrv.c"]),
Extension("libsc_by_bt", sources=["scc/drivers/sc_by_bt.c"]),
Extension("libremotepad", sources=["scc/drivers/remotepad_controller.c"]),
]

if __name__ == "__main__":
setup(name = "sccontroller",
version = DAEMON_VERSION,
description = "Standalone controller maping tool",
author = "C0rn3j",
packages = packages,
data_files = data_files,
scripts = [
"scripts/scc-daemon",
"scripts/sc-controller",
"scripts/scc",
"scripts/scc-osd-dialog",
"scripts/scc-osd-keyboard",
"scripts/scc-osd-launcher",
"scripts/scc-osd-menu",
"scripts/scc-osd-message",
"scripts/scc-osd-radial-menu",
"scripts/scc-osd-show-bindings",
],
license = "GPL-2.0-only",
platforms = ["Linux"],
ext_modules = [
Extension("libuinput", sources = ["scc/uinput.c"]),
Extension("libcemuhook", define_macros = [("PYTHON", 1)],
sources = ["scc/cemuhook_server.c"], libraries = ["z"]),
Extension("libhiddrv", sources = ["scc/drivers/hiddrv.c"]),
Extension("libsc_by_bt", sources = ["scc/drivers/sc_by_bt.c"]),
Extension("libremotepad", sources = ["scc/drivers/remotepad_controller.c"]),
],
)
setup(
ext_modules=extensions,
data_files = data_files,
)

0 comments on commit b3edd80

Please sign in to comment.