Skip to content

Commit 0ce62bb

Browse files
committed
use hatchling instead of setuptool
1 parent d992ca6 commit 0ce62bb

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

wrappers/python/hatch_build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
2+
3+
class CustomBuildHook(BuildHookInterface):
4+
def initialize(self, version, build_data):
5+
build_data['infer_tag'] = True

wrappers/python/pyproject.toml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "pyrealsense2"
7-
authors = [
8-
{ name = "Intel(R) RealSense(TM)", email = "[email protected]" },
9-
]
107
dynamic = ["version"]
118
description = "Python Wrapper for Intel Realsense SDK 2.0."
129
readme = {file = "README.rst", content-type = "text/x-rst", charset = "utf-8"}
10+
authors = [
11+
{ name = "Intel(R) RealSense(TM)", email = "[email protected]" },
12+
]
1313
license = {text = "Apache License, Version 2.0"}
14-
14+
requires-python = ">=3.9"
1515
classifiers = [
1616
"Development Status :: 3 - Alpha",
1717
"Environment :: Console",
@@ -35,26 +35,27 @@ classifiers = [
3535
"Topic :: Software Development",
3636
"Topic :: Software Development :: Libraries :: Application Frameworks"
3737
]
38-
requires-python = ">=3.9"
38+
39+
[tool.hatch.version]
40+
path = "pyrealsense2/_version.py"
3941

4042
[project.urls]
4143
homepage = "https://github.com/IntelRealSense/librealsense"
4244

43-
[tool.setuptools]
44-
packages = {find = {exclude = ["third_party", "docs", "examples"]}}
45-
py-modules = []
46-
include-package-data = true
47-
4845
[project.scripts]
4946
align-depth2color = "examples.align_depth2color:main"
5047
export_ply_example = "examples.export_ply:main"
5148
opencv_viewer_example = "examples.opencv_viewer:main"
5249
python-rs400-advanced-mode-example = "examples.rs400_advanced_mode:main"
5350
python-tutorial-1-depth = "examples.tutorial_1_depth:main"
5451

55-
#specifies non-Python files to include in the pyrealsense2 package
56-
[tool.setuptools.package-data]
57-
pyrealsense2 = ["*.so", "*.pyd", "*.dll"]
52+
[tool.hatch.build]
53+
artifacts = [
54+
"pyrealsense2/*.so",
55+
"pyrealsense2/*.pyd",
56+
"pyrealsense2/*.dll"
57+
]
58+
packages = ["pyrealsense2"]
5859

59-
[tool.setuptools.dynamic]
60-
version = {attr = "pyrealsense2._version.__version__"}
60+
[tool.hatch.build.targets.wheel.hooks.custom]
61+
path = "hatch_build.py"

wrappers/python/setup.py

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

0 commit comments

Comments
 (0)