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

chore: switch to native namespaced packages #9

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

ludwiktrammer
Copy link
Collaborator

No description provided.

Copy link
Contributor

github-actions bot commented Sep 16, 2024

🧪 Test coverage: 94.19%

Code Coverage Summary

Filename                                                                                                Stmts    Miss  Cover    Missing
----------------------------------------------------------------------------------------------------  -------  ------  -------  -----------------------
packages/ragbits-common/src/ragbits/common/__init__.py                                                      0       0  100.00%
packages/ragbits-common/src/ragbits/common/embeddings/__init__.py                                           0       0  100.00%
packages/ragbits-common/src/ragbits/common/embeddings/base.py                                               4       0  100.00%
packages/ragbits-common/src/ragbits/common/llms/__init__.py                                                 4       0  100.00%
packages/ragbits-common/src/ragbits/common/llms/base.py                                                    33       4  87.88%   33, 52, 88, 97
packages/ragbits-common/src/ragbits/common/llms/litellm.py                                                 25       4  84.00%   8-9, 54, 85
packages/ragbits-common/src/ragbits/common/llms/local.py                                                   24       9  62.50%   7, 39-44, 54, 67-68
packages/ragbits-common/src/ragbits/common/llms/types.py                                                    8       2  75.00%   24, 28
packages/ragbits-common/src/ragbits/common/llms/clients/__init__.py                                         4       0  100.00%
packages/ragbits-common/src/ragbits/common/llms/clients/base.py                                            23       0  100.00%
packages/ragbits-common/src/ragbits/common/llms/clients/exceptions.py                                      14       6  57.14%   7-8, 17, 26-27, 36
packages/ragbits-common/src/ragbits/common/llms/clients/litellm.py                                         50      10  80.00%   10-11, 70, 108, 122-127
packages/ragbits-common/src/ragbits/common/llms/clients/local.py                                           37      12  67.57%   8-10, 59-67, 89-100
packages/ragbits-common/src/ragbits/common/prompt/__init__.py                                               2       0  100.00%
packages/ragbits-common/src/ragbits/common/prompt/base.py                                                  18       0  100.00%
packages/ragbits-common/src/ragbits/common/prompt/parsers.py                                               34       0  100.00%
packages/ragbits-common/src/ragbits/common/prompt/prompt.py                                                96       2  97.92%   103, 107
packages/ragbits-common/tests/__init__.py                                                                   0       0  100.00%
packages/ragbits-common/tests/unit/__init__.py                                                              0       0  100.00%
packages/ragbits-common/tests/unit/llms/__init__.py                                                         0       0  100.00%
packages/ragbits-common/tests/unit/llms/test_litellm.py                                                    63       0  100.00%
packages/ragbits-common/tests/unit/prompts/__init__.py                                                      0       0  100.00%
packages/ragbits-common/tests/unit/prompts/test_parsers.py                                                 65       0  100.00%
packages/ragbits-common/tests/unit/prompts/test_prompt.py                                                  81       0  100.00%
packages/ragbits-dev-kit/src/ragbits/dev_kit/__init__.py                                                    0       0  100.00%
packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/__init__.py                                          2       0  100.00%
packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/prompt_discovery.py                                 38       1  97.37%   62
packages/ragbits-dev-kit/tests/unit/discovery/prompt_classes_for_tests.py                                  27       0  100.00%
packages/ragbits-dev-kit/tests/unit/discovery/test_prompt_discovery.py                                     25       0  100.00%
packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/__init__.py                    2       0  100.00%
packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/__init__.py            3       0  100.00%
packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt1.py       14       0  100.00%
packages/ragbits-dev-kit/tests/unit/discovery/ragbits_tests_pkg_with_prompts/prompts/temp_prompt2.py       14       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/__init__.py                                    2       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/_main.py                                      33       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/documents/__init__.py                          0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/documents/document.py                         35       2  94.29%   34, 90
packages/ragbits-document-search/src/ragbits/document_search/documents/element.py                          30       1  96.67%   34
packages/ragbits-document-search/src/ragbits/document_search/documents/sources.py                          16       1  93.75%   47
packages/ragbits-document-search/src/ragbits/document_search/ingestion/__init__.py                          0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/ingestion/document_processor.py                9       1  88.89%   35
packages/ragbits-document-search/src/ragbits/document_search/retrieval/__init__.py                          0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/__init__.py               0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/base.py                   5       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/noop.py                   5       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/__init__.py                0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/base.py                    6       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/noop.py                    7       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/__init__.py                       0       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/base.py                          12       0  100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py                     18       0  100.00%
packages/ragbits-document-search/tests/unit/__init__.py                                                     0       0  100.00%
packages/ragbits-document-search/tests/unit/test_document_search.py                                        14       0  100.00%
packages/ragbits-document-search/tests/unit/test_documents.py                                              13       0  100.00%
packages/ragbits-document-search/tests/unit/test_elements.py                                               15       0  100.00%
packages/ragbits-document-search/tests/unit/test_simple_vector_store.py                                    16       0  100.00%
TOTAL                                                                                                     946      55  94.19%

