From 5a84c01aa17930191a879a8ce90aeae947b899e4 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 18 May 2020 10:29:23 +0200 Subject: [PATCH] Revert "Use distro module to detect the distribution name." This reverts commit 0fe69e3991cdd2441d1bb05b67d81c26a51bd815. --- .github/ci_images/bionic_builder.dockerfile | 2 +- .github/ci_images/f31_builder.dockerfile | 3 +-- .github/ci_images/focal_builder.dockerfile | 3 +-- .github/ci_images/xenial_builder.dockerfile | 2 +- .github/workflows/ci.yml | 6 +++--- .travis.yml | 2 +- kiwixbuild/buildenv.py | 4 ++-- setup.py | 3 +-- travis/xenial_builder.dockerfile | 2 +- 9 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/ci_images/bionic_builder.dockerfile b/.github/ci_images/bionic_builder.dockerfile index 57f9eb7..c45cb78 100644 --- a/.github/ci_images/bionic_builder.dockerfile +++ b/.github/ci_images/bionic_builder.dockerfile @@ -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 distro + && pip3 install meson==0.52.1 pytest gcovr # Create user RUN useradd --create-home runner diff --git a/.github/ci_images/f31_builder.dockerfile b/.github/ci_images/f31_builder.dockerfile index 022500a..62ed448 100644 --- a/.github/ci_images/f31_builder.dockerfile +++ b/.github/ci_images/f31_builder.dockerfile @@ -7,7 +7,6 @@ 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 \ @@ -19,7 +18,7 @@ RUN dnf install -y --nodocs \ && dnf remove -y "*-doc" \ && dnf autoremove -y \ && dnf clean all \ - && pip3 install meson==0.52.1 pytest distro + && pip3 install meson==0.52.1 pytest # Create user RUN useradd --create-home runner diff --git a/.github/ci_images/focal_builder.dockerfile b/.github/ci_images/focal_builder.dockerfile index 7957fd4..b3b9a00 100644 --- a/.github/ci_images/focal_builder.dockerfile +++ b/.github/ci_images/focal_builder.dockerfile @@ -2,7 +2,6 @@ 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 \ @@ -25,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 distro + && pip3 install meson==0.52.1 pytest gcovr # Create user RUN useradd --create-home runner diff --git a/.github/ci_images/xenial_builder.dockerfile b/.github/ci_images/xenial_builder.dockerfile index 2e0d672..2b634a4 100644 --- a/.github/ci_images/xenial_builder.dockerfile +++ b/.github/ci_images/xenial_builder.dockerfile @@ -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 distro + && pip3 install meson==0.52.1 pytest gcovr # Create user RUN useradd --create-home runner diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29660d6..c8d90b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: - cron: '0 1 * * *' env: - DOCKER_VERSION: 27 + DOCKER_VERSION: 26 jobs: Docker: @@ -97,7 +97,7 @@ jobs: runs-on: ubuntu-latest needs: Docker container: - image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-27" + image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26" 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 distro + pip3 install meson==0.52.1 pytest pip3 install --no-deps $GITHUB_WORKSPACE - name: secret shell: bash diff --git a/.travis.yml b/.travis.yml index 8ec8ad5..ae5522c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,7 +112,7 @@ env: global: - NIGHTLY_DATE=$(date +%Y-%m-%d) - SSH_KEY=/tmp/private/travisci_builder_id_key - - DOCKER_VERSION=5 + - DOCKER_VERSION=4 matrix: - PLATFORM="flatpak" DESKTOP_ONLY=1 - PLATFORM="native_dyn" diff --git a/kiwixbuild/buildenv.py b/kiwixbuild/buildenv.py index 05f1e1e..73207e8 100644 --- a/kiwixbuild/buildenv.py +++ b/kiwixbuild/buildenv.py @@ -2,7 +2,6 @@ import os, sys, shutil import subprocess import platform -import distro from .utils import pj, download_remote, Defaultdict from ._global import neutralEnv, option @@ -39,7 +38,8 @@ class PlatformNeutralEnv: if cont.lower() != 'y': sys.exit(0) if _platform == 'Linux': - self.distname = distro.id() + self.distname, _, _ = platform.linux_distribution() + self.distname = self.distname.lower() if self.distname == 'ubuntu': self.distname = 'debian' diff --git a/setup.py b/setup.py index c53a024..0deb12f 100644 --- a/setup.py +++ b/setup.py @@ -35,8 +35,7 @@ setup( packages=find_packages(), include_package_data=True, install_requires=[ - 'meson==0.52.1', - 'distro' + 'meson==0.52.1' ], entry_points={ 'console_scripts': [ diff --git a/travis/xenial_builder.dockerfile b/travis/xenial_builder.dockerfile index 7a7ddf3..e0b7bcb 100644 --- a/travis/xenial_builder.dockerfile +++ b/travis/xenial_builder.dockerfile @@ -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 distro + pip3 install meson==0.52.1 pytest gcovr # Create user RUN useradd --create-home ci_builder