diff --git a/django_mongodb_cli/repo.py b/django_mongodb_cli/repo.py index 5345134..8e9138a 100644 --- a/django_mongodb_cli/repo.py +++ b/django_mongodb_cli/repo.py @@ -368,7 +368,7 @@ def test( ] ) elif repo_name == "mongo-python-driver": - command.extend(["test"]) + command.extend(["test", "-s"]) command.extend(modules) if os.environ.get("DJANGO_SETTINGS_MODULE"): @@ -402,9 +402,14 @@ def test( "--reset", is_flag=True, ) +@click.option( + "-d", + "--diff", + is_flag=True, +) @click.pass_context @pass_repo -def status(repo, ctx, repo_names, all_repos, reset): +def status(repo, ctx, repo_names, all_repos, reset, diff): """Repository status.""" repos, url_pattern, _ = get_repos("pyproject.toml") if repo_names: @@ -415,7 +420,7 @@ def status(repo, ctx, repo_names, all_repos, reset): os.path.basename(url_pattern.search(repo_entry).group(0)) == repo_name ): - repo_status(repo_entry, url_pattern, repo, reset=reset) + repo_status(repo_entry, url_pattern, repo, reset=reset, diff=diff) return else: not_found.add(repo_name) @@ -425,7 +430,7 @@ def status(repo, ctx, repo_names, all_repos, reset): if all_repos: click.echo(f"Status of {len(repos)} repositories...") for repo_entry in repos: - repo_status(repo_entry, url_pattern, repo, reset=reset) + repo_status(repo_entry, url_pattern, repo, reset=reset, diff=diff) return if ctx.args == []: diff --git a/django_mongodb_cli/utils.py b/django_mongodb_cli/utils.py index 7d5c377..a2575b0 100644 --- a/django_mongodb_cli/utils.py +++ b/django_mongodb_cli/utils.py @@ -137,6 +137,8 @@ def repo_clone(repo_entry, url_pattern, branch_pattern, repo): def repo_install(clone_path): + if clone_path.endswith("mongo-arrow"): + clone_path = os.path.join(clone_path, "bindings", "python") if os.path.exists(os.path.join(clone_path, "pyproject.toml")): subprocess.run([sys.executable, "-m", "pip", "install", "-e", clone_path]) elif os.path.exists(os.path.join(clone_path, "setup.py")): @@ -177,7 +179,7 @@ def repo_update(repo_entry, url_pattern, repo): click.echo(f"Skipping {repo_name}: Repository not found at {clone_path}") -def repo_status(repo_entry, url_pattern, repo, reset=False): +def repo_status(repo_entry, url_pattern, repo, reset=False, diff=False): """Helper function to update a single repository.""" url_match = url_pattern.search(repo_entry) if not url_match: @@ -190,25 +192,29 @@ def repo_status(repo_entry, url_pattern, repo, reset=False): if os.path.exists(clone_path): try: repo = git.Repo(clone_path) - click.echo(click.style(f"Status for {repo_name}:", fg="blue")) + click.echo(f"=== {repo_name} ===") if reset: click.echo(click.style(repo.git.reset("--hard"), fg="blue")) else: - click.echo() + click.echo("Remote URLs:") click.echo( - click.style( - "".join( - [f"{remote.name}:{remote.url}" for remote in repo.remotes] - ), - fg="blue", - ) + "".join( + [f"- {remote.name}:{remote.url}" for remote in repo.remotes] + ), ) - click.echo() - click.echo(click.style(repo.git.status(), fg="blue")) - click.echo() - click.echo() - click.echo() + click.echo(repo.git.status()) + if diff: + diff_output = repo.git.diff() + if diff_output: + click.echo(click.style(diff_output, fg="red")) + else: + click.echo(click.style("No diff output", fg="yellow")) except git.exc.NoSuchPathError: click.echo("Not a valid Git repository.") else: - click.echo(f"Skipping {repo_name}: Repository not found at {clone_path}") + click.echo( + click.style( + f"Skipping {repo_name}: Repository not found at {clone_path}", + fg="yellow", + ) + ) diff --git a/pyproject.toml b/pyproject.toml index 3ae3ae7..298bf19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,22 +35,25 @@ packages = ["django_mongodb_cli"] [tool.django_mongodb_cli] dev = [ "DublinCityCenterPubFinder @ git+ssh://git@github.com/anaiyaraisin/DublinCityCenterPubFinder", - "django @ git+ssh://git@github.com/mongodb-forks/django@mongodb-5.1.x", + "django @ git+ssh://git@github.com/mongodb-forks/django@mongodb-5.2.x", "django-allauth @ git+ssh://git@github.com/pennersr/django-allauth@main", "django-debug-toolbar @ git+ssh://git@github.com/django-commons/django-debug-toolbar@main", "django-filter @ git+ssh://git@github.com/carltongibson/django-filter@main", - "django-mongodb-app @ git+ssh://git@github.com/mongodb-labs/django-mongodb-app@5.1.x", + "django-mongodb-app @ git+ssh://git@github.com/mongodb-labs/django-mongodb-app@5.2.x", "django-mongodb-backend @ git+ssh://git@github.com/mongodb/django-mongodb-backend@main", "django-mongodb-extensions @ git+ssh://git@github.com/mongodb-labs/django-mongodb-extensions@main", - "django-mongodb-project @ git+ssh://git@github.com/mongodb-labs/django-mongodb-project@5.1.x", + "django-mongodb-project @ git+ssh://git@github.com/mongodb-labs/django-mongodb-project@5.2.x", "django-mongodb-templates @ git+ssh://git@github.com/aclark4life/django-mongodb-templates@main", "django-rest-framework @ git+ssh://git@github.com/encode/django-rest-framework@main", "docs @ git+ssh://git@github.com/mongodb/docs@master", "flask-pymongo @ git+ssh://git@github.com/mongodb-labs/flask-pymongo", "langchain-mongodb @ git+ssh://git@github.com/langchain-ai/langchain-mongodb@main", "libmongocrypt @ git+ssh://git@github.com/mongodb-labs/libmongocrypt@main", + "mongo-arrow @ git+ssh://git@github.com/mongodb-labs/mongo-arrow@main", + "mongo-orchestration @ git+ssh://git@github.com/mongodb-labs/mongo-orchestration@master", "mongo-python-driver @ git+ssh://git@github.com/mongodb/mongo-python-driver@master", "pymongo-auth-aws @ git+ssh://git@github.com/mongodb/pymongo-auth-aws@main", + "pymongo-transactions @ git+ssh://git@github.com/aclark4life/pymongo-transactions@main", "specifications @ git+ssh://git@github.com/mongodb/specifications@master", "wagtail @ git+ssh://git@github.com/mongodb-forks/wagtail@main", "wagtail-mongodb-project @ git+ssh://git@github.com/mongodb-labs/wagtail-mongodb-project@main",