-
Notifications
You must be signed in to change notification settings - Fork 103
Docs - update repo docs for tests & release creation #1879
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
+43
−90
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
955f64b
Replace publishing instructions with a new release guide in README_re…
databyjp 74f0186
Update CONTRIBUTING.md with streamlined setup instructions and add RE…
databyjp 5977220
Merge branch 'main' into docs/update-repo-guides
databyjp e017d8e
Update per DK comments
databyjp 6496753
Update release guide
databyjp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ## How to create releases | ||
|
|
||
| ### Step 1: Prepare for release | ||
| 1. Pull latest main | ||
| - Merge any pending PRs | ||
| 2. Determine what the next version should be, following semantic versioning | ||
| 3. Create a new branch for the changelog | ||
| 4. Add a changelog entry to `docs/changelog.rst` | ||
| - `gh pr list --repo weaviate/weaviate-python-client --state merged --search "merged:>=YYYY-MM-DD"` where `YYYY-MM-DD` is the last release date | ||
| - Only add the relevant entries to the changelog | ||
| - Examples - [minor release](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.18.0), [patch release](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.16.10) | ||
| 5. Merge back to main | ||
| 6. Pull main | ||
|
|
||
| ### Step 2: Create release | ||
| Option 1: With GH CLI | ||
| 1. `gh release create <VERSION_TAG>` (e.g. `gh release create v4.18.1`) | ||
|
|
||
| Option 2: With git + GH web UI | ||
| 1. git tag VERSION | ||
| - `git tag -a v4.18.1 -m "v4.18.1" | ||
| 2. `git push --tags` | ||
| 3. Create a release [from the GH repo](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository?tool=webui#creating-a-release) | ||
|
|
||
| ### Step 3: Monitor pipeline | ||
| 1. Monitor the CICD pipeline | ||
| 1. When all tests pass, the release will be pushed to PyPI automatically | ||
|
|
||
| ### Notes: | ||
| - The package version is updated automatically (see setup.cfg) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,64 +1 @@ | ||
| # Unit tests for Weaviate Python client | ||
| --- | ||
| Unit tests for weaviate package. Each module should have its own sub-directory in the `test` directory. Each test file should begin with `test_<fine_name>.py` and `test` directory should not be renamed, these are mandatory requirements for the `unittest` to parse and run all unittests. | ||
|
|
||
| The `util.py` contains helper functions for unit testing. | ||
|
|
||
| --- | ||
| ## Run one file unittest | ||
| In order to unit test a single file, you can run the following command: | ||
| ``` | ||
| python -m unittest path_to_file_dir.file | ||
| ``` | ||
| E.g. if you run it from repo root folder: | ||
| ```bash | ||
| python -m unittest test.gql.test_get -v # -v is optional, -v = verbose | ||
| ``` | ||
| ## Run whole package unittest | ||
| In order to unit test the whole package, you can run the following command: | ||
| ```bash | ||
| python -m unittest -v # -v is optional, -v = verbose | ||
| ``` | ||
|
|
||
| # Coverage test | ||
| --- | ||
| Coverage test for weaviate package. Coverage test can be performed using the existing unit test. It runs all the unit tests in order to find which parts of the code have been executed, thus it can be used instead of the Unit test. | ||
| Coverage test is performed by the `coverage` package that should be installed with the `development-requirements.txt`. For more information on what and how to run coverage tests visit this [link](https://coverage.readthedocs.io/en/coverage-5.3.1/ "coverage.readthedocs.io"). | ||
|
|
||
| --- | ||
|
|
||
| ## Run coverage test for one file | ||
| Coverage test for one file can be performed using the following command: | ||
| ```bash | ||
| coverage run -m unittest path_to_the_file_dir.file -v # -v is optional, -v = verbose | ||
| ``` | ||
| E.g. if you run it from repo root folder: | ||
| ```bash | ||
| coverage run -m unittest test.gql.test_get -v # -v is optional, -v = verbose | ||
| ``` | ||
|
|
||
| ## Run whole package coverage test | ||
| In order to unit test the whole package, you can run the following command: | ||
| ```bash | ||
| coverage run -m unittest -v # -v is optional, -v = verbose | ||
| ``` | ||
| ## Show coverage report | ||
| To get the coverage report run the following command. | ||
| ```bash | ||
| coverage report -m --skip-covered # --skip-covered = skip 100% covered files, -m = show missing lines | ||
| ``` | ||
|
|
||
| # Linting | ||
| --- | ||
| Lint the files that are modified before commiting. The linting is done by `pylint`. | ||
|
|
||
| To lint a file/module/package run the following command: | ||
| ```bash | ||
| pylint path_to_the_file_or_module | ||
| ``` | ||
| E.g. if you run it from repo root folder: | ||
| ```bash | ||
| pylint weaviate # for the whole package | ||
| pylint weaviate/batch # for the module batch | ||
| pylint weaviate/connect/connection.py # for the connection.py file | ||
| ``` | ||
| Refer to [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions on how to run the tests. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.