Drop Python2 support

QubesOS/qubes-issues#5297
This commit is contained in:
Marek Marczykowski-Górecki 2020-01-15 21:41:17 +01:00
parent 1b53de8365
commit d302aeab8f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
6 changed files with 5 additions and 44 deletions

View File

@ -2,7 +2,6 @@ sudo: required
dist: bionic dist: bionic
language: python language: python
python: python:
- '2.7'
- '3.5' - '3.5'
- '3.6' - '3.6'
- '3.7' - '3.7'

View File

@ -1,7 +1,7 @@
.PHONY: all .PHONY: all
all: build all: build
PYTHON ?= python PYTHON ?= python3
.PHONY: build .PHONY: build
build: build:

View File

@ -6,9 +6,4 @@ https://www.qubes-os.org/doc/admin-api/ for protocol specification.
Compatibility Compatibility
============= =============
Most of the API modules are compatible with Python >= 2.7. This package requires Python >= 3.5
Very few parts require Python >= 3.5:
- tools (`qvm-*`)
- qubesadmin.events module (for asyncio module)
Parts not compatible with Python < 3.5, are not installed in such environment.

14
debian/control vendored
View File

@ -5,8 +5,7 @@ Maintainer: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Build-Depends: Build-Depends:
debhelper (>= 9), debhelper (>= 9),
dh-python, dh-python,
python-all, python3-all,
python-setuptools,
python3-all, python3-all,
python3-setuptools, python3-setuptools,
python3-sphinx, python3-sphinx,
@ -30,17 +29,6 @@ Depends:
Description: Qubes administrative tools Description: Qubes administrative tools
Tools to manage Qubes system using Admin API Tools to manage Qubes system using Admin API
Package: python-qubesadmin
Architecture: any
Depends:
python-docutils,
python-lxml,
${python:Depends},
Provides:
${python:Provides},
Description: Python 2 bindings for Qubes Admin API
Python 2 client side module for Qubes Admin API
Package: python3-qubesadmin Package: python3-qubesadmin
Architecture: any Architecture: any
Depends: Depends:

View File

@ -7,8 +7,6 @@ Group: Qubes
License: LGPLv2.1+ License: LGPLv2.1+
URL: https://www.qubes-os.org URL: https://www.qubes-os.org
BuildRequires: python2-setuptools
BuildRequires: python2-devel
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx
@ -21,22 +19,9 @@ Source0: %{name}-%{version}.tar.gz
%description %description
This package include managemt tools, like qvm-*. This package include managemt tools, like qvm-*.
%package -n python2-qubesadmin
Summary: Python2 module qubesadmin
Requires: python-daemon
Requires: python-docutils
Requires: python2-lxml
%description -n python2-qubesadmin
Python2 module qubesadmin.
%package -n python%{python3_pkgversion}-qubesadmin %package -n python%{python3_pkgversion}-qubesadmin
Summary: Python%{python3_pkgversion} module qubesadmin Summary: Python%{python3_pkgversion} module qubesadmin
%if 0%{?rhel} >= 7 Requires: python%{python3_pkgversion}-daemon
Requires: python-daemon
%else
Requires: python3-daemon
%endif
Requires: python%{python3_pkgversion}-docutils Requires: python%{python3_pkgversion}-docutils
Requires: python%{python3_pkgversion}-lxml Requires: python%{python3_pkgversion}-lxml
Requires: python%{python3_pkgversion}-xcffib Requires: python%{python3_pkgversion}-xcffib
@ -55,8 +40,6 @@ make -C doc PYTHON=%{__python3} SPHINXBUILD=sphinx-build-%{python3_version} man
%install %install
rm -rf build rm -rf build
%make_install PYTHON=%{__python2}
rm -rf build
%make_install PYTHON=%{__python3} %make_install PYTHON=%{__python3}
make -C doc DESTDIR=$RPM_BUILD_ROOT \ make -C doc DESTDIR=$RPM_BUILD_ROOT \
@ -73,10 +56,6 @@ make -C doc DESTDIR=$RPM_BUILD_ROOT \
%{_mandir}/man1/qvm-*.1* %{_mandir}/man1/qvm-*.1*
%{_mandir}/man1/qubes*.1* %{_mandir}/man1/qubes*.1*
%files -n python2-qubesadmin
%{python2_sitelib}/qubesadmin-*egg-info
%{python2_sitelib}/qubesadmin
%files -n python%{python3_pkgversion}-qubesadmin %files -n python%{python3_pkgversion}-qubesadmin
%{python3_sitelib}/qubesadmin-*egg-info %{python3_sitelib}/qubesadmin-*egg-info
%{python3_sitelib}/qubesadmin %{python3_sitelib}/qubesadmin

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
: "${PYTHON:=python}" : "${PYTHON:=python3}"
: "${ROOTDIR:=.}" : "${ROOTDIR:=.}"
: "${TESTPYTHONPATH:=$ROOTDIR/test-packages}" : "${TESTPYTHONPATH:=$ROOTDIR/test-packages}"