Skip to content

Added option to get resolved packages in a requirements.txt file #135 - #156

Closed
arijitde92 wants to merge 0 commit into
aboutcode-org:mainfrom
arijitde92:main
Closed

Added option to get resolved packages in a requirements.txt file #135#156
arijitde92 wants to merge 0 commit into
aboutcode-org:mainfrom
arijitde92:main

Conversation

@arijitde92

Copy link
Copy Markdown
Contributor

Added a new click option in resolve_cli.py to provide a file name into which the resolved packages will be written. Also added a function in utils.py that writes of the resolved packages into the file.

I wrote the click option parameters as shown below-
@click.option( "--res", "resolved_output", type=FileOptionType(mode="w", encoding="utf-8", lazy=True), required=False, metavar="FILE", help="Write the resolved packages into a TEXT file. ", )

Please let me know if anything needs to be changed.
Thanks.

@TG1999 TG1999 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@arijitde92 thanks ++, please add tests to test the functionality that you have added

@arijitde92

Copy link
Copy Markdown
Contributor Author

@arijitde92 thanks ++, please add tests to test the functionality that you have added

Hi @TG1999 , I have added a test in test_cli.py and it is passing. Please have a look and let me know if anything else is required.

Thanks

@pombredanne

Copy link
Copy Markdown
Member

@arijitde92 Thanks. I like the idea of writing back requirements. We need to find a better name and help text for the CLI options as well as the module name though: neither --res nor "Write the resolved packages into a TEXT file. " are obvious.

@arijitde92

Copy link
Copy Markdown
Contributor Author

@arijitde92 Thanks. I like the idea of writing back requirements. We need to find a better name and help text for the CLI options as well as the module name though: neither --res nor "Write the resolved packages into a TEXT file. " are obvious.

Hi @pombredanne @TG1999, it would be really great if you can suggest some names and help text for the CLI options and module names. Since -r and -p are already taken for requirements and python version option, we need to think of other names for the resolved package option.

@TG1999

TG1999 commented Nov 10, 2023

Copy link
Copy Markdown
Contributor

@arijitde92 I think --resolved-output sounds good?

@pombredanne separate question can --resolved-output option be used along with --json or --json-pdt aor it should be mutually exclusive?

@arijitde92

Copy link
Copy Markdown
Contributor Author

Hi @TG1999 , @pombredanne ,

I changed the name to --resolved-output and the help text as Write the packages that are resolved after inspecting, into a TEXT file. The packages are written in a typical requirements file format that can be used by pip..

Is this okay?

@TG1999

TG1999 commented Nov 20, 2023

Copy link
Copy Markdown
Contributor

@arijitde92 please rebase and resolve conflicts

@arijitde92
arijitde92 changed the base branch from main to python-dot-version November 25, 2023 07:11
@arijitde92
arijitde92 changed the base branch from python-dot-version to main November 25, 2023 07:12
@arijitde92 arijitde92 closed this Nov 25, 2023
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.

3 participants