Skip to content

Commit 39c56d9

Browse files
committed
port building to Hatchling system
1 parent 61dd7ed commit 39c56d9

File tree

11 files changed

+67
-109
lines changed

11 files changed

+67
-109
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
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="Razvan Crainea <razvan@opensips.org>"
33

44
USER root
@@ -13,7 +13,7 @@ RUN apt-get -y update -qq && \
1313
#add keyserver, repository
1414
RUN git clone https://github.com/OpenSIPS/opensips-cli.git /usr/src/opensips-cli && \
1515
cd /usr/src/opensips-cli && \
16-
python3 setup.py install clean --all && \
16+
python3 -m pip install . && \
1717
cd / && rm -rf /usr/src/opensips-cli
1818

1919
RUN apt-get purge -y git gcc && \

docs/INSTALLATION.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,18 @@ git clone https://github.com/opensips/opensips-cli ~/src/opensips-cli
8989
cd ~/src/opensips-cli
9090
9191
# local install (only visible to your user)
92-
python3 setup.py install --user clean
92+
python3 -m pip install --user .
9393
9494
# system-wide install
95-
sudo python3 setup.py install clean
95+
sudo python3 -m pip install .
9696
```
9797

9898
### Cleaning up the install
9999

100-
To clean up the manually built and installed `opensips-cli` binary and package
101-
files, run a command similar to:
100+
To clean up the manually built and installed `opensips-cli` package, run:
102101

103102
```
104-
sudo rm -fr /usr/local/bin/opensips-cli /usr/local/lib/python3.6/dist-packages/opensipscli*
103+
python3 -m pip uninstall opensipscli
105104
```
106105

107106
## Database Installation

opensipscli/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
## along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
##
1919

20-
__version__ = '0.3.3'
20+
__version__ = '0.3.4'
2121

2222
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

packaging/debian/changelog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
opensips-cli (0.3.4-1) stable; urgency=low
2+
3+
* Migrate packaging to pyproject.toml and hatchling.
4+
* Drop legacy setup.py/distutils build flow.
5+
6+
-- Razvan Crainea <razvan@opensips.org> Wed, 18 Feb 2026 12:40:00 +0000
7+
18
opensips-cli (0.3.1-1) stable; urgency=low
29

310
* Minor Public Release.
411

512
-- Razvan Crainea <razvan@opensips.org> Fri, 24 Feb 2023 11:15:04 +0300
6-

packaging/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Source: opensips-cli
22
Section: python
33
Priority: optional
44
Maintainer: Razvan Crainea <razvan@opensips.org>
5-
Build-Depends: debhelper (>= 9), dh-python, python3-dev, default-libmysqlclient-dev | libmysqlclient-dev, python3-sqlalchemy, python3-opensips
5+
Build-Depends: debhelper (>= 9), dh-python, pybuild-plugin-pyproject, python3-hatchling, python3-dev, default-libmysqlclient-dev | libmysqlclient-dev, python3-sqlalchemy, python3-opensips
66
Standards-Version: 3.9.8
77
Homepage: https://github.com/OpenSIPS/opensips-cli
88

packaging/debian/rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
VERSION=$(shell python -Bc 'import sys; sys.path.append("."); from opensipscli.version import __version__; print(__version__)')
44
NAME=opensips-cli
5+
export PYBUILD_SYSTEM=pyproject
56

67
%:
78
dh $@ --with python3 --buildsystem=pybuild

packaging/redhat_fedora/opensips-cli.spec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Summary: Interactive command-line tool for OpenSIPS 3.0+
22
Name: opensips-cli
3-
Version: 0.3.1
3+
Version: 0.3.4
44
Release: 0%{?dist}
55
License: GPL-3+
66
Group: System Environment/Daemons
@@ -10,7 +10,8 @@ URL: http://opensips.org
1010
BuildArch: noarch
1111

1212
BuildRequires: python3-devel
13-
BuildRequires: python3-setuptools
13+
BuildRequires: pyproject-rpm-macros
14+
BuildRequires: python3-hatchling
1415
BuildRequires: python3-rpm-macros
1516
BuildRequires: mysql-devel
1617
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -51,18 +52,17 @@ XMLRPC Interface.
5152
%autosetup -n %{name}-%{version}
5253

5354
%build
54-
%py3_build
55+
%pyproject_wheel
5556

5657
%install
57-
%py3_install
58+
%pyproject_install
59+
%pyproject_save_files opensipscli
5860

5961
%clean
6062
rm -rf $RPM_BUILD_ROOT
6163

62-
%files
64+
%files -f %{pyproject_files}
6365
%{_bindir}/opensips-cli
64-
%{python3_sitelib}/opensipscli/*
65-
%{python3_sitelib}/opensipscli-*.egg-info
6666
%doc README.md
6767
%doc docs/*
6868
%doc etc/default.cfg

pyproject.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[build-system]
2+
requires = ["hatchling>=1.26"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "opensipscli"
7+
dynamic = ["version"]
8+
description = "OpenSIPS Command Line Interface"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
license = { text = "GNU General Public License v3 (GPLv3)" }
12+
authors = [
13+
{ name = "OpenSIPS Project", email = "project@opensips.org" },
14+
]
15+
maintainers = [
16+
{ name = "Razvan Crainea", email = "razvan@opensips.org" },
17+
]
18+
dependencies = [
19+
"opensips",
20+
"mysqlclient<1.4.0rc1",
21+
"sqlalchemy>=1.3.3,<2",
22+
"sqlalchemy-utils",
23+
]
24+
classifiers = [
25+
"Programming Language :: Python :: 3",
26+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
27+
"Operating System :: OS Independent",
28+
]
29+
30+
[project.urls]
31+
Homepage = "https://github.com/OpenSIPS/opensips-cli"
32+
Source = "https://github.com/OpenSIPS/opensips-cli"
33+
Issues = "https://github.com/OpenSIPS/opensips-cli/issues"
34+
Download = "https://github.com/OpenSIPS/opensips-cli/archive/master.zip"
35+
36+
[project.scripts]
37+
opensips-cli = "opensipscli.main:main"
38+
39+
[tool.hatch.version]
40+
path = "opensipscli/version.py"
41+
42+
[tool.hatch.build.targets.wheel]
43+
packages = ["opensipscli"]

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[easy_install]

0 commit comments

Comments
 (0)