|
| 1 | +# Questions |
| 2 | + |
| 3 | +If you are having difficulties using the APIs or have a question about the IBM Cloud and Services, |
| 4 | +please ask a question on [dW Answers][dw] or [Stack Overflow][stackoverflow]. |
| 5 | + |
| 6 | +# Issues |
| 7 | + |
| 8 | +If you encounter an issue with the Python Core SDK, you are welcome to submit a [bug report](https://github.com/IBM/whcs-python-sdk/issues). |
| 9 | +Before that, please search for similar issues. It's possible somebody has encountered this issue already. |
| 10 | + |
| 11 | +# Code |
| 12 | +## Commit Messages |
| 13 | +Commit messages should follow the [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). |
| 14 | +This is because our release tool - [semantic-release](https://github.com/semantic-release/semantic-release) - |
| 15 | +uses this format for determining release versions and generating changelogs. |
| 16 | +Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint](https://github.com/conventional-changelog/commitlint) |
| 17 | +can be used to help contributors and enforce commit messages. |
| 18 | +Here are some examples of acceptable commit messages, along with the release type that would be done based on the commit message: |
| 19 | + |
| 20 | +| Commit message | Release type | |
| 21 | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------| |
| 22 | +| `fix(Returns Model) Passages serialization error.` | Patch Release | |
| 23 | +| `feat(Repository Messages): add support for returning repository responses.` | ~~Minor~~ Feature Release | |
| 24 | + |
| 25 | +# Pull Requests |
| 26 | + |
| 27 | +If you want to contribute to the repository, here's a quick guide: |
| 28 | + |
| 29 | +1. Fork the repository |
| 30 | +1. Install `virtualenv` and `tox` |
| 31 | +1. Develop and test your code changes with [pytest]. |
| 32 | + * Respect the original code [style guide][styleguide]. |
| 33 | + * Only use spaces for indentation. |
| 34 | + * Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change. |
| 35 | + * Check for unnecessary whitespace with `git diff --check` before committing. |
| 36 | + * Make sure your code supports Python 3.5, 3.6, and 3.7. You can use `pyenv` and `tox` for this |
| 37 | +1. Make the test pass |
| 38 | +1. Check code coverage. Add tests for all new functionality and ensure overall coverage does not decrease. |
| 39 | +1. Commit your changes |
| 40 | +* Commits should follow the [Angular commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). This is because our release tool uses this format for determining release versions and generating changelogs. To make this easier, we recommend using the [Commitizen CLI](https://github.com/commitizen/cz-cli) with the `cz-conventional-changelog` adapter. |
| 41 | +1. Push to your fork and submit a pull request to the `dev` branch |
| 42 | + |
| 43 | +# Running the tests |
| 44 | + |
| 45 | +You probably want to set up a [virtualenv]. |
| 46 | + |
| 47 | +1. Clone this repository: |
| 48 | + ```sh |
| 49 | + git clone [email protected]/IBM/python-sdk-core.git |
| 50 | + ``` |
| 51 | +1. Install the SDK as an editable package using the current source: |
| 52 | + ```sh |
| 53 | + pip3 install --editable . |
| 54 | + ``` |
| 55 | +1. Install the test dependencies with: |
| 56 | + ```sh |
| 57 | + pip3 install -r requirements-dev.txt |
| 58 | + ``` |
| 59 | +1. Run the test cases with: |
| 60 | + The test cases make use of configuration files to provide API input. |
| 61 | + Each module in the SDK has a config.ini file in the test folder with |
| 62 | + default values for a provisioned Standard plan instance of the service. |
| 63 | + Populate the missing elements from the settings section so a connection |
| 64 | + to your service instance can be generated. From the module directory |
| 65 | + For your provisioned service run the following command: |
| 66 | + ```sh |
| 67 | + Python -m pytest tests/functional |
| 68 | + ``` |
| 69 | + NOTE: If you have provisioned a Custom plan instance of Insights for Medical Literature |
| 70 | + The Tests will fail until enriched content has been added to the instance. All default |
| 71 | + Values may need to be updated to reflect your level of enrichment. |
| 72 | + |
| 73 | +# Developer's Certificate of Origin 1.1 |
| 74 | +By making a contribution to this project, I certify that: |
| 75 | + |
| 76 | +(a) The contribution was created in whole or in part by me and I |
| 77 | + have the right to submit it under the open source license |
| 78 | + indicated in the file; or |
| 79 | + |
| 80 | +(b) The contribution is based upon previous work that, to the best |
| 81 | + of my knowledge, is covered under an appropriate open source |
| 82 | + license and I have the right under that license to submit that |
| 83 | + work with modifications, whether created in whole or in part |
| 84 | + by me, under the same open source license (unless I am |
| 85 | + permitted to submit under a different license), as indicated |
| 86 | + in the file; or |
| 87 | + |
| 88 | +(c) The contribution was provided directly to me by some other |
| 89 | + person who certified (a), (b) or (c) and I have not modified |
| 90 | + it. |
| 91 | + |
| 92 | +(d) I understand and agree that this project and the contribution |
| 93 | + are public and that a record of the contribution (including all |
| 94 | + personal information I submit with it, including my sign-off) is |
| 95 | + maintained indefinitely and may be redistributed consistent with |
| 96 | + this project or the open source license(s) involved. |
| 97 | + |
| 98 | +# Additional Resources |
| 99 | + |
| 100 | +* [General GitHub documentation](https://help.github.com/) |
| 101 | +* [GitHub pull request documentation](https://help.github.com/send-pull-requests/) |
| 102 | + |
| 103 | +[IBM Watson Health Support](https://ibmwatsonhealth.force.com/mysupport/s/) |
| 104 | +[styleguide]: http://google.github.io/styleguide/pyguide.html |
| 105 | +[pytest]: http://pytest.org/latest/ |
| 106 | +[virtualenv]: http://virtualenv.readthedocs.org/en/latest/index.html |
0 commit comments