Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
id-token: write
env:
SDIST: python-icat-${{ github.event.release.tag_name }}.tar.gz
PYPI_SDIST: python_icat-${{ github.event.release.tag_name }}.tar.gz
steps:
- name: Fetch assets
uses: cb80/dlassets@latest
Expand All @@ -24,9 +25,8 @@ jobs:
- name: Copy distfile to dist directory
run: |
mkdir -p dist
cp -p assets/$SDIST dist
cp -p assets/$SDIST dist/$PYPI_SDIST
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
verify-metadata: false
24 changes: 14 additions & 10 deletions python-icat.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
%if 0%{?sle_version} >= 150500
%if 0%{?suse_version} >= 1600
%global pyversfx 313
%global pythons python313
%else
%if 0%{?sle_version} >= 150500 && 0%{?is_opensuse}
%global pyversfx 311
%global python %__python311
%global python_sitelib %python311_sitelib
%global __python3 %__python311
%else
%global pyversfx 3
%global python %__python3
%global python_sitelib %python3_sitelib
%endif
%endif

Name: python-icat
Expand All @@ -17,7 +19,9 @@ License: Apache-2.0
Group: Development/Libraries/Python
Source: https://github.com/icatproject/python-icat/releases/download/%{version}/python-icat-%{version}.tar.gz
BuildRequires: python%{pyversfx}-base >= 3.4
BuildRequires: python%{pyversfx}-pip
BuildRequires: python%{pyversfx}-setuptools
BuildRequires: python%{pyversfx}-wheel
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
Expand Down Expand Up @@ -63,15 +67,15 @@ $long_description


%prep
%setup -q -n %{name}-%{version}
%setup -q


%build
%{python} setup.py build
%pyproject_wheel


%install
%{python} setup.py install --optimize=1 --prefix=%{_prefix} --root=%{buildroot}
%pyproject_install
for f in `ls %{buildroot}%{_bindir}`
do
mv %{buildroot}%{_bindir}/$$f %{buildroot}%{_bindir}/$${f%%.py}
Expand All @@ -83,7 +87,7 @@ done
%__install -d -m 755 %{buildroot}%{_docdir}/%{name}
%__cp -pr README.rst CHANGES.rst doc/* %{buildroot}%{_docdir}/%{name}
%__chmod -f a-x %{buildroot}%{_docdir}/%{name}/examples/*.py
%fdupes %{buildroot}%{python_sitelib}
%fdupes %{buildroot}%{python3_sitelib}


%files
Expand All @@ -107,7 +111,7 @@ done

%files -n python%{pyversfx}-icat
%defattr(-,root,root)
%{python_sitelib}/*
%{python3_sitelib}/*
%{_bindir}/*


Expand Down