Repository: aws/aws-cli
Pull request: Add txt files from examples to distributions
create-cluster-synopsis.rst was renamed to create-cluster-synopsis.txt
in order to pass the new documentation tests. This does not get included
in the distribution bundle, but will still work when tested as an
editable install.

fixes #4306 


Problem statement:
aws emr create-cluster help command returns error
how to reproduce 

1. upgrade to awscli 1.16.190 or 1.16.194 or 1.16.196
at the moment it's enough to install via pip either on macOS(1.16.194) or on linux(1.16.196), or using Homebrew(1.16.190) on macOS
```
# on Ubuntu 16.04 linux 
$ pip install --upgrade awscli
<... output skipped - but it was successful, no errors ...>

$ aws --version
aws-cli/1.16.196 Python/2.7.12 Linux/4.4.0-97-generic botocore/1.12.186

$ aws emr create-cluster help

[Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/awscli/examples/emr/create-cluster-synopsis.txt'



#or on macOS just for example using the one installed via Homebrew
$ brew install awscli
<... output skipped - but it was successful, no errors ...>

$ aws --version
aws-cli/1.16.190 Python/3.7.4 Darwin/18.6.0 botocore/1.12.180

$ aws emr create-cluster help
[Errno 2] No such file or directory: '/usr/local/Cellar/awscli/1.16.190/libexec/lib/python3.7/site-packages/awscli/examples/emr/create-cluster-synopsis.txt'

#or on macOS using aws installed via pip3
$ aws emr create-cluster help

[Errno 2] No such file or directory: '/usr/local/lib/python3.7/site-packages/awscli/examples/emr/create-cluster-synopsis.txt'
```

Hints from issue discussion:
@VitSkakun - Thank you for reporting this issue.  I can confirm the behavior and will label it as such.  We are looking into getting this resolved.  Do you need any other guidance with the `aws emr create-cluster` command?
> Do you need any other guidance with the aws emr create-cluster command?

@justnance - it's ok, thank you for asking. I used  the docs on Amazon documentation website.

Commit message: Add txt files from examples to distributions

create-cluster-synopsis.rst was renamed to create-cluster-synopsis.txt
in order to pass the new documentation tests. This does not get included
in the distribution bundle, but will still work when tested as an
editable install.

Patch to review:
diff --git a/MANIFEST.in b/MANIFEST.in
index d5466ce03b74..74f10c7ffc00 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,5 @@
 include README.rst
 include LICENSE.txt
 include requirements.txt
-recursive-include awscli/examples *.rst
+recursive-include awscli/examples *.rst *.txt
 recursive-include awscli/data *.json
diff --git a/setup.py b/setup.py
index a5027bdd50a5..98448d7a9c7d 100644
--- a/setup.py
+++ b/setup.py
@@ -54,6 +54,7 @@ def find_version(*file_paths):
              'bin/aws_bash_completer'],
     packages=find_packages(exclude=['tests*']),
     package_data={'awscli': ['data/*.json', 'examples/*/*.rst',
+                             'examples/*/*.txt', 'examples/*/*/*.txt',
                              'examples/*/*/*.rst', 'topics/*.rst',
                              'topics/*.json']},
     install_requires=requires,


Code review comments:
diff_hunk: @@ -258,3 +258,15 @@ def visit_literal_block(self, node):
 
     def default_visit(self, node):
         pass
+
+
+
+def test_only_rst_and_txt_example_files():
+    for root, _, files in os.walk(EXAMPLES_DIR):
+        for filename in files:
+            filepath = '%s/%s' % (root, filename)
path: tests/functional/docs/test_examples.py
text: @user1:
We need to do `os.path.join` here for Windows.