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

273 consistent styling #295

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

Conversation

lu-ny
Copy link
Contributor

@lu-ny lu-ny commented Dec 11, 2024

What does this PR do?

Fixes #273

  • Updated pre-commit-config.yaml, makefile, and pyproject.toml to enforce proper pre-commit checks.
  • Added black/ruff config to pyproject.toml
  • Updated Makefile format commands to use config
  • Removed circular dependencies from make format
  • Standardized exclude patterns across tools
  • Fixed some redefinitions (commented out safe commits, deleted instantiated classes before they were redefined) and unused variables (commented out) that came up when I tried to commit
Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary) N/A
  • Did you write any new necessary tests? (not for typos and docs) N/A
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request? N/A
pytest output
======================================================== test session starts ========================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/AdalFlow
configfile: pyproject.toml
plugins: mock-3.14.0, anyio-4.4.0
collected 209 items / 1 skipped                                                                                                     

adalflow/tests/test_AzureClient.py ..                                                                                         [  0%]
adalflow/tests/test_base_data_class.py ..............                                                                         [  7%]
adalflow/tests/test_component.py ...                                                                                          [  9%]
adalflow/tests/test_data.py ...                                                                                               [ 10%]
adalflow/tests/test_data_class_parser.py ......                                                                               [ 13%]
adalflow/tests/test_data_classes.py ....                                                                                      [ 15%]
adalflow/tests/test_data_loader.py .......                                                                                    [ 18%]
adalflow/tests/test_dataclass_object_functions.py ................                                                            [ 26%]
adalflow/tests/test_evaluators.py ..s                                                                                         [ 27%]
adalflow/tests/test_faiss_retriever.py .........                                                                              [ 32%]
adalflow/tests/test_function_expression_parse.py ........................                                                     [ 43%]
adalflow/tests/test_generator.py .....                                                                                        [ 45%]
adalflow/tests/test_generator_call_logger.py ...                                                                              [ 47%]
adalflow/tests/test_grad_component.py ......                                                                                  [ 50%]
adalflow/tests/test_groq_client.py ..                                                                                         [ 51%]
adalflow/tests/test_lazy_import.py ........                                                                                   [ 55%]
adalflow/tests/test_logger.py ......                                                                                          [ 57%]
adalflow/tests/test_memory.py ...                                                                                             [ 59%]
adalflow/tests/test_model_client.py ...                                                                                       [ 60%]
adalflow/tests/test_ollama_client.py ..                                                                                       [ 61%]
adalflow/tests/test_openai_client.py ..                                                                                       [ 62%]
adalflow/tests/test_output_parser.py ......                                                                                   [ 65%]
adalflow/tests/test_parameter.py ............                                                                                 [ 71%]
adalflow/tests/test_parameter_text_grad.py ...                                                                                [ 72%]
adalflow/tests/test_random_sample.py .....                                                                                    [ 75%]
adalflow/tests/test_sequential.py ...............                                                                             [ 82%]
adalflow/tests/test_string_parser.py ..........................                                                               [ 94%]
adalflow/tests/test_text_splitter.py .........                                                                                [ 99%]
adalflow/tests/test_tool.py ..                                                                                                [100%]

========================================================= warnings summary ==========================================================
adalflow/tests/test_ollama_client.py::TestOllamaModelClient::test_ollama_embedding_client
adalflow/tests/test_ollama_client.py::TestOllamaModelClient::test_ollama_llm_client
  /home/AdalFlow/adalflow/adalflow/components/model_client/ollama_client.py:165: UserWarning: Better to provide host or set OLLAMA_HOST env variable. We will use the default host http://localhost:11434 for now.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================ 208 passed, 2 skipped, 2 warnings in 4.48s =============================================
Commit output
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for added large files..............................................Passed
debug statements (python)................................................Passed
detect private key.......................................................Passed
black....................................................................Passed
ruff.....................................................................Passed
Run Make Format..........................................................Passed
[commit message]
 10 files changed, 23 insertions(+), 27 deletions(-)

…g to pyproject.toml- Update Makefile format commands to use config- Enhance pre-commit hooks with Ruff format- Removed circular dependencies- Standardize exclude patterns across tools- Fixed various redefinitions and commented out unused variables
…ncy, we should have one source-of-truth for formatting, which is the pre-commit
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

Apply consistent coding and documenting styling
2 participants