|
| 1 | +# Contributing to sasoptpy |
| 2 | + |
| 3 | +We welcome all contributions including bug reports, new features, |
| 4 | +documentation fixes, performance enchancements, and new ideas. |
| 5 | + |
| 6 | +## Submitting a Pull Request |
| 7 | + |
| 8 | +If you have a contribution to make, submit a pull request using GitHub. |
| 9 | +You need to add a unit test for any source code changes, including bug fixes. |
| 10 | +Except for minor fixes, pull requests that do not have a unit test will not be accepted. |
| 11 | +If your change drops the code coverage, you may be asked to write additional |
| 12 | +unit tests. |
| 13 | + |
| 14 | +You must include the text from the ContributerAgreement.txt file |
| 15 | +along with your sign-off verifying that the change originated from you. |
| 16 | + |
| 17 | +## Testing |
| 18 | + |
| 19 | +Python [unittest](https://docs.python.org/3/library/unittest.html) are used for testing sasoptpy. |
| 20 | + |
| 21 | +Automated testing is performed using GitLab for internal development, |
| 22 | +but you can run unit tests in a Python environment. |
| 23 | + |
| 24 | +In order to run all the tests, you need to have certain environment variables set: |
| 25 | + |
| 26 | +* CAS Environment Variables: |
| 27 | + * __CASHOST__: Host or IP address for CAS sessions |
| 28 | + * __CASPORT__: Port number for CAS session |
| 29 | + * __AUTHINFO__: The location of your `.authinfo` file, that includes your username and password |
| 30 | + * __CASUSERNAME__: User name for the CAS session. This is required if `AUTHINFO` does not exist. |
| 31 | + * __CASPASSWORD__: Password for the CAS session. This is required if `AUTHINFO` does not exist. |
| 32 | +* SAS Environment Variables: |
| 33 | + * __SASHOST__: Host or IP address for SAS installation |
| 34 | + * __SASPATH__: Absolute path of the SAS installation in the host |
| 35 | + |
| 36 | +The CAS server should be active at runtime. |
| 37 | + |
| 38 | +You can start running all the unit tests under `tests` folder as follows: |
| 39 | + |
| 40 | +``` shell |
| 41 | +python -m unittest discover -s tests/ -p 'test*.py' |
| 42 | +``` |
| 43 | + |
| 44 | +If you install `coverage` package, you can see the total coverage of the unit tests. |
| 45 | +Under `tests` you can run `test_coverage.sh` (or `test_coverage.bat`) to see the final coverage. |
| 46 | +HTML pages will be created under `tests/html` folder. |
| 47 | + |
| 48 | +## Documentation |
| 49 | + |
| 50 | +The sasoptpy documentation is generated using [Sphinx](https://www.sphinx-doc.org/en/master/). |
| 51 | +Documentation is generated in both HTML (for web view) and LaTeX (for PDF file) formats. |
| 52 | + |
| 53 | +Sphinx handles both function APIs using the source files and Markdown files under `doc` folder. |
| 54 | +Configuration for Sphinx can be found under `doc/conf.py` file. |
| 55 | +A script is available for generating both formats `doc/makedocs.sh`. |
| 56 | + |
| 57 | +Final sasoptpy documentation is generated using a script at |
| 58 | + |
| 59 | +https://github.com/sertalpbilal/sasoptpy_doc_generator |
| 60 | + |
| 61 | +You can generate the multi-version documentation pages using [`generate_latest.sh`](https://github.com/sertalpbilal/sasoptpy_doc_generator/blob/master/generate_latest.sh) script, found |
| 62 | +in the repository. |
| 63 | + |
| 64 | +A [docker image](https://hub.docker.com/r/sertalpbilal/sphinx_dev/dockerfile) is available at Docker Hub |
| 65 | +that includes all dependencies. |
0 commit comments