Skip to contentSkip to conversation

libselinux: add pyproject.toml file

PATCH Superseded Stephen Smalley 2 participants 7 messages Jul 21 – Jul 24 SELinux security module

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH 1/2 libselinux: add pyproject.toml file

Add a pyproject.toml file for the libselinux python bindings.

---

NB I don't understand this sufficiently to fully migrate setup.py but hopefully this addresses the issue?

 libselinux/src/pyproject.toml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 libselinux/src/pyproject.toml
libselinux/src/pyproject.toml new file +24 -0
new file mode 100644
index 00000000..dfc44e81
@@ -0,0 +1,24 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "selinux"
+version = "3.11"
+description = "Python bindings for libselinux (SELinux userspace library)"
+readme = "../README.md"
+license = "libselinux-1.0"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "Operating System :: POSIX :: Linux",
+    "Topic :: Security",
+]
+
+[project.urls]
+Homepage = "https://github.com/SELinuxProject/selinux"
+
+# The actual .so is produced by a custom build_ext (SWIG + libselinux.so),
+# driven from setup.py.
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH 2/2 python/sepolicy: add a pyproject.toml file

Add a pyproject.toml file for the sepolicy python module. This required also updating setup.py to avoid defining author outside of pyproject.toml, and I further updated the authors to refer to the list like libselinux since Dan is enjoying retirement.

---
 python/sepolicy/pyproject.toml | 19 +++++++++++++++++++
 python/sepolicy/setup.py       |  2 --
 2 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 python/sepolicy/pyproject.toml
