Skip to content

Commit

Permalink
Merge pull request #54 from SUSE-Enceladus/311-spec
Browse files Browse the repository at this point in the history
Update spec for python 3.11 build
  • Loading branch information
smarlowucf committed May 28, 2024
2 parents 2484fec + 88ad430 commit fa34a4d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 56 deletions.
28 changes: 1 addition & 27 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,12 @@ name: Continuous testing & Linting
on: [push]

jobs:
test36:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade pytest
pip install -e .[dev]
- name: Lint with flake8
run: |
flake8 obs_img_utils
flake8 tests --exclude=data
- name: Test with pytest
run: |
pytest --no-cov-on-fail --cov=obs_img_utils
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9, "3.10", 3.11]

steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# spec file for package python3-obs-img-utils
# spec file for package python-obs-img-utils
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
Expand All @@ -15,9 +15,18 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define upstream_name obs-img-utils
%define python python
%{?sle15_python_module_pythons}
%bcond_without test
Name: python3-obs-img-utils

%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif

Name: python-obs-img-utils
Version: 1.3.0
Release: 0
Summary: API and CLI utilities for images in OBS
Expand All @@ -26,23 +35,36 @@ Group: Development/Languages/Python
Url: https://github.com/SUSE-Enceladus/obs-img-utils
Source: https://files.pythonhosted.org/packages/source/o/obs-img-utils/obs-img-utils-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-click-man
BuildRequires: python3-click
BuildRequires: python3-PyYAML
BuildRequires: python3-lxml
BuildRequires: python3-xmltodict
BuildRequires: fdupes
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module click-man}
BuildRequires: %{python_module click}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module xmltodict}
%if %{with test}
BuildRequires: python3-coverage
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
BuildRequires: %{python_module pytest}
%endif
Requires: python-PyYAML
Requires: python-click
Requires: python-lxml
Requires: python-xmltodict

%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
Requires: python3-PyYAML
Requires: python3-click
Requires: python3-lxml
Requires: python3-xmltodict

BuildArch: noarch
Provides: python3-obs-img-utils = %{version}
Obsoletes: python3-obs-img-utils < %{version}
%python_subpackages

%description
API and CLI utilities for images in OBS.
Expand All @@ -54,31 +76,42 @@ Provides the following commands:
- Get version info for a specific package

%prep
%setup -q -n obs-img-utils-%{version}
%autosetup -n obs-img-utils-%{version}

%build
python3 setup.py build
%pyproject_wheel
mkdir -p man/man1
python3 setup.py --command-packages=click_man.commands man_pages --target man/man1
%python_exec setup.py --command-packages=click_man.commands man_pages --target man/man1

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%pyproject_install
install -d -m 755 %{buildroot}/%{_mandir}/man1
install -m 644 man/man1/*.1 %{buildroot}/%{_mandir}/man1
%python_clone -a %{buildroot}%{_bindir}/obs-img-utils
%{python_expand %fdupes %{buildroot}%{$python_sitelib}}

%pre
%python_libalternatives_reset_alternative obs-img-utils

%post
%{python_install_alternative obs-img-utils}

%postun
%{python_uninstall_alternative obs-img-utils}

%check
%if %{with test}
export LC_ALL=en_US.utf-8
export LANG=en_US.utf-8
python3 -m pytest --cov=obs_img_utils
%pytest
%endif

%files
%defattr(-,root,root)
%license LICENSE
%doc CHANGES.md CONTRIBUTING.md README.md
%{_mandir}/man1/*
%{_bindir}/obs-img-utils
%{python3_sitelib}/*
%python_alternative %{_bindir}/obs-img-utils
%{python_sitelib}/*

%changelog
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tag = True

[bumpversion:file:docs/source/conf.py]

[bumpversion:file:package/python3-obs-img-utils.spec]
[bumpversion:file:package/python-obs-img-utils.spec]

[coverage:report]
fail_under = 90
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
]
},
include_package_data=True,
python_requires='>=3.5',
python_requires='>=3.8',
install_requires=requirements,
extras_require={
'dev': dev_requirements,
Expand All @@ -73,8 +73,9 @@
'GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)

0 comments on commit fa34a4d

Please sign in to comment.