Use distro module to detect the distribution name.

`platform.linux_distribution` is deprecated.

Fix #415
This commit is contained in:
Matthieu Gautier 2020-05-04 15:48:14 +02:00
parent 46bcb17761
commit 0fe69e3991
9 changed files with 15 additions and 12 deletions

View file

@ -24,7 +24,7 @@ RUN apt update -q \
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
&& pip3 install meson==0.52.1 pytest gcovr distro
# Create user
RUN useradd --create-home runner

View file

@ -7,6 +7,7 @@ RUN dnf install -y --nodocs \
# Base build tools
make automake libtool cmake git-core subversion pkg-config gcc-c++ \
wget unzip ninja-build ccache which patch gcovr xz openssh-clients \
python3-pip \
# Cross win32 compiler
mingw32-gcc-c++ mingw32-bzip2-static mingw32-win-iconv-static \
mingw32-winpthreads-static mingw32-zlib-static mingw32-xz-libs-static \
@ -18,7 +19,7 @@ RUN dnf install -y --nodocs \
&& dnf remove -y "*-doc" \
&& dnf autoremove -y \
&& dnf clean all \
&& pip3 install meson==0.52.1 pytest
&& pip3 install meson==0.52.1 pytest distro
# Create user
RUN useradd --create-home runner

View file

@ -2,6 +2,7 @@ FROM ubuntu:focal
ENV LANG C.UTF-8
ENV OS_NAME focal
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -q \
&& apt install -q -y --no-install-recommends \
@ -24,7 +25,7 @@ RUN apt update -q \
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
&& pip3 install meson==0.52.1 pytest gcovr distro
# Create user
RUN useradd --create-home runner

View file

@ -21,7 +21,7 @@ RUN apt update -q \
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson==0.52.1 pytest gcovr
&& pip3 install meson==0.52.1 pytest gcovr distro
# Create user
RUN useradd --create-home runner

View file

@ -6,7 +6,7 @@ on:
- cron: '0 1 * * *'
env:
DOCKER_VERSION: 26
DOCKER_VERSION: 27
jobs:
Docker:
@ -97,7 +97,7 @@ jobs:
runs-on: ubuntu-latest
needs: Docker
container:
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26"
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-27"
steps:
- name: Checkout code
shell: bash
@ -158,7 +158,7 @@ jobs:
brew: pkg-config ninja
- name: Install python modules
run: |
pip3 install meson==0.52.1 pytest
pip3 install meson==0.52.1 pytest distro
pip3 install --no-deps $GITHUB_WORKSPACE
- name: secret
shell: bash

View file

@ -112,7 +112,7 @@ env:
global:
- NIGHTLY_DATE=$(date +%Y-%m-%d)
- SSH_KEY=/tmp/private/travisci_builder_id_key
- DOCKER_VERSION=4
- DOCKER_VERSION=5
matrix:
- PLATFORM="flatpak" DESKTOP_ONLY=1
- PLATFORM="native_dyn"

View file

@ -2,6 +2,7 @@
import os, sys, shutil
import subprocess
import platform
import distro
from .utils import pj, download_remote, Defaultdict
from ._global import neutralEnv, option
@ -38,8 +39,7 @@ class PlatformNeutralEnv:
if cont.lower() != 'y':
sys.exit(0)
if _platform == 'Linux':
self.distname, _, _ = platform.linux_distribution()
self.distname = self.distname.lower()
self.distname = distro.id()
if self.distname == 'ubuntu':
self.distname = 'debian'

View file

@ -35,7 +35,8 @@ setup(
packages=find_packages(),
include_package_data=True,
install_requires=[
'meson==0.52.1'
'meson==0.52.1',
'distro'
],
entry_points={
'console_scripts': [

View file

@ -22,7 +22,7 @@ RUN apt update -q && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* && \
pip3 install --upgrade pip && \
pip3 install meson==0.52.1 pytest gcovr
pip3 install meson==0.52.1 pytest gcovr distro
# Create user
RUN useradd --create-home ci_builder