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""" __author__ = """Jules Lasne"""
__email__ = "jules.lasne@gmail.com" __email__ = "jules.lasne@gmail.com"
__version__ = "0.2.4" __version__ = "0.3.1"

View File

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

View File

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