Skip to content

Commit 4548b67

Browse files
authored
Merge pull request #51 from aclark4life/main
Misc updates
2 parents c843602 + d99365f commit 4548b67

File tree

6 files changed

+698
-16
lines changed

6 files changed

+698
-16
lines changed

SHELL_DEPENDENCY_MAP.md

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.

django_mongodb_cli/repo.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,18 +389,28 @@ def log(
389389
all_repos: bool = typer.Option(
390390
False, "--all-repos", "-a", help="Show logs of all repositories"
391391
),
392+
n: int = typer.Option(
393+
10,
394+
"-n",
395+
"--lines",
396+
min=1,
397+
help="Number of log entries to show (per repository)",
398+
),
392399
):
393400
"""
394401
Show logs for the specified repository.
402+
403+
By default, shows the last 10 entries. Use ``-n/--lines`` to change the
404+
number of entries displayed (per repository).
395405
If --all-repos is used, show logs for all repositories.
396406
"""
397407
repo_command(
398408
all_repos,
399409
repo_name,
400410
all_msg="Showing logs for all repositories...",
401411
missing_msg="Please specify a repository name or use --all-repos to show logs of all repositories.",
402-
single_func=lambda repo_name: Repo().get_repo_log(repo_name),
403-
all_func=lambda repo_name: Repo().get_repo_log(repo_name),
412+
single_func=lambda repo_name: Repo().get_repo_log(repo_name, n),
413+
all_func=lambda repo_name: Repo().get_repo_log(repo_name, n),
404414
)
405415

406416

django_mongodb_cli/utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,13 @@ def fetch_repo(self, repo_name: str) -> None:
278278
except GitCommandError as e:
279279
self.err(f"❌ Failed to fetch updates: {e}")
280280

281-
def get_repo_log(self, repo_name: str) -> None:
282-
"""
283-
Get the commit log for the specified repository.
281+
def get_repo_log(self, repo_name: str, max_lines: int | None = None) -> None:
282+
"""Print the commit log for the specified repository.
283+
284+
Args:
285+
repo_name: Logical name of the repository.
286+
max_lines: Maximum number of log entries to display. If ``None``,
287+
a default of 10 entries is used.
284288
"""
285289
self.info(f"Getting commit log for repository: {repo_name}")
286290
_, repo = self.ensure_repo(repo_name)
@@ -293,7 +297,7 @@ def get_repo_log(self, repo_name: str) -> None:
293297
"--date=relative",
294298
"--graph",
295299
).splitlines()
296-
log_max = 10
300+
log_max = max_lines if max_lines is not None else 10
297301
for count, entry in enumerate(log_entries, start=1):
298302
typer.echo(f" - {entry}")
299303
if count >= log_max:

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ alias s := django-runserver
7676

7777
[group('django')]
7878
django-migrate:
79-
dm proj migrate
79+
dm project migrate
8080
alias m := django-migrate
8181

8282
[group('django')]
8383
django-createsuperuser:
84-
dm proj su
84+
dm project su
8585
alias su := django-createsuperuser
8686

8787
# ---------------------------------------- mongodb ----------------------------------------

pyproject.toml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,25 @@ test_dir = "src/django/tests"
138138
clone_dir = "src/django"
139139
test_dirs = [ "src/django/tests", "src/django-mongodb-backend/tests" ]
140140

141-
[[tool.django-mongodb-cli.test.django.env_vars]]
142-
name = "PYMONGOCRYPT_LIB"
143-
value = "/opt/homebrew/lib/libmongocrypt.dylib"
141+
#[[tool.django-mongodb-cli.test.django.env_vars]]
142+
#name = "PYMONGOCRYPT_LIB"
143+
#value = "/opt/homebrew/lib/libmongocrypt.dylib"
144+
145+
#[[tool.django-mongodb-cli.test.django.env_vars]]
146+
#name = "MONGODB_URI"
147+
#value = "mongodb://localhost:64437/?directConnection=true"
148+
149+
[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
150+
name = "DRIVERS_TOOLS"
151+
value = "/Users/alex.clark/Developer/django-mongodb-cli/src/drivers-evergreen-tools"
152+
153+
#[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
154+
#name = "MONGODB_URI"
155+
#value = "mongodb://localhost:64437/?directConnection=true"
156+
157+
[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
158+
name = "AWS_PROFILE"
159+
value = "my-profile"
144160

145161
[[tool.django-mongodb-cli.test.django.env_vars]]
146162
name = "MONGODB_URI"
@@ -363,6 +379,10 @@ repo = "git+ssh://git@github.com/mongodb/django-mongodb-backend"
363379
project_name = "django-mongodb"
364380
tasks = ["run-tests"]
365381

382+
[tool.django-mongodb-cli.evergreen.mongo-python-driver]
383+
project_name = "mongo-python-driver"
384+
tasks = ["run-tests"]
385+
366386
[tool.django-mongodb-cli.project.settings]
367387
# path = "settings.base"
368388
path = "settings.qe"

test/settings/qe.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
KMS_CREDENTIALS = {"aws": {"key": _AWS_KEY_ARN, "region": _AWS_REGION}}
2929
DEFAULT_KMS_PROVIDER = "aws"
3030
else:
31-
pass
32-
# Local-only fallback: matches the original configuration.
33-
# KMS_PROVIDERS = {"local": {"key": os.urandom(96)}}
34-
# KMS_CREDENTIALS = {"aws": {}}
35-
# DEFAULT_KMS_PROVIDER = "local"
31+
# Local-only fallback
32+
KMS_PROVIDERS = {"local": {"key": os.urandom(96)}}
33+
KMS_CREDENTIALS = {"local": {}}
34+
DEFAULT_KMS_PROVIDER = "local"
3635

3736

3837
DATABASES = {

0 commit comments

Comments
 (0)