Skip to content

Commit b291354

Browse files
committed
adding documentation for local running
1 parent 7f6d40c commit b291354

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

README-sdk-dev.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,50 @@ To do this, edit the following line in the `./cms_bluebutton/version.py` file wi
315315
__version__ = "1.0.0",
316316
```
317317
318+
### Testing Locally
319+
320+
The current method for seeing the SDK in action is fairly complex, as it requires also setting up the Python sample client (https://github.com/CMSgov/bluebutton-sample-client-python-react/tree/main). These both, of course, depend upon the web-server repo for most of their logic. It is possible that in order to fully understand an issue that arises within the SDK or the sample client, a developer would have to track changes across 3 separate projects. There should be some future work to simplify this process as it is very manual and laborious.
321+
322+
The steps listed here are listed elsewhere in the documentation but for the sake of convenience, they are partially repeated here
323+
and written together so that a developer should be able to follow this step by step.
324+
325+
The overall goals are to:
326+
327+
- Build a local version of the SDK
328+
- Run a local version of sample client that consumes a local version of the SDK
329+
330+
### Building a local version of the SDK
331+
332+
Run the following commands in the base of this SDK repository. The commands suppose that you have the Python sample client cloned in the same folder as this SDK repo. Do not be in a virtualenv while running these commands.
333+
334+
```
335+
rm -rf build/
336+
python -m build --wheel --o ../bluebutton-sample-client-python-react/server
337+
```
338+
339+
The --o (or outdir) command should effectively 'copy paste' the built version of the .whl file into where it would be needed for the sample client. If you do not want it in the sample client, omit the --o and file path.
340+
341+
### Run a local version of sample client that consumes a local version of the SDK
342+
343+
Ensure that in bluebutton-sample-client-python-react/server/Dockerfile, uncomment the following line. Replace the version number (1.0.4 in the example) of the .whl file with what has been generated from the previous build command.
344+
345+
```
346+
RUN pip install cms_bluebutton_sdk-1.0.4-py3-none-any.whl
347+
```
348+
349+
In bluebutton-sample-client-python-react/server/Pipfile, add this line:
350+
351+
```
352+
cms-bluebutton-sdk = {file = "./cms_bluebutton_sdk-1.0.4-py3-none-any.whl"}
353+
```
354+
355+
In the base repository of bluebutton-sample-client-python-react, run the following commands. Ensure that you have no currently running containers or images of the sample client.
356+
357+
```
358+
cd server
359+
unzip -l cms_bluebutton_sdk-1.0.4-py3-none-any.whl
360+
pip install cms_bluebutton_sdk-1.0.4-py3-none-any.whl
361+
docker compose up
362+
```
363+
364+
Each time a change is made in the SDK, you must repeat all of the previous steps of building and re-running a local sample client. You must also ensure that the containers and images are removed each time.

0 commit comments

Comments
 (0)