python/sepolicy/pyproject.toml new file +19 -0
new file mode 100644
index 00000000..472faf7a
@@ -0,0 +1,19 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sepolicy"
+version = "3.11"
+description = "Python tools for SELinux policy analysis (sepolicy, sepolgen)"
+license = "GPL-2.0-or-later"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+dependencies = [
+    "libselinux-python",
+    "libsemanage-python",
+]
+
+[project.scripts]
+sepolicy = "sepolicy.__main__:main"
python/sepolicy/setup.py +0 -2
index ca0396b5..5c4f2e5d 100644
@@ -8,8 +8,6 @@ setup(
     name="sepolicy",
     version="3.11",
     description="Python SELinux Policy Analyses bindings",
-    author="Daniel Walsh",
-    author_email="[email protected]",
     packages=[
         "sepolicy",
         "sepolicy.templates",
Signature · 1 line
2.55.0
#2 lore raw

Re: [PATCH 2/2] python/sepolicy: add a pyproject.toml file

Quoted 43 lines · Stephen Smalley

Add a pyproject.toml file for the sepolicy python module. This required also updating setup.py to avoid defining author outside of pyproject.toml, and I further updated the authors to refer to the list like libselinux since Dan is enjoying retirement.

---
  python/sepolicy/pyproject.toml | 19 +++++++++++++++++++
  python/sepolicy/setup.py       |  2 --
  2 files changed, 19 insertions(+), 2 deletions(-)

create mode 100644 python/sepolicy/pyproject.toml

python/sepolicy/pyproject.toml new file +19 -0
new file mode 100644
index 00000000..472faf7a
@@ -0,0 +1,19 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sepolicy"
+version = "3.11"
+description = "Python tools for SELinux policy analysis (sepolicy, sepolgen)"
+license = "GPL-2.0-or-later"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+dependencies = [
+    "libselinux-python",
+    "libsemanage-python",
+]
+
+[project.scripts]
+sepolicy = "sepolicy.__main__:main"
python/sepolicy/setup.py +0 -0
index ca0396b5..5c4f2e5d 100644

python/sepolicy/setup.py setup( · line 13

Quoted 8 lines
python/sepolicy/setup.py +0 -2
@@ -8,8 +8,6 @@ setup(
      name="sepolicy",
      version="3.11",
      description="Python SELinux Policy Analyses bindings",
-    author="Daniel Walsh",
-    author_email="[email protected]",
      packages=[
          "sepolicy",
          "sepolicy.templates",

lgtm, or at least i don't see the warning anymore in the build system

author maintainer
#3 lore raw

Re: [PATCH 2/2] python/sepolicy: add a pyproject.toml file

Quoted 47 lines · Cathy Hu
Quoted 45 lines · Stephen Smalley

Add a pyproject.toml file for the sepolicy python module. This required also updating setup.py to avoid defining author outside of pyproject.toml, and I further updated the authors to refer to the list like libselinux since Dan is enjoying retirement.

---
  python/sepolicy/pyproject.toml | 19 +++++++++++++++++++
  python/sepolicy/setup.py       |  2 --
  2 files changed, 19 insertions(+), 2 deletions(-)

create mode 100644 python/sepolicy/pyproject.toml

python/sepolicy/pyproject.toml new file +19 -0
new file mode 100644
index 00000000..472faf7a
@@ -0,0 +1,19 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sepolicy"
+version = "3.11"
+description = "Python tools for SELinux policy analysis (sepolicy, sepolgen)"
+license = "GPL-2.0-or-later"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+dependencies = [
+    "libselinux-python",
+    "libsemanage-python",
+]
+
+[project.scripts]
+sepolicy = "sepolicy.__main__:main"
python/sepolicy/setup.py +0 -0
index ca0396b5..5c4f2e5d 100644
@@ -8,8 +8,6 @@ setup(
      name="sepolicy",
      version="3.11",
Quoted 8 lines

python/sepolicy/setup.py setup( · line 13

Quoted 6 lines
python/sepolicy/setup.py +0 -2
      description="Python SELinux Policy Analyses bindings",
-    author="Daniel Walsh",
-    author_email="[email protected]",
      packages=[
          "sepolicy",
          "sepolicy.templates",

lgtm, or at least i don't see the warning anymore in the build system

Thanks, both merged.

author maintainer
#4 lore raw

Re: [PATCH 2/2] python/sepolicy: add a pyproject.toml file

Quoted 58 lines · Stephen Smalley
Quoted 47 lines · Cathy Hu
Quoted 45 lines · Stephen Smalley

Add a pyproject.toml file for the sepolicy python module. This required also updating setup.py to avoid defining author outside of pyproject.toml, and I further updated the authors to refer to the list like libselinux since Dan is enjoying retirement.

---
  python/sepolicy/pyproject.toml | 19 +++++++++++++++++++
  python/sepolicy/setup.py       |  2 --
  2 files changed, 19 insertions(+), 2 deletions(-)

create mode 100644 python/sepolicy/pyproject.toml

python/sepolicy/pyproject.toml new file +19 -0
new file mode 100644
index 00000000..472faf7a
@@ -0,0 +1,19 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sepolicy"
+version = "3.11"
+description = "Python tools for SELinux policy analysis (sepolicy, sepolgen)"
+license = "GPL-2.0-or-later"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+dependencies = [
+    "libselinux-python",
+    "libsemanage-python",
+]
+
+[project.scripts]
+sepolicy = "sepolicy.__main__:main"
python/sepolicy/setup.py +0 -0
index ca0396b5..5c4f2e5d 100644
@@ -8,8 +8,6 @@ setup(
      name="sepolicy",
      version="3.11",
Quoted 8 lines

python/sepolicy/setup.py setup( · line 13

Quoted 6 lines
python/sepolicy/setup.py +0 -2
      description="Python SELinux Policy Analyses bindings",
-    author="Daniel Walsh",
-    author_email="[email protected]",
      packages=[
          "sepolicy",
          "sepolicy.templates",

lgtm, or at least i don't see the warning anymore in the build system

Quoted 1 line

Thanks, both merged.

And both reverted since they broke the testfarm build. Will defer to someone better versed in this area to fix this.

#5 lore raw

Re: [PATCH 2/2] python/sepolicy: add a pyproject.toml file

Quoted 60 lines · Stephen Smalley
Quoted 58 lines · Stephen Smalley
Quoted 55 lines · Cathy Hu
Quoted 43 lines · Stephen Smalley

Add a pyproject.toml file for the sepolicy python module. This required also updating setup.py to avoid defining author outside of pyproject.toml, and I further updated the authors to refer to the list like libselinux since Dan is enjoying retirement.

---
   python/sepolicy/pyproject.toml | 19 +++++++++++++++++++
   python/sepolicy/setup.py       |  2 --
   2 files changed, 19 insertions(+), 2 deletions(-)

create mode 100644 python/sepolicy/pyproject.toml

python/sepolicy/pyproject.toml new file +19 -0
new file mode 100644
index 00000000..472faf7a
@@ -0,0 +1,19 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sepolicy"
+version = "3.11"
+description = "Python tools for SELinux policy analysis (sepolicy, sepolgen)"
+license = "GPL-2.0-or-later"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+dependencies = [
+    "libselinux-python",
+    "libsemanage-python",
+]
+
+[project.scripts]
+sepolicy = "sepolicy.__main__:main"
python/sepolicy/setup.py +0 -0
index ca0396b5..5c4f2e5d 100644

python/sepolicy/setup.py setup( · line 13

Quoted 8 lines
python/sepolicy/setup.py +0 -2
@@ -8,8 +8,6 @@ setup(
       name="sepolicy",
       version="3.11",
       description="Python SELinux Policy Analyses bindings",
-    author="Daniel Walsh",
-    author_email="[email protected]",
       packages=[
           "sepolicy",
           "sepolicy.templates",

lgtm, or at least i don't see the warning anymore in the build system

Quoted 4 lines
Quoted 1 line

Thanks, both merged.

And both reverted since they broke the testfarm build. Will defer to someone better versed in this area to fix this.

that's odd, not sure why the patch successfully built in our system, i can have a look next week

author maintainer
#6 lore raw
In reply to Stephen Smalley
Quoted 9 lines · Stephen Smalley

Add a pyproject.toml file for the libselinux python bindings.

---

NB I don't understand this sufficiently to fully migrate setup.py but hopefully this addresses the issue?

Evidently I didn't test sufficiently. Reverted since it broke the testfarm build,
https://github.com/SELinuxProject/selinux/actions/runs/30099962012/job/89503238013

Quoted 38 lines
 libselinux/src/pyproject.toml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 libselinux/src/pyproject.toml
libselinux/src/pyproject.toml new file +24 -1
new file mode 100644
index 00000000..dfc44e81
@@ -0,0 +1,24 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "selinux"
+version = "3.11"
+description = "Python bindings for libselinux (SELinux userspace library)"
+readme = "../README.md"
+license = "libselinux-1.0"
+authors = [
+    { name = "SELinux Project", email = "[email protected]" }
+]
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "Operating System :: POSIX :: Linux",
+    "Topic :: Security",
+]
+
+[project.urls]
+Homepage = "https://github.com/SELinuxProject/selinux"
+
+# The actual .so is produced by a custom build_ext (SWIG + libselinux.so),
+# driven from setup.py.
--

2.55.0