Diff against main

Filename                                                                                         Stmts    Miss  Cover
---------------------------------------------------------------------------------------------  -------  ------  --------
packages/ragbits-common/src/ragbits/common/__init__.py                                               0       0  +100.00%
packages/ragbits-common/src/ragbits/common/embeddings/__init__.py                                    0       0  +100.00%
packages/ragbits-common/src/ragbits/common/embeddings/base.py                                       +4       0  +100.00%
packages/ragbits-common/src/ragbits/common/llms/__init__.py                                         +4       0  +100.00%
packages/ragbits-common/src/ragbits/common/llms/base.py                                            +33      +4  +87.88%
packages/ragbits-common/src/ragbits/common/llms/litellm.py                                         +25      +4  +84.00%
packages/ragbits-common/src/ragbits/common/llms/local.py                                           +24      +9  +62.50%
packages/ragbits-common/src/ragbits/common/llms/types.py                                            +8      +2  +75.00%
packages/ragbits-common/src/ragbits/common/llms/clients/__init__.py                                 +4       0  +100.00%
packages/ragbits-common/src/ragbits/common/llms/clients/base.py                                    +23       0  +100.00%
packages/ragbits-common/src/ragbits/common/llms/clients/exceptions.py                              +14      +6  +57.14%
packages/ragbits-common/src/ragbits/common/llms/clients/litellm.py                                 +50     +10  +80.00%
packages/ragbits-common/src/ragbits/common/llms/clients/local.py                                   +37     +12  +67.57%
packages/ragbits-common/src/ragbits/common/prompt/__init__.py                                       +2       0  +100.00%
packages/ragbits-common/src/ragbits/common/prompt/base.py                                          +18       0  +100.00%
packages/ragbits-common/src/ragbits/common/prompt/parsers.py                                       +34       0  +100.00%
packages/ragbits-common/src/ragbits/common/prompt/prompt.py                                        +96      +2  +97.92%
packages/ragbits-dev-kit/src/ragbits/dev_kit/__init__.py                                             0       0  +100.00%
packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/__init__.py                                  +2       0  +100.00%
packages/ragbits-dev-kit/src/ragbits/dev_kit/discovery/prompt_discovery.py                         +38      +1  +97.37%
packages/ragbits-document-search/src/ragbits/document_search/__init__.py                            +2       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/_main.py                              +33       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/documents/__init__.py                   0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/documents/document.py                 +35      +2  +94.29%
packages/ragbits-document-search/src/ragbits/document_search/documents/element.py                  +30      +1  +96.67%
packages/ragbits-document-search/src/ragbits/document_search/documents/sources.py                  +16      +1  +93.75%
packages/ragbits-document-search/src/ragbits/document_search/ingestion/__init__.py                   0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/ingestion/document_processor.py        +9      +1  +88.89%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/__init__.py                   0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/__init__.py        0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/base.py           +5       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rephrasers/noop.py           +5       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/__init__.py         0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/base.py            +6       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/retrieval/rerankers/noop.py            +7       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/__init__.py                0       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/base.py                  +12       0  +100.00%
packages/ragbits-document-search/src/ragbits/document_search/vector_store/in_memory.py             +18       0  +100.00%
TOTAL                                                                                             +594     +55  +100.00%

Results for commit: 8ed90d9

Minimum allowed coverage is 60%

♻️ This comment has been updated with latest results

Copy link
Contributor

Trivy scanning results.

@@ -81,10 +81,15 @@ warn_unused_ignores = false
show_error_codes = true
check_untyped_defs = true
no_implicit_optional = true
mypy_path = ['packages']
explicit_package_bases = true
mypy_path = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't ideal (but on the other hand it doesn't seem like a deal breaker) - when you create a new package, you have to add it to the list here, so that mypy can properly recognize it. So far, I haven't found a workaround around this.

@micpst micpst added the chore Changes to the build process or repo setup label Sep 17, 2024
@micpst micpst changed the title Switch to native namespaced packages chore: switch to native namespaced packages Sep 17, 2024
@ludwiktrammer ludwiktrammer merged commit 6ed4b17 into main Sep 17, 2024
3 checks passed
@micpst micpst deleted the namespaced_packages branch September 17, 2024 11:02
@mhordynski mhordynski restored the namespaced_packages branch September 17, 2024 11:27
@mhordynski mhordynski deleted the namespaced_packages branch September 17, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes to the build process or repo setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants