Skip to content

Add dm cli + docs #1

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 15 commits into from
Mar 27, 2025
Merged

Add dm cli + docs #1

merged 15 commits into from
Mar 27, 2025

Conversation

aclark4life
Copy link
Collaborator

No description provided.

@aclark4life aclark4life requested a review from Jibola March 25, 2025 15:14
@aclark4life
Copy link
Collaborator Author

@aclark4life aclark4life requested a review from Jibola March 25, 2025 19:27
Copy link

@Jibola Jibola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with merging, but could you create new tasks to track the remediation of things outlined?
Specifically redoing the file hierarchy for the integrated libraries.
Additionally, a task to provide more context on the best steps to follow for adding a new third-party library, following the new paradigm.

There's also a loose understanding of what support means in the CLI versus what it means from external user perspective. In this context, is it more to say "it runs in the cli" or is it still referring to "being functional enough that we can cosign others using it."

Comment on lines +72 to +102
def clone(repo, ctx, repo_names, all_repos, install):
"""Clone repositories from `pyproject.toml`."""
repos, url_pattern, branch_pattern, upstream_pattern = get_repos("pyproject.toml")

if repo_names:
for repo_name in repo_names:
not_found = set()
for repo_entry in repos:
if (
os.path.basename(url_pattern.search(repo_entry).group(0))
== repo_name
):
repo_clone(repo_entry, url_pattern, branch_pattern, repo)
if install:
clone_path = os.path.join(ctx.obj.home, repo_name)
if os.path.exists(clone_path):
repo_install(clone_path)
return
else:
not_found.add(repo_name)
click.echo(f"Repository '{not_found.pop()}' not found.")
return

if all_repos:
click.echo(f"Cloning {len(repos)} repositories...")
for repo_entry in repos:
repo_clone(repo_entry, url_pattern, branch_pattern, repo)
return

if ctx.args == []:
click.echo(ctx.get_help())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't pip install from pyproject be the proxy for installing these?
something like pip install ".[django_rest_framework]"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That syntax is for optional dependencies which I don't think can be "editable" or downloadable via git+ssh. However, it's possible this could be improved by having pyproject.toml read and install packages from requirements.txt which can contain editable git+ssh package references.

Comment on lines +47 to +53
if check_function(item):
if os.path.isdir(item):
shutil.rmtree(item)
click.echo(f"Removed directory: {item}")
elif os.path.isfile(item):
os.remove(item)
click.echo(f"Removed file: {item}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could create a lambda wrapper for these two, honestly.

if outcome := check_function(item):
    outcome() # executes the curried delete
`

@aclark4life
Copy link
Collaborator Author

aclark4life commented Mar 25, 2025

I'm fine with merging, but could you create new tasks to track the remediation of things outlined? Specifically redoing the file hierarchy for the integrated libraries. Additionally, a task to provide more context on the best steps to follow for adding a new third-party library, following the new paradigm.

OK I'll do quick fixes then merge then tickets for the rest, thanks

There's also a loose understanding of what support means in the CLI versus what it means from external user perspective. In this context, is it more to say "it runs in the cli" or is it still referring to "being functional enough that we can cosign others using it."

The latter. The goal is to define what support of third party libraries means and we're doing the work to meet those requirements here. Beyond that work, the CLI currently has no use and "working in the CLI" is just a convenience for us and not very meaningful beyond that. It's possible we could prototype some additional CLI commands here in the future, but that work is TBD.

@aclark4life
Copy link
Collaborator Author

aclark4life commented Mar 26, 2025

@Jibola I have this issue for the docs and I changed the dir structure, anything else to open tickets for ? Separate docs tickets maybe ?

@aclark4life aclark4life requested a review from Jibola March 26, 2025 16:18
@aclark4life
Copy link
Collaborator Author

Copy link

@Jibola Jibola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jibola
Copy link

Jibola commented Mar 27, 2025

issue for the docs

Honestly, that'll do it

@aclark4life aclark4life merged commit e4deb53 into mongodb-labs:main Mar 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants