Skip to content

Instantly share code, notes, and snippets.

@jsks
Created November 21, 2019 19:05
Show Gist options
  • Save jsks/743865c8e430c8208265b622a9a6ea31 to your computer and use it in GitHub Desktop.
Save jsks/743865c8e430c8208265b622a9a6ea31 to your computer and use it in GitHub Desktop.
azure-cli python3.8 archlinux
From b7b0801c8b9a97a67b1e329d25fe090fe61a818d Mon Sep 17 00:00:00 2001
From: Jamie Magee <JamieMagee@users.noreply.github.com>
Date: Thu, 31 Oct 2019 09:57:34 +0100
Subject: [PATCH] Python 3.8 support (#10777)
* Python 3.8 support
time.clock() was deprecated in Python 3.3, and removed in Python 3.8. Python 3.8 will be released on 14th October. See [PEP 596](https://www.python.org/dev/peps/pep-0569/) for more info.
Tested locally against Python 3.8.0rc1.
* replace time.clock with time.time
---
src/azure-cli-command_modules-nspkg/setup.py | 1 +
src/azure-cli-core/azure/cli/core/_session.py | 2 +-
src/azure-cli-core/setup.py | 1 +
src/azure-cli-nspkg/setup.py | 1 +
src/azure-cli-telemetry/setup.py | 1 +
src/azure-cli-testsdk/setup.py | 1 +
src/azure-cli/setup.py | 1 +
7 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/azure-cli-command_modules-nspkg/setup.py b/src/azure-cli-command_modules-nspkg/setup.py
index c397a7038..8929d9f8d 100644
--- a/src/azure-cli-command_modules-nspkg/setup.py
+++ b/src/azure-cli-command_modules-nspkg/setup.py
@@ -22,6 +22,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
diff --git a/src/azure-cli-core/azure/cli/core/_session.py b/src/azure-cli-core/azure/cli/core/_session.py
index 09ce986e8..f0948d43c 100644
--- a/src/azure-cli-core/azure/cli/core/_session.py
+++ b/src/azure-cli-core/azure/cli/core/_session.py
@@ -43,7 +43,7 @@ class Session(collections.MutableMapping):
try:
if max_age > 0:
st = os.stat(self.filename)
- if st.st_mtime + max_age < time.clock():
+ if st.st_mtime + max_age < time.time():
self.save()
with codecs_open(self.filename, 'r', encoding=self._encoding) as f:
self.data = json.load(f)
diff --git a/src/azure-cli-core/setup.py b/src/azure-cli-core/setup.py
index 3bd95df82..7cb381656 100644
--- a/src/azure-cli-core/setup.py
+++ b/src/azure-cli-core/setup.py
@@ -49,6 +49,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
diff --git a/src/azure-cli-nspkg/setup.py b/src/azure-cli-nspkg/setup.py
index b4d6d8c1d..f6e3173c1 100644
--- a/src/azure-cli-nspkg/setup.py
+++ b/src/azure-cli-nspkg/setup.py
@@ -22,6 +22,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
diff --git a/src/azure-cli-telemetry/setup.py b/src/azure-cli-telemetry/setup.py
index 40e8788c3..c8e13d56c 100755
--- a/src/azure-cli-telemetry/setup.py
+++ b/src/azure-cli-telemetry/setup.py
@@ -30,6 +30,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
diff --git a/src/azure-cli-testsdk/setup.py b/src/azure-cli-testsdk/setup.py
index 2e0af0793..1824bc1ef 100644
--- a/src/azure-cli-testsdk/setup.py
+++ b/src/azure-cli-testsdk/setup.py
@@ -27,6 +27,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py
index b90efab28..70a78c215 100644
--- a/src/azure-cli/setup.py
+++ b/src/azure-cli/setup.py
@@ -49,6 +49,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: MIT License',
]
--
2.24.0
# Maintainer: Kelsey Maes <kelseymaes at outlook dot com>
_name=azure-cli
pkgname=python-$_name
pkgver=2.0.75
pkgrel=1
pkgdesc="Microsoft Azure Command-Line Tools"
arch=('any')
url="https://github.com/Azure/azure-cli"
license=('MIT')
depends=('python-applicationinsights' 'python-argcomplete' 'python-azure-git' 'python-azure-multiapi-storage'
'python-colorama' 'python-humanfriendly' 'python-jmespath' 'python-knack'
'python-pyopenssl' 'python-pytz' 'python-scp' 'python-sshtunnel'
'python-tabulate' 'python-vsts-cd-manager' 'python-wheel' 'python-yaml')
makedepends=('git' 'python-setuptools')
source=("https://github.com/Azure/azure-cli/archive/azure-cli-${pkgver}.tar.gz"
"0001-Python-3.8-support-10777.patch")
sha256sums=('7c01642022118091f899abfaf04a6163126f0a6edf0f0ae605571f026a172e5c'
'b064a9986729f2d02d7175798492a7bdb7639c4cd3f2a235389f749ebf1b5ecf')
prepare() {
cd "$_name-$_name-$pkgver/"
patch --forward --strip=1 --input="${srcdir}/0001-Python-3.8-support-10777.patch"
}
build() {
cd "$_name-$_name-$pkgver/src"
for d in azure-cli \
azure-cli-core \
azure-cli-nspkg \
azure-cli-command_modules-nspkg;
do cd $d;
python setup.py build;
cd -;
done;
}
package() {
cd "$_name-$_name-$pkgver/src"
for d in azure-cli \
azure-cli-core \
azure-cli-nspkg \
azure-cli-command_modules-nspkg;
do cd $d;
python setup.py install --root="$pkgdir" --optimize=1
cd -;
done;
rm "$pkgdir"/usr/lib/python3.?/site-packages/azure/__init__.py
rm "$pkgdir"/usr/lib/python3.?/site-packages/azure/__pycache__/__init__.*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment