Merge branch 'master' into tox

This commit is contained in:
Julien Palard 2019-12-13 13:48:54 +01:00 committed by GitHub
commit aa81df65c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 19 deletions

View File

@ -2,4 +2,4 @@
__author__ = """Jules Lasne"""
__email__ = "jules.lasne@gmail.com"
__version__ = "0.2.4"
__version__ = "0.3.1"

View File

@ -1,6 +1,6 @@
import re
import subprocess
from typing import Mapping
from subprocess import check_output
import requests
@ -8,22 +8,19 @@ import requests
def get_repo_url(repo_path: str) -> str:
"""Tries to get the repository url from git commands
"""
url = check_output(
"git remote get-url --all upstream".split(),
universal_newlines=True,
cwd=repo_path,
)
if "fatal" in url:
url = check_output(
"git remote get-url --all upstream".split(),
universal_newlines=True,
cwd=repo_path,
)
if "fatal" in url:
# If the commands didn't work
raise RuntimeError(
f"Unknown error. `git get-url --all upstream|origin` returned {url}"
)
try:
url = subprocess.check_output("git remote get-url --all upstream".split(),
universal_newlines=True, cwd=repo_path,
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError:
try:
url = subprocess.check_output("git remote get-url --all origin".split(),
universal_newlines=True, cwd=repo_path,
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
raise RuntimeError(
f"Unknown error. `git get-url --all upstream|origin` returned \"{e.output.rstrip()}\"."
)
return url

View File

@ -7,7 +7,7 @@ with open("README.md") as readme:
setuptools.setup(
name="potodo",
version="0.2.4",
version="0.3.1",
description="Will list all .po files that are to be transated",
long_description=long_description,
long_description_content_type="text/markdown", # This is important!