Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples extension #54

Merged
merged 20 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

67 changes: 42 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,22 @@ jobs:
max-parallel: 10
matrix:
include:
- {"salt-version": "3005.0", "python-version": "3.7", "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.8", "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.9", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.7", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "source": "onedir"}
- {"salt-version": "3005.0", "python-version": "3.7", "examples": false, "source": "pypi"}
MKLeb marked this conversation as resolved.
Show resolved Hide resolved
- {"salt-version": "3005.0", "python-version": "3.7", "examples": true, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.8", "examples": false, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.8", "examples": true, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.9", "examples": false, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.9", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.7", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.7", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": true, "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": false, "source": "onedir"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": true, "source": "onedir"}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -121,20 +129,20 @@ jobs:
env:
SALT_REQUIREMENT: salt~=${{ matrix.salt-version }}
run: |
nox --force-color -e tests-${{ matrix.source == 'onedir' && 'onedir' || '3' }} --install-only
nox --force-color -e tests${{ matrix.examples && '-examples' || '' }}-${{ matrix.source == 'onedir' && 'onedir' || '3' }} --install-only

- name: Test
env:
SALT_REQUIREMENT: salt~=${{ matrix.salt-version }}
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --force-color -e tests-${{ matrix.source == 'onedir' && 'onedir' || '3' }} -- -vv tests/
nox --force-color -e tests${{ matrix.examples && '-examples' || '' }}-${{ matrix.source == 'onedir' && 'onedir' || '3' }} -- -vv

- name: Upload Logs
if: always()
uses: actions/upload-artifact@main
with:
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}.log
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}${{ matrix.examples && '-examples' || '' }}.log
path: artifacts/runtests-*.log


Expand All @@ -150,11 +158,16 @@ jobs:
max-parallel: 10
matrix:
include:
- {"salt-version": "3005.0", "python-version": "3.8", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "source": "onedir"}
- {"salt-version": "3005.0", "python-version": "3.8", "examples": false, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.8", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.8", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": true, "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": false, "source": "onedir"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": true, "source": "onedir"}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -195,7 +208,7 @@ jobs:
- name: Define test session
shell: bash
id: define-test-session
run: echo "test-session=tests-${{ matrix.source == 'onedir' && 'onedir' || '3' }}" >> "$GITHUB_OUTPUT"
run: echo "test-session=tests${{ matrix.examples && '-examples' || '' }}-${{ matrix.source == 'onedir' && 'onedir' || '3' }}" >> "$GITHUB_OUTPUT"

- name: Install Test Requirements
shell: bash
Expand Down Expand Up @@ -230,7 +243,7 @@ jobs:
if: always()
uses: actions/upload-artifact@main
with:
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}.log
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}${{ matrix.examples && '-examples' || '' }}.log
path: artifacts/runtests-*.log


Expand All @@ -246,10 +259,14 @@ jobs:
max-parallel: 6
matrix:
include:
- {"salt-version": "3005.0", "python-version": "3.9", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "source": "onedir"}
- {"salt-version": "3005.0", "python-version": "3.9", "examples": false, "source": "pypi"}
- {"salt-version": "3005.0", "python-version": "3.9", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.9", "examples": true, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": false, "source": "pypi"}
- {"salt-version": "3006.0", "python-version": "3.10", "examples": true, "source": "pypi"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": false, "source": "onedir"}
- {"salt-version": "3006.x", "python-version": "3.10", "examples": true, "source": "onedir"}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -278,20 +295,20 @@ jobs:
env:
SALT_REQUIREMENT: salt~=${{ matrix.salt-version }}
run: |
nox --force-color -e tests-${{ matrix.source == 'onedir' && 'onedir' || '3' }} --install-only
nox --force-color -e tests${{ matrix.examples && '-examples' || '' }}-${{ matrix.source == 'onedir' && 'onedir' || '3' }} --install-only

- name: Test
env:
SALT_REQUIREMENT: salt~=${{ matrix.salt-version }}
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --force-color -e tests-${{ matrix.source == 'onedir' && 'onedir' || '3' }} -- -vv tests/
nox --force-color -e tests${{ matrix.examples && '-examples' || '' }}-${{ matrix.source == 'onedir' && 'onedir' || '3' }} -- -vv

- name: Upload Logs
if: always()
uses: actions/upload-artifact@main
with:
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}.log
name: runtests-${{ runner.os }}-${{ matrix.python-version }}-salt-${{ matrix.salt-version }}-${{ matrix.source }}${{ matrix.examples && '-examples' || '' }}.log
path: artifacts/runtests-*.log

build:
Expand Down
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ repos:
- pyyaml==6.0
- jinja2==3.1.2
- packaging==23.0
- id: tools
alias: examples-requirements
name: Collect examples requirements
files: "^examples/requirements/"
args:
- pre-commit
- examples-requirements

# ----- Code Formatting and Analysis ---------------------------------------------------------->
- repo: https://github.com/charliermarsh/ruff-pre-commit
Expand Down Expand Up @@ -100,8 +107,8 @@ repos:
hooks:
- id: mypy
name: Run mypy against the code base
files: ^(src/|tests/).*\.py$
args: []
files: ^(src/|tests/|examples/).*\.py$
args: [--explicit-package-bases]
MKLeb marked this conversation as resolved.
Show resolved Hide resolved
additional_dependencies:
- types-attrs
- types-setuptools
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-exclude examples *
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ For more detailed information, refer to `CONTRIBUTING`_.
.. _salt: https://github.com/saltstack/salt
.. _engine: https://docs.saltproject.io/en/latest/topics/engines/index.html
.. _CONTRIBUTING: https://github.com/saltstack/salt-analytics-framework/blob/main/CONTRIBUTING.md
.. _examples: https://github.com/saltstack/salt-analytics-framework/blob/main/examples

..
include-ends-here
Expand All @@ -94,3 +95,9 @@ Documentation
=============

The full documentation can be seen `here <https://salt-analytics-framework.readthedocs.io>`_.


Examples
========

Some examples of custom pipelines are provided. You can find them at `examples`_.
Loading