diff --git a/.moban.cd/moban.yml b/.moban.cd/moban.yml index 670a37fd..0ff2e3d6 100644 --- a/.moban.cd/moban.yml +++ b/.moban.cd/moban.yml @@ -24,7 +24,7 @@ dependencies: - appdirs>=1.2.0 - crayons>= 0.1.0 - GitPython>=2.0.0 - - git-url-parse + - git-url-parse>=1.2.2 description: Yet another jinja2 cli command for static text generation scm_host: github.com lint_command: make lint install_test format install update diff --git a/min_requirements.txt b/min_requirements.txt index 0b44029f..4e76ef0a 100644 --- a/min_requirements.txt +++ b/min_requirements.txt @@ -4,4 +4,4 @@ lml==0.0.9 appdirs==1.2.0 crayons== 0.1.0 GitPython==2.0.0 -git-url-parse +git-url-parse==1.2.2 diff --git a/moban/repo.py b/moban/repo.py index 68475918..02fdd6de 100644 --- a/moban/repo.py +++ b/moban/repo.py @@ -47,7 +47,7 @@ def get_repo_name(repo_url): from giturlparse.parser import ParserError try: - repo = giturlparse.parse(repo_url) + repo = giturlparse.parse(repo_url.rstrip("/")) return repo.name except ParserError: reporter.report_error_message( diff --git a/requirements.txt b/requirements.txt index f3eba9eb..b835604e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ lml>=0.0.9 appdirs>=1.2.0 crayons>= 0.1.0 GitPython>=2.0.0 -git-url-parse +git-url-parse>=1.2.2 diff --git a/setup.py b/setup.py index e3e80ac0..d9b773c2 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ "appdirs>=1.2.0", "crayons>= 0.1.0", "GitPython>=2.0.0", - "git-url-parse", + "git-url-parse>=1.2.2", ] SETUP_COMMANDS = {} diff --git a/tests/test_repo.py b/tests/test_repo.py index aa70beed..1c82e258 100644 --- a/tests/test_repo.py +++ b/tests/test_repo.py @@ -125,14 +125,16 @@ def test_update_existing_with_reference_parameter( def test_get_repo_name(): repos = [ - "https://github.com/sphinx-doc/sphinx", + "https://github.com/repo-abc-def/repo", "https://github.com/abc/repo", "https://github.com/abc/repo.git", "https://github.com/abc/repo/", - "git@github.com:moremoban/moban.git", + "git@github.com:abc/repo.git", + "git@bitbucket.org:abc/repo.git", + "git://github.com/abc/repo.git", ] actual = [get_repo_name(repo) for repo in repos] - expected = ["sphinx", "repo", "repo", "repo", "moban"] + expected = ["repo"] * len(repos) eq_(expected, actual)