Skip to content

Commit 7953dd3

Browse files
committed
port building to Hatchling system
1 parent 5a34cda commit 7953dd3

File tree

7 files changed

+45
-70
lines changed

7 files changed

+45
-70
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim-buster
1+
FROM python:slim-trixie
22
LABEL maintainer="Darius Stefan <darius.stefan@opensips.org>"
33

44
RUN pip install opensips

docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NAME ?= pyhton-opensips
1+
NAME ?= python-opensips
22
OPENSIPS_DOCKER_TAG ?= latest
33

44
all: build

opensips/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
""" OpenSIPS Package version """
2121

22-
__version__ = '0.1.7'
22+
__version__ = '0.1.8'

packaging/debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ Source: python3-opensips
22
Section: python
33
Priority: optional
44
Maintainer: Razvan Crainea <razvan@opensips.org>
5-
Build-Depends: debhelper (>= 9), dh-python, python3 (>= 3.6), python3-setuptools, bash-completion
5+
Build-Depends: debhelper (>= 9), dh-python, python3 (>= 3.6), pybuild-plugin-pyproject, python3-hatchling, bash-completion
66
Standards-Version: 3.9.8
77
Homepage: https://github.com/OpenSIPS/python-opensips
88

99
Package: python3-opensips
1010
Architecture: all
1111
Multi-Arch: foreign
12-
Depends: python3 (>= 3.6), ${misc:Depends}, ${python3:Depends}, python3-setuptools
12+
Depends: python3 (>= 3.6), ${misc:Depends}, ${python3:Depends}
1313
Description: A collection of Python packages for OpenSIPS.
1414
These modules are designed to be as lightweight as possible and provide a
1515
simple interface for interacting with OpenSIPS.

packaging/redhat_fedora/python3-opensips.spec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Summary: A collection of Python packages for OpenSIPS.
22
Name: python3-opensips
3-
Version: 0.1.5
3+
Version: 0.1.8
44
Release: 1%{?dist}
55
License: GPL-3+
66
Group: System Environment/Daemons
@@ -9,7 +9,9 @@ URL: https://github.com/OpenSIPS/python-opensips
99

1010
BuildArch: noarch
1111

12-
BuildRequires: python%{python3_pkgversion}-setuptools, python%{python3_pkgversion}-devel
12+
BuildRequires: pyproject-rpm-macros
13+
BuildRequires: python%{python3_pkgversion}-devel
14+
BuildRequires: python%{python3_pkgversion}dist(hatchling)
1315
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1416

1517
AutoReqProv: no
@@ -39,10 +41,10 @@ XMLRPC Interface.
3941
%autosetup -n %{name}-%{version}
4042

4143
%build
42-
%py3_build
44+
%pyproject_wheel
4345

4446
%install
45-
%py3_install
47+
%pyproject_install
4648
install -d %{buildroot}%{bash_completions_dir}/
4749
install -Dpm 0644 utils/completion/python-opensips -t %{buildroot}%{bash_completions_dir}/
4850

@@ -53,7 +55,7 @@ rm -rf $RPM_BUILD_ROOT
5355
%{_bindir}/opensips-event
5456
%{_bindir}/opensips-mi
5557
%{python3_sitelib}/opensips/*
56-
%{python3_sitelib}/opensips-*.egg-info
58+
%{python3_sitelib}/opensips-*.dist-info
5759
%{bash_completions_dir}/python-opensips
5860
%doc README.md
5961
%doc docs/*

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[build-system]
2+
requires = ["hatchling>=1.4"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "opensips"
7+
dynamic = ["version"]
8+
authors = [
9+
{ name = "Darius Stefan", email = "darius.stefan@opensips.org" },
10+
]
11+
description = "OpenSIPS Python Packages"
12+
readme = "README.md"
13+
requires-python = ">=3.6"
14+
license = "GPL-3.0-or-later"
15+
classifiers = [
16+
"Programming Language :: Python :: 3",
17+
"Operating System :: OS Independent",
18+
]
19+
dependencies = []
20+
21+
[project.urls]
22+
Homepage = "https://github.com/OpenSIPS/python-opensips"
23+
Repository = "https://github.com/OpenSIPS/python-opensips"
24+
25+
[project.scripts]
26+
opensips-mi = "opensips.mi.__main__:main"
27+
opensips-event = "opensips.event.__main__:main"
28+
29+
[tool.hatch.version]
30+
path = "opensips/version.py"
31+
32+
[tool.hatch.build.targets.wheel]
33+
packages = ["opensips"]

setup.py

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

0 commit comments

Comments
 (0)