Skip to content

Commit

Permalink
enabling samples for azure-storage code (#6229)
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd authored Jul 4, 2019
1 parent 9f3e880 commit 845ce8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ src/build
*.iml
/doc/_build
/doc/sphinx/examples
/doc/sphinx/tests
/.vs/config/applicationhost.config

# Azure deployment credentials
Expand Down
11 changes: 8 additions & 3 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@

# FIX FOR EXAMPLE REFERENCES
REPO_ROOT = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..'))
glob_expansion = os.path.join(REPO_ROOT, 'sdk/*/*/examples/**/test*examples*.py')
example_files = glob.glob(glob_expansion, recursive=True)
examples_glob_expansion = os.path.join(REPO_ROOT, 'sdk/*/*/examples/**/test*example*.py')
samples_glob_expansion = os.path.join(REPO_ROOT, 'sdk/*/*/tests/**/test*sample*.py')

example_files = glob.glob(examples_glob_expansion, recursive=True)
samples_files = glob.glob(samples_glob_expansion, recursive=True)

all_files = [os.path.relpath(file, REPO_ROOT) for file in list(set(example_files + samples_files))]

# now for each package, we need to copy it and write it to the relative path FROM THE CURRENT CWD
for example_file in [os.path.relpath(example_file, REPO_ROOT) for example_file in example_files]:
for example_file in all_files:
relative_path_in_pkg = os.path.join(*(example_file.split(os.path.sep)[3:]))
final_destination = os.path.abspath(os.path.join(os.path.dirname(__file__), relative_path_in_pkg))

Expand Down

0 comments on commit 845ce8f

Please sign in to comment.