Skip to content

Commit 3ef188e

Browse files
committed
Merge branch 'setup' into develop
2 parents 8fab00a + 03c0509 commit 3ef188e

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

.github/workflows/publish-to-pypi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
id-token: write
1313
env:
1414
SDIST: python-icat-${{ github.event.release.tag_name }}.tar.gz
15+
PYPI_SDIST: python_icat-${{ github.event.release.tag_name }}.tar.gz
1516
steps:
1617
- name: Fetch assets
1718
uses: cb80/dlassets@latest
@@ -24,9 +25,8 @@ jobs:
2425
- name: Copy distfile to dist directory
2526
run: |
2627
mkdir -p dist
27-
cp -p assets/$SDIST dist
28+
cp -p assets/$SDIST dist/$PYPI_SDIST
2829
- name: Publish package to PyPI
2930
uses: pypa/gh-action-pypi-publish@release/v1
3031
with:
3132
verbose: true
32-
verify-metadata: false

python-icat.spec

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
%if 0%{?sle_version} >= 150500
1+
%if 0%{?suse_version} >= 1600
2+
%global pyversfx 313
3+
%global pythons python313
4+
%else
5+
%if 0%{?sle_version} >= 150500 && 0%{?is_opensuse}
26
%global pyversfx 311
3-
%global python %__python311
4-
%global python_sitelib %python311_sitelib
7+
%global __python3 %__python311
58
%else
69
%global pyversfx 3
7-
%global python %__python3
8-
%global python_sitelib %python3_sitelib
10+
%endif
911
%endif
1012

1113
Name: python-icat
@@ -17,7 +19,9 @@ License: Apache-2.0
1719
Group: Development/Libraries/Python
1820
Source: https://github.com/icatproject/python-icat/releases/download/%{version}/python-icat-%{version}.tar.gz
1921
BuildRequires: python%{pyversfx}-base >= 3.4
22+
BuildRequires: python%{pyversfx}-pip
2023
BuildRequires: python%{pyversfx}-setuptools
24+
BuildRequires: python%{pyversfx}-wheel
2125
BuildRequires: fdupes
2226
BuildRequires: python-rpm-macros
2327
BuildArch: noarch
@@ -63,15 +67,15 @@ $long_description
6367

6468

6569
%prep
66-
%setup -q -n %{name}-%{version}
70+
%setup -q
6771

6872

6973
%build
70-
%{python} setup.py build
74+
%pyproject_wheel
7175

7276

7377
%install
74-
%{python} setup.py install --optimize=1 --prefix=%{_prefix} --root=%{buildroot}
78+
%pyproject_install
7579
for f in `ls %{buildroot}%{_bindir}`
7680
do
7781
mv %{buildroot}%{_bindir}/$$f %{buildroot}%{_bindir}/$${f%%.py}
@@ -83,7 +87,7 @@ done
8387
%__install -d -m 755 %{buildroot}%{_docdir}/%{name}
8488
%__cp -pr README.rst CHANGES.rst doc/* %{buildroot}%{_docdir}/%{name}
8589
%__chmod -f a-x %{buildroot}%{_docdir}/%{name}/examples/*.py
86-
%fdupes %{buildroot}%{python_sitelib}
90+
%fdupes %{buildroot}%{python3_sitelib}
8791

8892

8993
%files
@@ -107,7 +111,7 @@ done
107111

108112
%files -n python%{pyversfx}-icat
109113
%defattr(-,root,root)
110-
%{python_sitelib}/*
114+
%{python3_sitelib}/*
111115
%{_bindir}/*
112116

113117

0 commit comments

Comments
 (0)