From ec48af448333fb06f991d7ce4509d894ecce95a3 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Tue, 9 Jul 2019 08:35:52 +0700 Subject: [PATCH 1/3] :green_heart: Remove Python 3.8-dev The Python 3.8-dev job has broken on building ruamel.yaml, and the template doesnt provide control over allowing failures. --- .moban.d/travis.yml | 1 - .travis.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.moban.d/travis.yml b/.moban.d/travis.yml index 741fd994..01e298ba 100644 --- a/.moban.d/travis.yml +++ b/.moban.d/travis.yml @@ -10,7 +10,6 @@ matrix: {%block custom_python_versions%} python: - &pypy2 pypy2.7-6.0 - - 3.8-dev - 3.7 - 3.6 - 3.5 diff --git a/.travis.yml b/.travis.yml index 6706df51..e5734eba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ notifications: email: false python: - &pypy2 pypy2.7-6.0 - - 3.8-dev - 3.7 - 3.6 - 3.5 From 1f6b33e6f5abe44a1509ed28e822cf8ba6bcf091 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Mon, 8 Jul 2019 18:11:11 +0700 Subject: [PATCH 2/3] :ambulance: Revert "Bug fix repo name (#227)" This substantially reverts commit 95178912df9625dcc320ebe339d40dd2c1400567. The cause of the change has been addressed by an enhancement in git-url-parse v1.2.1, too late to be included in moban v0.4.0 https://github.com/retr0h/git-url-parse/commit/3e2bf91e Using giturlparse instead of git-url-parse is a non-trivial breaking change. It was done to avoid one minor regression which users could workaround, however it introduced many significant regressions users could not workaround as giturlparse does not parse many types of URLs. Closes https://github.com/moremoban/moban/issues/277 --- .moban.cd/moban.yml | 2 +- min_requirements.txt | 2 +- moban/repo.py | 8 +++----- requirements.txt | 2 +- setup.py | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.moban.cd/moban.yml b/.moban.cd/moban.yml index 480c0f13..670a37fd 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 - - giturlparse>=0.9.1 + - git-url-parse 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 3f7c2ca6..0b44029f 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 -giturlparse==0.9.1 +git-url-parse diff --git a/moban/repo.py b/moban/repo.py index c614aeeb..68475918 100644 --- a/moban/repo.py +++ b/moban/repo.py @@ -44,14 +44,12 @@ def git_clone(requires): def get_repo_name(repo_url): import giturlparse + from giturlparse.parser import ParserError try: repo = giturlparse.parse(repo_url) - name = repo.repo - if name.endswith("/"): - name = name[:-1] - return name - except AttributeError: + return repo.name + except ParserError: reporter.report_error_message( constants.MESSAGE_INVALID_GIT_URL % repo_url ) diff --git a/requirements.txt b/requirements.txt index 7dd42624..f3eba9eb 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 -giturlparse>=0.9.1 +git-url-parse diff --git a/setup.py b/setup.py index 75ca297a..e3e80ac0 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ "appdirs>=1.2.0", "crayons>= 0.1.0", "GitPython>=2.0.0", - "giturlparse>=0.9.1", + "git-url-parse", ] SETUP_COMMANDS = {} From f13e6134dee89b0695768a3e76a93d81267aeb12 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Mon, 8 Jul 2019 21:12:50 +0700 Subject: [PATCH 3/3] :ambulance: ignore repo trailing slashes git-url-parse does not yet (1.2.2) handle trailing slashes, which are an optional part of all git URLs, but were supported before the switch to using GitPython. Closes https://github.com/moremoban/moban/issues/277 --- .moban.cd/moban.yml | 2 +- min_requirements.txt | 2 +- moban/repo.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- tests/test_repo.py | 8 +++++--- 6 files changed, 10 insertions(+), 8 deletions(-) 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)