Commit d3da9a4d authored by Kevin Daudt's avatar Kevin Daudt 💻
Browse files

community/docker-compose: fix mising linux_distribution

platform.linux_distribution has been removed in python 3.8, but this
version of docker-compose still uses it. Backport the upstream commit
that switches it to using the distro module for that instead.
parent e9195171
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=docker-compose
pkgver=1.25.4
pkgrel=2
pkgrel=3
pkgdesc="Define and run multi-container applications with Docker"
url="https://docs.docker.com/compose/"
arch="noarch"
......@@ -14,6 +14,7 @@ depends="python3
py3-cached-property>=1.3.0
py3-certifi>=2017.4.17
py3-chardet>=3.0.4
py3-distro>=1.5.0
py3-dockerpty>=0.4.1
py3-docopt>=0.6.2
py3-idna>=2.5
......@@ -35,7 +36,9 @@ subpackages="
$pkgname-zsh-completion:zshcomp:noarch
$pkgname-fish-completion:fishcomp:noarch
"
source="docker-compose-$pkgver.tar.gz::https://github.com/docker/compose/archive/$pkgver.tar.gz"
source="docker-compose-$pkgver.tar.gz::https://github.com/docker/compose/archive/$pkgver.tar.gz
use-distro-package.patch
"
builddir="$srcdir/compose-$pkgver"
build() {
......@@ -84,4 +87,5 @@ fishcomp() {
amove usr/share/fish/completions
}
sha512sums="860153fb603d7efcc76535c9997446a2e6fe18f61769d4f05f51b531902a66072be11e3cff012ba80240b0a7802a032495a2a55e053a9784df92b82e5351b72e docker-compose-1.25.4.tar.gz"
sha512sums="860153fb603d7efcc76535c9997446a2e6fe18f61769d4f05f51b531902a66072be11e3cff012ba80240b0a7802a032495a2a55e053a9784df92b82e5351b72e docker-compose-1.25.4.tar.gz
ea180988922268e7f7b82d206d969399312d4759f3e9360d71e4f71e4ffba8167e1460fcaa47a2228054bdcb91a6904baf2b16d1292e20db6cfdf961180f1130 use-distro-package.patch"
From a62a1e1d6273d1b2021b072603ee9ffc86afc5c5 Mon Sep 17 00:00:00 2001
From: Ulysses Souza <ulyssessouza@gmail.com>
Date: Thu, 16 Apr 2020 17:04:40 +0200
Subject: [PATCH] Add "distro" package
This package implements the method 'platform.linux_distribution' removed in
Python 3.8
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
---
compose/cli/utils.py | 3 ++-
requirements.txt | 1 +
setup.py | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/compose/cli/utils.py b/compose/cli/utils.py
index 931487a6cd..40bef16520 100644
--- a/compose/cli/utils.py
+++ b/compose/cli/utils.py
@@ -9,6 +9,7 @@
import subprocess
import sys
+import distro
import docker
import six
@@ -73,7 +74,7 @@ def is_mac():
def is_ubuntu():
- return platform.system() == 'Linux' and platform.linux_distribution()[0] == 'Ubuntu'
+ return platform.system() == 'Linux' and distro.linux_distribution()[0] == 'Ubuntu'
def is_windows():
diff --git a/requirements.txt b/requirements.txt
index 76556d6..edc30a7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,6 +4,7 @@ cached-property==1.5.1
certifi==2019.11.28
chardet==3.0.4
colorama==0.4.3; sys_platform == 'win32'
++distro==1.5.0
docker==4.1.0
docker-pycreds==0.4.0
dockerpty==0.4.1
diff --git a/setup.py b/setup.py
index bca578e110..cf273ed548 100644
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,7 @@ def find_version(*file_paths):
'requests >= 2.20.0, < 3',
'texttable >= 0.9.0, < 2',
'websocket-client >= 0.32.0, < 1',
+ 'distro >= 1.5.0, < 2',
'docker[ssh] >= 3.7.0, < 5',
'dockerpty >= 0.4.1, < 1',
'six >= 1.3.0, < 2',
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment