Skip to content

Commit

Permalink
Drop setup.{cfg,py} support
Browse files Browse the repository at this point in the history
Only support pyproject.toml and PEP-517 build tools (PyPA build).

Move spec to PyPA build.
  • Loading branch information
martinpitt committed Oct 3, 2024
1 parent 10a5405 commit 4fdf897
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 52 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-setuptools python3-setuptools-scm python3-dbus
dpkg -l
sudo apt-get install -y python3-build python3-setuptools python3-setuptools-scm python3-venv
- name: Build release tarball
run: ./setup.py sdist
run: python3 -m build --sdist

- name: Sanity check
run: |
Expand Down
11 changes: 8 additions & 3 deletions packaging/python-dbusmock.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ BuildArch: noarch
BuildRequires: git
BuildRequires: python3-dbus
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools-scm)
BuildRequires: python3dist(wheel)
BuildRequires: python3-setuptools
BuildRequires: python3-gobject
BuildRequires: python3-pytest
Expand All @@ -37,18 +39,21 @@ Requires: python3-dbus, python3-gobject, dbus-x11
%autosetup -n %{name}-%{version}
rm -rf python-%{modname}.egg-info

%generate_buildrequires
%pyproject_buildrequires

%build
%py3_build
%pyproject_wheel

%install
%py3_install
%pyproject_install

%check
%{__python3} -m unittest -v

%files -n python3-dbusmock
/usr/lib/python*

%doc README.md COPYING
%{python3_sitelib}/*%{modname}*

%changelog
3 changes: 2 additions & 1 deletion packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ downstream_package_name: python-dbusmock

actions:
create-archive:
- ./setup.py sdist
- python3 -m build --sdist
# spec and tarball need to be in the same directory
- sh -c 'mv dist/*.tar.* packaging; ls packaging/python[-_]dbusmock-*.tar.*'

srpm_build_deps:
- python3-setuptools
- python3-setuptools_scm
- python3-build

jobs:
- job: copr_build
Expand Down
31 changes: 0 additions & 31 deletions setup.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

7 changes: 0 additions & 7 deletions tests/run-debian
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ wait
my_version=\$(git describe --abbrev=0)
# test sdist with direct setuptools
./setup.py sdist
tar --wildcards --strip-components=1 -xvf dist/python[_-]dbusmock-\${my_version}*.tar.gz '*/PKG-INFO'
grep "^Version: \${my_version}" PKG-INFO
grep "^## Purpose" PKG-INFO
git clean -ffdx
# test sdist with PyPA build
python3 -m build --sdist
tar --wildcards --strip-components=1 -xvf dist/python_dbusmock-\${my_version}*.tar.gz '*/PKG-INFO'
Expand Down

0 comments on commit 4fdf897

Please sign in to comment.