Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/more-forgivin…
Browse files Browse the repository at this point in the history
…g-functions
  • Loading branch information
Paul Prescod committed Apr 11, 2023
2 parents 3ded625 + c467b71 commit fafaf07
Show file tree
Hide file tree
Showing 223 changed files with 11,355 additions and 1,834 deletions.
1 change: 1 addition & 0 deletions .adr-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/adrs
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ exclude_lines =
pragma: no cover
@abstract
raise NotImplementedError
raise AssertionError
def __repr__
def __str__
if T.TYPE_CHECKING
if TYPE_CHECKING
74 changes: 58 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: CI

on: [push]
on: [push, workflow_dispatch]

env:
COVERALLS_PARALLEL: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
SF_MKDOCS_BUILD_LOCALES: "False"

jobs:
test:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
runs-on: sfdc-ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
Expand All @@ -23,7 +24,7 @@ jobs:
run: |
python -VV
python -m pip install --upgrade pip
make dev-install
pip install -r requirements_dev.txt
- name: "Run tox targets for ${{ matrix.python-version }}"
run: python -m tox
Expand All @@ -35,13 +36,17 @@ jobs:
run: |
python setup.py install
snowbench snowfakery/tools/benchmark_1.yml --num-records 10_000 --num-records-tablename Account --number-of-processes 4
snowbench
snowbench | tee bench.txt
tail -n 7 bench.txt >> $GITHUB_STEP_SUMMARY
with_cci:
name: With CumulusCI
runs-on: ubuntu-latest
runs-on: sfdc-ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- run: |
git fetch --no-tags origin main:_remote_main_
- uses: "actions/setup-python@v1"
with:
python-version: "3.9"
Expand All @@ -50,15 +55,27 @@ jobs:
run: |
python -VV
python -m pip install --upgrade pip
make dev-install
python -m pip install cumulusci
pip install -r requirements_dev.txt
python -m pip install git+https://github.com/SFDO-Tooling/CumulusCI.git@main
- name: Run Tests
run: python -m pytest
run: |
python -m coverage run -m pytest
- name: Check Coverage
run: |
coverage xml
coverage report
git diff HEAD.._remote_main_
diff-cover coverage.xml --fail-under 100 --compare-branch=_remote_main_ --diff-range-notation=.. --show-uncovered --markdown-report coverage.md
cat coverage.md >> $GITHUB_STEP_SUMMARY
- name: Type Check
run: pyright

faker_docs:
name: Faker Docs
runs-on: ubuntu-latest
runs-on: sfdc-ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
Expand All @@ -68,19 +85,44 @@ jobs:
- name: Install dependencies
run: |
python -VV
python -m pip install --upgrade pip pip-tools
make dev-install
pip install -r requirements_dev.txt
# docs build requires a proper install
python setup.py install
- name: Make Docs
run: make docs

pip:
name: "Install from Pip ${{ matrix.python-version }}"
runs-on: sfdc-ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.10"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "${{ matrix.python-version }}"

- name: "Install dependencies"
run: |
python -VV
python -m pip install --upgrade pip
- name: "Install using pip"
run: |
pip install .
- name: "Test installation"
run: |
python -m snowfakery --version
windows:
name: Windows ${{ matrix.python-version }}
runs-on: windows-latest
runs-on: sfdc-windows-latest
strategy:
matrix:
python-version: ["3.6", "3.9"]
python-version: ["3.9", "3.10"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
Expand All @@ -91,14 +133,14 @@ jobs:
run: |
python -VV
python -m pip install --upgrade pip
make dev-install
pip install -r requirements_dev.txt
- name: Run Tests
run: python -m pytest

coveralls_done:
name: Finalize coveralls
needs: [test]
runs-on: ubuntu-latest
runs-on: sfdc-ubuntu-latest
steps:
- run: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$GITHUB_SHA&payload[status]=done"
27 changes: 27 additions & 0 deletions .github/workflows/extra-checks-after-pull-request-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: post-review-checks

on:
pull_request_review:
types: [submitted]

workflow_dispatch:

jobs:
faker_docs:
name: Faker Docs I18N
runs-on: sfdc-ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -VV
pip install -r requirements_dev.txt
# docs build requires a proper install
python setup.py install
- name: Make Docs
run: make docs
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- main
paths:
- snowfakery/version.txt
workflow_dispatch:

jobs:
publish-to-pypi:
Expand Down
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
default_language_version:
python: python3
python: python3
repos:
- repo: https://github.com/ambv/black
rev: 21.4b2
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: check-merge-conflict
- id: flake8
- repo: local
hooks:
- id: merge-docs
name: Merge examples into docs
entry: tools/docs_samples.py
language: python
files: ".*.md|examples/.*.yml"
- id: check-merge-conflict
- id: flake8
- repo: local
hooks:
- id: merge-docs
name: Merge examples into docs
entry: tools/docs_samples.py
language: python
files: ".*.md|examples/.*.yml"
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
search:
ignore:
- fakedata/*.html

mkdocs:
configuration: mkdocs.yml

build:
os: ubuntu-20.04
tools:
python: "3.10"

python:
install:
- requirements: requirements_dev.txt
- method: setuptools
path: .
8 changes: 6 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Ready to contribute? Here's how to set up Snowfakery for local development.
Or you could make it outside of the project repo.
4. Install development requirements::

$ pip install -r requirements_dev.txt
$ make dev-install

5. Install ``pre-commit`` hooks for ``black`` and ``flake8``::

Expand All @@ -84,7 +84,7 @@ Set SF_MKDOCS_BUILD_LOCALES=False to skip building all locales

or

$ pytest --cov --cov-report=html
$ make coverage

8. Push your changes to GitHub and submit a pull request. The base branch should
be a new feature branch that we create to receive the changes (contact us to create
Expand Down Expand Up @@ -153,3 +153,7 @@ tests/ Unit tests


<img src='docs/images/img6.png' id='PJUACA3lKvf' alt='Architecture Diagram'>

Snowfakery is based upon YAML, but unlike in the canonical YAML model,
the order of keys does matter in Snowfakery. In particular, the first
key defines the type of objects in the Snowfakery dialect.
Loading

0 comments on commit fafaf07

Please sign in to comment.