Skip to content
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

Refactor and Improve Build and Clean Commands #2917

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sanowl
Copy link

@sanowl sanowl commented Jun 20, 2024

Motivation

This pull request aims to refactor and improve the build and clean commands in the project to enhance readability and maintainability. The changes focus on organizing imports, adding detailed docstrings, renaming functions for clarity, streamlining initialization checks, and improving logging for better error handling and information.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

The existing functionality has been retained and tested to ensure everything works as expected. No new tests were added. The improvements should be verified by running the existing build and clean commands and ensuring they function correctly. Special attention should be given to the following:

  • The custom clean command should properly clean up the generated and junk files.
  • The antlr command should generate parsers without errors.
  • The build_py, develop, and sdist commands should work seamlessly with the updated code.

Related Issues and PRs

This PR is a standalone improvement and is not part of a group of changes. It addresses the need for better code maintainability and readability in the build and clean commands.

@facebook-github-bot
Copy link
Contributor

Hi @sanowl!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

- Grouped and sorted imports logically.
- Enhanced function and class docstrings for better documentation.
- Improved regex usage and file handling for clarity.
- Simplified command execution and logging.
- Ensured consistent error handling and logging throughout the code.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 20, 2024
@Jasha10
Copy link
Collaborator

Jasha10 commented Jun 20, 2024

Thanks, @sanowl.
It looks like CI is failing with an error ImportError: cannot import name 'Develop' from 'build_helpers.build_helpers' (/home/circleci/project/build_helpers/build_helpers.py).

It looks like renaming Develop to DevelopCommand has broken something.

If we go through with this change, I'd like to modify the OmegaConf:build_helpers.py file at the same time. That file has a lot in common with Hydra:build_helpers.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants