Skip to content

Commit 95c0f3e

Browse files
author
Paul Prescod
authored
Merge pull request #409 from SFDO-Tooling/feature/fake-data-docs
First pass at adding Faker docs
2 parents 526c0d2 + 7fb0cca commit 95c0f3e

34 files changed

Lines changed: 1901 additions & 272 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,25 @@ jobs:
5656
- name: Run Tests
5757
run: python -m pytest
5858

59+
faker_docs:
60+
name: Faker Docs
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: "actions/checkout@v2"
64+
- uses: "actions/setup-python@v1"
65+
with:
66+
python-version: "3.9"
67+
68+
- name: Install dependencies
69+
run: |
70+
python -VV
71+
python -m pip install --upgrade pip pip-tools
72+
make dev-install
73+
python setup.py install
74+
75+
- name: Make Docs
76+
run: make docs
77+
5978
windows:
6079
name: Windows ${{ matrix.python-version }}
6180
runs-on: windows-latest

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ build/
1313
dist/
1414
docs/api/
1515
docs/_build/
16+
docs/fakedata
17+
docs/fakedata.md
18+
docs/locales.md
1619
.eggs/
1720
.idea/
1821
.tox/

CONTRIBUTING.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ Or you could make it outside of the project repo.
7171

7272
$ pytest
7373

74-
7. Your new code should also have meaningful tests. One way to double check that
74+
7. Build the docs like this:
75+
$ make docs
76+
$ open build/html/index.html
77+
78+
Set SF_MKDOCS_BUILD_LOCALES=False to skip building all locales
79+
80+
8. Your new code should also have meaningful tests. One way to double check that
7581
your tests cover everything is to ensure that your new code has test code coverage:
7682

7783
$ pytest --cov
@@ -123,3 +129,27 @@ You can finish up the process by updating the release object that was auto-creat
123129
Just paste in the changelog notes and hit publish.
124130

125131
Tada! You've published a new version of Snowfakery.
132+
133+
Internal Software Architecture
134+
------------------------------
135+
136+
=================================== ================================
137+
Filename Purpose
138+
----------------------------------- --------------------------------
139+
140+
cli.py Click-based Command Line. Uses the Click library to supply a CLI.
141+
data_generator.py The API entry point the CLI and CCI use. <p>This may be the best place to start reading. It abstracts away all of the complexity and outlines the core flow.
142+
parse_recipe_yaml.py Phase 1: parse YAML into a Runtime DOM<p>Includes some hacks to the YAML parser for handling line numbers.
143+
data_generator_runtime.py Phase 2: Runtime.<p>Actually generate the data by walking the template list top-to-bottom, generating rows as appopriate.
144+
data_generator_runtime_dom.py An object model used in Phase 2. Roughly similar to the shape of the YAML file.
145+
output_streams.py Where the data goes in the output. Used during Phase 2.
146+
data_gen_exceptions.py Exceptions that can be thrown
147+
generate_mapping_from_recipe.py In the CCI context, this utility package allows the generation of mapping.yml files.
148+
template_funcs.py Functions that can be invoked using either block syntax or in Jinja templates
149+
plugins.py Infrastructure for plugins
150+
standard_plugins/ Plugins that ship with Snowfakery
151+
tests/ Unit tests
152+
=================================== ================================
153+
154+
155+
<img src='docs/images/img6.png' id='PJUACA3lKvf' alt='Architecture Diagram'>

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ update-deps:
55
dev-install:
66
pip install --upgrade pip-tools
77
pip-sync requirements/*.txt
8+
pip install -e .
9+
10+
# set SF_MKDOCS_BUILD_LOCALES=False to skip building all locales
11+
docs: .FORCE
12+
python -m mkdocs build --clean --site-dir build/html --config-file mkdocs.yml
13+
14+
.FORCE:

custom_theme/img/favicon.ico

15 KB
Binary file not shown.

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
# Add any Sphinx extension module names here, as strings. They can be
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
30-
extensions = ["myst_parser"]
31-
myst_config = {}
30+
extensions = []
3231

3332
# Add any paths that contain templates here, relative to this directory.
3433
templates_path = ["_templates"]

0 commit comments

Comments
 (0)