Skip to content

Commit ea8720a

Browse files
update python and rpm packaging
1 parent 4d78638 commit ea8720a

File tree

5 files changed

+81
-68
lines changed

5 files changed

+81
-68
lines changed

libcobblersignatures.spec

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,29 @@
1515
# Please submit bugfixes or comments via https://bugs.opensuse.org/
1616
#
1717

18-
18+
%{?sle15_python_module_pythons}
19+
%define pythons python3
20+
%define parent_tag 0.1.0
1921
Name: libcobblersignatures
20-
Version: 0.1.0
22+
Version: 0.1.0+git40
2123
Release: 0
2224
Summary: Cobbler Signatures Library
2325
License: GPL-2.0-or-later
2426
URL: https://github.com/cobbler/libcobblersignatures
2527
Source: libcobblersignatures-%{version}.tar.gz
2628
BuildRequires: python-rpm-macros
27-
BuildRequires: python3-setuptools
29+
BuildRequires: %{python_module setuptools}
30+
BuildRequires: %{python_module pip}
31+
BuildRequires: %{python_module wheel}
32+
# SECTION tests
33+
BuildRequires: %{python_module pytest}
34+
BuildRequires: %{python_module coverage}
35+
BuildRequires: %{python_module pytest-cov}
36+
#
2837
BuildRequires: fdupes
29-
Requires: python3-PyInquirer
38+
# TODO: remove dependencies that are not in Factory
39+
# Requires: python-PyInquirer
40+
# Requires: python-questionary
3041
BuildArch: noarch
3142

3243
%description
@@ -38,20 +49,25 @@ Features are:
3849
- Hand over structured data to other applications
3950

4051
%prep
41-
%setup -q
52+
%autosetup -p1
4253

4354
%build
44-
%py3_build
55+
%pyproject_wheel
4556

4657
%install
47-
%py3_install
48-
%python_expand %fdupes %{buildroot}%{$python_sitelib}/%name
58+
%pyproject_install
59+
%python_expand %fdupes %{buildroot}%{python_sitelib}/%{name}
60+
%python_expand rm -rf %{buildroot}%{python_sitelib}/tests
61+
62+
%check
63+
# disable test that requires network for OBS build
64+
%pytest -k "not test_importsignatures_url"
4965

5066
%files
5167
%license LICENSE
5268
%doc README.md
5369
%{_bindir}/cobbler-manage-signatures
54-
%{python3_sitelib}/%{name}/
55-
%{python3_sitelib}/%{name}-*-py*.egg-info
70+
%{python3_sitelib}/%{name}
71+
%{python3_sitelib}/%{name}-%{parent_tag}.dist-info
5672

5773
%changelog

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "libcobblersignatures"
7+
dynamic = ["version"]
8+
requires-python = ">=3"
9+
dependencies = [
10+
"questionary",
11+
"importlib_resources;python_version=='3.6'",
12+
]
13+
license = { file = "LICENSE" }
14+
authors = [
15+
{ name = "Cobbler", email = "cobbler.project@gmail.com" }
16+
]
17+
keywords = ["cobbler"]
18+
classifiers=[
19+
"Development Status :: 3 - Alpha",
20+
"Intended Audience :: Developers",
21+
"Topic :: Software Development :: Libraries",
22+
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.5",
25+
"Programming Language :: Python :: 3.6",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
]
29+
description = "This library manages the operating system distribution signatures to enable cobbler to detect it correctly."
30+
readme = {file = "README.md", content-type = "text/markdown"}
31+
32+
[project.urls]
33+
"Homepage" = "https://cobbler.github.io/"
34+
"Documentation" = "https://libcobblersignatures.readthedocs.io/"
35+
"Source" = "https://github.com/cobbler/libcobblersignatures"
36+
"Bug Tracker" = "https://github.com/cobbler/libcobblersignatures/issues"
37+
38+
[project.optional-dependencies]
39+
lint = ["pylint", "black"]
40+
test = ["coverage", "pytest", "pytest-cov"]
41+
docs = ["sphinx_rtd_theme"]
42+
changelog = ["towncrier>=22.8.0"]
43+
44+
[project.scripts]
45+
cobbler-manage-signatures = "libcobblersignatures.cli:main"
46+
47+
[tool.setuptools]
48+
include-package-data = true
49+
50+
[tool.setuptools.package-data]
51+
libcobblersignatures = ["data/*.json"]
52+
53+
[tool.setuptools.dynamic]
54+
version = {attr = "libcobblersignatures.__version__"}
55+

requirements-tests.txt

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

requirements.txt

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

setup.py

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

0 commit comments

Comments
 (0)