Skip to content

adjustments

adjustments #12

Workflow file for this run

name: Checks
on:
push:
branches: ['**']
pull_request:
permissions:
contents: read
concurrency:
group: checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.14']
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install development dependencies
run: python -m pip install -e '.[dev]'
- name: Check
run: make check
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
- name: Install development dependencies
run: python -m pip install -e '.[dev]'
- name: Build and validate distributions
run: |
python -m build
python -m twine check dist/*
- name: Verify source distribution contents
run: |
tar -tzf dist/featurevisor-*.tar.gz | grep '/conformance/sdk-v3.json$'
tar -tzf dist/featurevisor-*.tar.gz | grep '/tests/test_sdk.py$'
tar -tzf dist/featurevisor-*.tar.gz | grep '/tests_openfeature/test_provider.py$'
- name: Verify base wheel installation
run: |
python -m venv /tmp/featurevisor-base
/tmp/featurevisor-base/bin/python -m pip install --no-deps dist/featurevisor-*.whl
/tmp/featurevisor-base/bin/python -c 'import featurevisor; assert featurevisor.__all__ == ["Featurevisor", "FeaturevisorChildInstance", "FeaturevisorModule", "create_featurevisor"]'
/tmp/featurevisor-base/bin/python -c 'from importlib.util import find_spec; assert find_spec("openfeature") is None'
/tmp/featurevisor-base/bin/python -c 'from pathlib import Path; import featurevisor; assert Path(featurevisor.__file__).with_name("py.typed").is_file()'
/tmp/featurevisor-base/bin/python - <<'PY'
try:
import featurevisor.openfeature
except ModuleNotFoundError as exc:
assert "featurevisor[openfeature]" in str(exc)
else:
raise AssertionError("OpenFeature import unexpectedly succeeded without its optional dependency")
PY
/tmp/featurevisor-base/bin/python -m unittest discover -s tests -v
/tmp/featurevisor-base/bin/python -m pip check
- name: Verify OpenFeature wheel installation
run: |
python -m venv /tmp/featurevisor-openfeature
WHEEL=$(find dist -name 'featurevisor-*.whl' -print -quit)
/tmp/featurevisor-openfeature/bin/python -m pip install "${WHEEL}[openfeature]"
/tmp/featurevisor-openfeature/bin/python -m unittest discover -s tests_openfeature -v
/tmp/featurevisor-openfeature/bin/python -m pip check
example-project:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install Python SDK
run: python -m pip install -e .
- name: Set up Featurevisor v3 example-1 project
run: |
mkdir example-1
(cd example-1 && npx --yes @featurevisor/cli@3.x init --example=1)
(cd example-1 && npm install)
(cd example-1 && npx featurevisor build)
(cd example-1 && npx featurevisor test)
- name: Run project tests against Python SDK
run: python -m featurevisor test --projectDirectoryPath=./example-1 --onlyFailures