8000 mypy annotations (basic) + libvcs update by tony · Pull Request #373 · vcs-python/vcspull · GitHub
[go: up one dir, main page]

Skip to content

mypy annotations (basic) + libvcs update #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 25, 2022
Merged
Prev Previous commit
Next Next commit
Start stubbing out mypy
  • Loading branch information
tony committed Sep 25, 2022
commit b38fe43b0e2b32d5711888925f63dcc578d7c5cf
4 changes: 3 additions & 1 deletion src/vcspull/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def find_home_config_files(
def find_config_files(
path: Optional[Union[list[pathlib.Path], pathlib.Path]] = None,
match: Union[list[str], str] = ["*"],
filetype: list[Literal["json", "yaml"]] = ["json", "yaml"],
filetype: Union[
Literal["json", "yaml", "*"], list[Literal["json", "yaml", "*"]]
] = ["json", "yaml"],
include_home: bool = False,
):
"""Return repos from a directory and match. Not recursive.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_in_dir(
def test_find_config_path_string(
config_path: pathlib.Path, yaml_config: pathlib.Path, json_config: pathlib.Path
):
config_files = config.find_config_files(path=str(config_path))
config_files = config.find_config_files(path=config_path)

assert yaml_config in config_files
assert json_config in config_files
Expand Down
20 changes: 11 additions & 9 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ def test_updating_remote(
repo_dict = filter_repos([config], name="myclone")[0]
repo = update_repo(repo_dict)
for remote_name, remote_info in repo.remotes().items():
current_remote_url = repo.remote(remote_name).fetch_url.replace("git+", "")
if remote_name in config["remotes"]:
assert (
config["remotes"][remote_name].fetch_url.replace("git+", "")
== current_remote_url
)

elif remote_name == "origin":
assert config["url"].replace("git+", "") == current_remote_url
remote = repo.remote(remote_name)
if remote is not None:
current_remote_url = remote.fetch_url.replace("git+", "")
if remote_name in config["remotes"]:
assert (
config["remotes"][remote_name].fetch_url.replace("git+", "")
== current_remote_url
)

elif remote_name == "origin":
assert config["url"].replace("git+", "") == current_remote_url
0