summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben@demerara.io>2021-11-19 08:28:36 +0000
committerBen Brown <ben@demerara.io>2021-11-19 08:28:36 +0000
commit796a2ae9622a37ab02195880c19d2055bb2412dc (patch)
tree2660fc8a9f0bece893d04839e53c403028219417
parentb3aad98e366fbf3b07c80b15a6638a84ca9c2af9 (diff)
parent26de9fb2cd55aad522a4fdaf5eb96c146b99d4aa (diff)
downloadlorry-796a2ae9622a37ab02195880c19d2055bb2412dc.tar.gz
Merge branch 'benbrown/python-version' into 'master'
Set minimum version to 3.6 Closes #26 See merge request CodethinkLabs/lorry/lorry!25
-rw-r--r--README.md2
-rwxr-xr-xlorry.raw-file-importer12
-rw-r--r--setup.py5
3 files changed, 16 insertions, 3 deletions
diff --git a/README.md b/README.md
index 0067010..7659b50 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ Dependencies
Required:
-* **Python 3**
+* **Python 3**: Minimum of 3.6.
* **Git**
diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer
index bca46b5..caaa8c9 100755
--- a/lorry.raw-file-importer
+++ b/lorry.raw-file-importer
@@ -39,7 +39,11 @@ def commit_lfs_gitattributes(fast_import):
def commit_lfs_file(raw_file, relative_path, last_commit, fast_import):
# git-lfs-pointer of the file
- ret = subprocess.run(['git', 'lfs', 'pointer', '--file', raw_file], capture_output=True, check=True)
+ ret = subprocess.run(
+ ['git', 'lfs', 'pointer', '--file', raw_file],
+ stdout=subprocess.PIPE,
+ check=True,
+ )
pointer_digest = ret.stdout
datasize = len(pointer_digest)
@@ -86,7 +90,11 @@ def commit_lfs_file(raw_file, relative_path, last_commit, fast_import):
def get_last_commit():
# show the full hash of the latest commit
- out = subprocess.run(['git', 'rev-parse', branch_ref], capture_output=True, text=True)
+ out = subprocess.run(
+ ['git', 'rev-parse', branch_ref],
+ stdout=subprocess.PIPE,
+ universal_newlines=True,
+ )
if out.returncode != 0:
return None
diff --git a/setup.py b/setup.py
index 95bc98a..ec0d3ca 100644
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,7 @@ import glob
import os
import shutil
import subprocess
+import sys
class Build(build):
@@ -95,6 +96,10 @@ class Install(install):
'share/lorry/hg-fast-export/plugins'))
+if sys.version_info < (3, 6):
+ print("lorry requires Python 3.6+", file=sys.stderr)
+ sys.exit(1)
+
setup(name='lorry',
description='FIXME',
long_description='''\