behave-data 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- behave_data-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
- behave_data-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +25 -0
- behave_data-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +24 -0
- behave_data-0.1.0/.github/workflows/ci.yml +29 -0
- behave_data-0.1.0/.github/workflows/release.yml +61 -0
- behave_data-0.1.0/.gitignore +19 -0
- behave_data-0.1.0/.pre-commit-config.yaml +7 -0
- behave_data-0.1.0/CHANGELOG.md +6 -0
- behave_data-0.1.0/CODE_OF_CONDUCT.md +64 -0
- behave_data-0.1.0/CONTRIBUTING.md +46 -0
- behave_data-0.1.0/LICENSE +21 -0
- behave_data-0.1.0/Makefile +31 -0
- behave_data-0.1.0/PKG-INFO +87 -0
- behave_data-0.1.0/README.md +44 -0
- behave_data-0.1.0/SECURITY.md +27 -0
- behave_data-0.1.0/behave_data/__init__.py +61 -0
- behave_data-0.1.0/behave_data/config.py +137 -0
- behave_data-0.1.0/behave_data/diff.py +182 -0
- behave_data-0.1.0/behave_data/errors.py +100 -0
- behave_data-0.1.0/behave_data/examples.py +107 -0
- behave_data-0.1.0/behave_data/hooks.py +80 -0
- behave_data-0.1.0/behave_data/loaders/__init__.py +109 -0
- behave_data-0.1.0/behave_data/loaders/csv.py +26 -0
- behave_data-0.1.0/behave_data/loaders/excel.py +54 -0
- behave_data-0.1.0/behave_data/loaders/http.py +61 -0
- behave_data-0.1.0/behave_data/loaders/json.py +34 -0
- behave_data-0.1.0/behave_data/loaders/sql.py +46 -0
- behave_data-0.1.0/behave_data/loaders/yaml.py +45 -0
- behave_data-0.1.0/behave_data/manager.py +20 -0
- behave_data-0.1.0/behave_data/null.py +65 -0
- behave_data-0.1.0/behave_data/patch.py +153 -0
- behave_data-0.1.0/behave_data/py.typed +0 -0
- behave_data-0.1.0/behave_data/raw_table.py +118 -0
- behave_data-0.1.0/behave_data/secrets.py +62 -0
- behave_data-0.1.0/behave_data/typed_table.py +162 -0
- behave_data-0.1.0/behave_data/types.py +134 -0
- behave_data-0.1.0/pyproject.toml +87 -0
- behave_data-0.1.0/tests/conftest.py +95 -0
- behave_data-0.1.0/tests/integration/environment.py +14 -0
- behave_data-0.1.0/tests/integration/features/data_tables.feature +30 -0
- behave_data-0.1.0/tests/integration/features/diff.feature +18 -0
- behave_data-0.1.0/tests/integration/features/null_handling.feature +7 -0
- behave_data-0.1.0/tests/integration/features/nullable_types.feature +7 -0
- behave_data-0.1.0/tests/integration/features/raw_table.feature +7 -0
- behave_data-0.1.0/tests/integration/features/typing.feature +7 -0
- behave_data-0.1.0/tests/integration/steps/data_tables_steps.py +108 -0
- behave_data-0.1.0/tests/integration/test_integration.py +29 -0
- behave_data-0.1.0/tests/unit/test_config.py +175 -0
- behave_data-0.1.0/tests/unit/test_diff.py +219 -0
- behave_data-0.1.0/tests/unit/test_errors.py +153 -0
- behave_data-0.1.0/tests/unit/test_examples.py +132 -0
- behave_data-0.1.0/tests/unit/test_hooks.py +125 -0
- behave_data-0.1.0/tests/unit/test_loaders.py +315 -0
- behave_data-0.1.0/tests/unit/test_null.py +93 -0
- behave_data-0.1.0/tests/unit/test_patch.py +199 -0
- behave_data-0.1.0/tests/unit/test_raw_table.py +143 -0
- behave_data-0.1.0/tests/unit/test_secrets.py +73 -0
- behave_data-0.1.0/tests/unit/test_typed_table.py +281 -0
- behave_data-0.1.0/tests/unit/test_types.py +237 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug in behave-data
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description
|
|
9
|
+
description: A clear description of the bug.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: reproduction
|
|
14
|
+
attributes:
|
|
15
|
+
label: Steps to Reproduce
|
|
16
|
+
description: Minimal code or steps to reproduce the issue.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: expected
|
|
21
|
+
attributes:
|
|
22
|
+
label: Expected Behavior
|
|
23
|
+
description: What you expected to happen.
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: actual
|
|
28
|
+
attributes:
|
|
29
|
+
label: Actual Behavior
|
|
30
|
+
description: What actually happened (include error messages/tracebacks).
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
- type: input
|
|
34
|
+
id: version
|
|
35
|
+
attributes:
|
|
36
|
+
label: behave-data Version
|
|
37
|
+
placeholder: "0.1.0"
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
- type: input
|
|
41
|
+
id: python
|
|
42
|
+
attributes:
|
|
43
|
+
label: Python Version
|
|
44
|
+
placeholder: "3.12"
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a feature for behave-data
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: Problem
|
|
9
|
+
description: What problem does this feature solve?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: solution
|
|
14
|
+
attributes:
|
|
15
|
+
label: Proposed Solution
|
|
16
|
+
description: Describe the solution you'd like.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives Considered
|
|
23
|
+
description: Any alternative solutions or features you've considered.
|
|
24
|
+
validations:
|
|
25
|
+
required: false
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
Brief description of what this PR does.
|
|
4
|
+
|
|
5
|
+
## Changes
|
|
6
|
+
|
|
7
|
+
- [ ] Change 1
|
|
8
|
+
- [ ] Change 2
|
|
9
|
+
|
|
10
|
+
## Testing
|
|
11
|
+
|
|
12
|
+
- [ ] `make lint` passes
|
|
13
|
+
- [ ] `make format-check` passes
|
|
14
|
+
- [ ] `make test-cov` passes (>= 90% coverage)
|
|
15
|
+
- [ ] New tests added for new functionality
|
|
16
|
+
- [ ] CHANGELOG.md updated (if user-facing changes)
|
|
17
|
+
|
|
18
|
+
## Type of Change
|
|
19
|
+
|
|
20
|
+
- [ ] Bug fix
|
|
21
|
+
- [ ] New feature
|
|
22
|
+
- [ ] Breaking change
|
|
23
|
+
- [ ] Documentation
|
|
24
|
+
- [ ] Refactor
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- run: pip install -e ".[dev,yaml,excel]"
|
|
22
|
+
- run: ruff check .
|
|
23
|
+
- run: ruff format --check .
|
|
24
|
+
- run: pytest tests/ -v --cov --cov-report=xml
|
|
25
|
+
- uses: codecov/codecov-action@v3
|
|
26
|
+
if: matrix.python-version == '3.12'
|
|
27
|
+
with:
|
|
28
|
+
file: ./coverage.xml
|
|
29
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ["v*"]
|
|
5
|
+
permissions:
|
|
6
|
+
contents: write
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: "3.12"
|
|
15
|
+
- run: pip install build
|
|
16
|
+
- run: python -m build
|
|
17
|
+
- uses: actions/upload-artifact@v4
|
|
18
|
+
with:
|
|
19
|
+
name: dist
|
|
20
|
+
path: dist/
|
|
21
|
+
publish:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
environment: pypi
|
|
25
|
+
permissions:
|
|
26
|
+
id-token: write
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/download-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: dist
|
|
31
|
+
path: dist/
|
|
32
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
33
|
+
with:
|
|
34
|
+
attestations: true
|
|
35
|
+
github-release:
|
|
36
|
+
needs: build
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
permissions:
|
|
39
|
+
contents: write
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
with:
|
|
43
|
+
fetch-depth: 0
|
|
44
|
+
- name: Extract changelog
|
|
45
|
+
id: changelog
|
|
46
|
+
run: |
|
|
47
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
48
|
+
VERSION="${TAG#v}"
|
|
49
|
+
BODY=$(awk -v ver="## [$VERSION]" '
|
|
50
|
+
$0 ~ ver {found=1; next}
|
|
51
|
+
/^## \[/ && found {exit}
|
|
52
|
+
found {print}
|
|
53
|
+
' CHANGELOG.md)
|
|
54
|
+
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
|
55
|
+
echo "$BODY" >> "$GITHUB_OUTPUT"
|
|
56
|
+
echo "EOF" >> "$GITHUB_OUTPUT"
|
|
57
|
+
- uses: softprops/action-gh-release@v2
|
|
58
|
+
with:
|
|
59
|
+
tag_name: ${{ github.ref_name }}
|
|
60
|
+
name: ${{ github.ref_name }}
|
|
61
|
+
body: ${{ steps.changelog.outputs.body }}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards
|
|
42
|
+
of acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies within all community spaces, and also applies
|
|
49
|
+
when an individual is officially representing the community in public spaces.
|
|
50
|
+
|
|
51
|
+
## Enforcement
|
|
52
|
+
|
|
53
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
54
|
+
reported to the community leaders responsible for enforcement at
|
|
55
|
+
mathias@paulenko.dev.
|
|
56
|
+
|
|
57
|
+
## Attribution
|
|
58
|
+
|
|
59
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
60
|
+
version 2.1, available at
|
|
61
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
62
|
+
|
|
63
|
+
[homepage]: https://www.contributor-covenant.org
|
|
64
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Contributing to behave-data
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! This document covers setup,
|
|
4
|
+
development commands, and the release process.
|
|
5
|
+
|
|
6
|
+
## Setup
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/MathiasPaulenko/behave-data.git
|
|
10
|
+
cd behave-data
|
|
11
|
+
pip install -e ".[dev,yaml,excel]"
|
|
12
|
+
pre-commit install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Development Commands
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
| :--- | :--- |
|
|
19
|
+
| `make dev` | Install with dev dependencies |
|
|
20
|
+
| `make lint` | Run ruff check |
|
|
21
|
+
| `make lint-fix` | Run ruff check with --fix |
|
|
22
|
+
| `make format` | Run ruff format |
|
|
23
|
+
| `make format-check` | Check formatting without changes |
|
|
24
|
+
| `make test` | Run pytest |
|
|
25
|
+
| `make test-cov` | Run pytest with coverage |
|
|
26
|
+
| `make build` | Build sdist + wheel |
|
|
27
|
+
| `make clean` | Remove build artifacts |
|
|
28
|
+
|
|
29
|
+
## Pre-PR Checklist
|
|
30
|
+
|
|
31
|
+
- [ ] `make lint` passes with 0 errors
|
|
32
|
+
- [ ] `make format-check` passes
|
|
33
|
+
- [ ] `make test-cov` passes with coverage >= 90%
|
|
34
|
+
- [ ] All public functions have type hints
|
|
35
|
+
- [ ] Tests cover happy path + edge cases
|
|
36
|
+
- [ ] CHANGELOG.md updated (if user-facing changes)
|
|
37
|
+
|
|
38
|
+
## Release Process
|
|
39
|
+
|
|
40
|
+
1. Update `CHANGELOG.md` with the new version section
|
|
41
|
+
2. Update `__version__` in `behave_data/__init__.py`
|
|
42
|
+
3. Update `version` in `pyproject.toml`
|
|
43
|
+
4. Commit: `git commit -m "release: vX.Y.Z"`
|
|
44
|
+
5. Tag: `git tag v0.X.Y`
|
|
45
|
+
6. Push: `git push --tags`
|
|
46
|
+
7. CI builds, publishes to PyPI, and creates a GitHub Release
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mathias Paulenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.PHONY: install dev lint lint-fix format format-check test test-cov clean build
|
|
2
|
+
|
|
3
|
+
install:
|
|
4
|
+
pip install -e .
|
|
5
|
+
|
|
6
|
+
dev:
|
|
7
|
+
pip install -e ".[dev,yaml,excel]"
|
|
8
|
+
|
|
9
|
+
lint:
|
|
10
|
+
ruff check .
|
|
11
|
+
|
|
12
|
+
lint-fix:
|
|
13
|
+
ruff check . --fix
|
|
14
|
+
|
|
15
|
+
format:
|
|
16
|
+
ruff format .
|
|
17
|
+
|
|
18
|
+
format-check:
|
|
19
|
+
ruff format --check .
|
|
20
|
+
|
|
21
|
+
test:
|
|
22
|
+
pytest tests/ -v
|
|
23
|
+
|
|
24
|
+
test-cov:
|
|
25
|
+
pytest tests/ -v --cov --cov-report=term-missing
|
|
26
|
+
|
|
27
|
+
clean:
|
|
28
|
+
rm -rf dist/ build/ *.egg-info/ .coverage htmlcov/ .pytest_cache/ .ruff_cache/
|
|
29
|
+
|
|
30
|
+
build:
|
|
31
|
+
python -m build
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: behave-data
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Data management for Behave — typed tables, diff, dynamic examples, fixtures, secrets
|
|
5
|
+
Project-URL: Homepage, https://github.com/MathiasPaulenko/behave-data
|
|
6
|
+
Project-URL: Repository, https://github.com/MathiasPaulenko/behave-data
|
|
7
|
+
Project-URL: Issues, https://github.com/MathiasPaulenko/behave-data/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/MathiasPaulenko/behave-data/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Mathias Paulenko
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: bdd,behave,data-tables,diff,examples,fixtures,testing,typing
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Testing
|
|
21
|
+
Classifier: Topic :: Software Development :: Testing :: BDD
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: behave-tables>=1.3.0
|
|
25
|
+
Requires-Dist: behave>=1.2.6
|
|
26
|
+
Provides-Extra: aws
|
|
27
|
+
Requires-Dist: boto3>=1.34; extra == 'aws'
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build>=1.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
34
|
+
Provides-Extra: excel
|
|
35
|
+
Requires-Dist: openpyxl>=3.1; extra == 'excel'
|
|
36
|
+
Provides-Extra: pandas
|
|
37
|
+
Requires-Dist: pandas>=2.0; extra == 'pandas'
|
|
38
|
+
Provides-Extra: vault
|
|
39
|
+
Requires-Dist: hvac>=2.0; extra == 'vault'
|
|
40
|
+
Provides-Extra: yaml
|
|
41
|
+
Requires-Dist: pyyaml>=6.0; extra == 'yaml'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# behave-data
|
|
45
|
+
|
|
46
|
+
Data management for Behave — typed tables, diff, dynamic examples, fixtures, secrets.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install behave-data
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For development:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install -e ".[dev,yaml,excel]"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quickstart
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
# features/environment.py
|
|
64
|
+
from behave_data import setup_data, before_step_hook
|
|
65
|
+
|
|
66
|
+
def before_all(context):
|
|
67
|
+
setup_data(context)
|
|
68
|
+
|
|
69
|
+
def before_step(context, step):
|
|
70
|
+
before_step_hook(context, step)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
# features/steps/typing.py
|
|
75
|
+
from behave_data import typed_wrap
|
|
76
|
+
|
|
77
|
+
@then("the car should have")
|
|
78
|
+
def step_car(context):
|
|
79
|
+
table = typed_wrap(context.table)
|
|
80
|
+
cars = table.typed_objects(Car)
|
|
81
|
+
for car in cars:
|
|
82
|
+
assert car.doors == 4 # int, not str
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# behave-data
|
|
2
|
+
|
|
3
|
+
Data management for Behave — typed tables, diff, dynamic examples, fixtures, secrets.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install behave-data
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For development:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install -e ".[dev,yaml,excel]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
# features/environment.py
|
|
21
|
+
from behave_data import setup_data, before_step_hook
|
|
22
|
+
|
|
23
|
+
def before_all(context):
|
|
24
|
+
setup_data(context)
|
|
25
|
+
|
|
26
|
+
def before_step(context, step):
|
|
27
|
+
before_step_hook(context, step)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
# features/steps/typing.py
|
|
32
|
+
from behave_data import typed_wrap
|
|
33
|
+
|
|
34
|
+
@then("the car should have")
|
|
35
|
+
def step_car(context):
|
|
36
|
+
table = typed_wrap(context.table)
|
|
37
|
+
cars = table.typed_objects(Car)
|
|
38
|
+
for car in cars:
|
|
39
|
+
assert car.doors == 4 # int, not str
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability in behave-data, please report it
|
|
6
|
+
responsibly.
|
|
7
|
+
|
|
8
|
+
**Do NOT open a public GitHub issue.**
|
|
9
|
+
|
|
10
|
+
Instead, email: **mathias@paulenko.dev**
|
|
11
|
+
|
|
12
|
+
Include:
|
|
13
|
+
- Description of the vulnerability
|
|
14
|
+
- Steps to reproduce
|
|
15
|
+
- Potential impact
|
|
16
|
+
- Suggested fix (if any)
|
|
17
|
+
|
|
18
|
+
You will receive a response within 48 hours. If the vulnerability is confirmed,
|
|
19
|
+
a fix will be released as soon as possible and you will be credited (unless you
|
|
20
|
+
prefer to remain anonymous).
|
|
21
|
+
|
|
22
|
+
## Supported Versions
|
|
23
|
+
|
|
24
|
+
| Version | Supported |
|
|
25
|
+
| :--- | :--- |
|
|
26
|
+
| 0.1.x | Yes |
|
|
27
|
+
| < 0.1 | No |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""behave-data — Data management for Behave."""
|
|
2
|
+
|
|
3
|
+
from behave_tables import (
|
|
4
|
+
ColumnMismatchError,
|
|
5
|
+
TableLike,
|
|
6
|
+
TableWrapper,
|
|
7
|
+
wrap,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from behave_data.config import Config
|
|
11
|
+
from behave_data.diff import diff
|
|
12
|
+
from behave_data.errors import (
|
|
13
|
+
BehaveDataError,
|
|
14
|
+
BuilderNotFoundError,
|
|
15
|
+
FixtureNotFoundError,
|
|
16
|
+
LoaderNotFoundError,
|
|
17
|
+
OptionalDependencyError,
|
|
18
|
+
RawTableError,
|
|
19
|
+
TableDiffError,
|
|
20
|
+
TypeConversionError,
|
|
21
|
+
)
|
|
22
|
+
from behave_data.hooks import before_step_hook, setup_data
|
|
23
|
+
from behave_data.null import get_column_markers, is_null, resolve_null
|
|
24
|
+
from behave_data.patch import apply_patches, revert_patches
|
|
25
|
+
from behave_data.raw_table import RawTable, raw_table
|
|
26
|
+
from behave_data.typed_table import TypedTableWrapper, typed_wrap
|
|
27
|
+
from behave_data.types import TYPE_CONVERTERS, convert_cell, parse_column_header, register_type
|
|
28
|
+
|
|
29
|
+
__version__ = "0.1.0"
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"BehaveDataError",
|
|
33
|
+
"BuilderNotFoundError",
|
|
34
|
+
"ColumnMismatchError",
|
|
35
|
+
"Config",
|
|
36
|
+
"FixtureNotFoundError",
|
|
37
|
+
"LoaderNotFoundError",
|
|
38
|
+
"OptionalDependencyError",
|
|
39
|
+
"RawTable",
|
|
40
|
+
"RawTableError",
|
|
41
|
+
"TableDiffError",
|
|
42
|
+
"TableLike",
|
|
43
|
+
"TableWrapper",
|
|
44
|
+
"TYPE_CONVERTERS",
|
|
45
|
+
"TypeConversionError",
|
|
46
|
+
"TypedTableWrapper",
|
|
47
|
+
"apply_patches",
|
|
48
|
+
"before_step_hook",
|
|
49
|
+
"convert_cell",
|
|
50
|
+
"diff",
|
|
51
|
+
"get_column_markers",
|
|
52
|
+
"is_null",
|
|
53
|
+
"parse_column_header",
|
|
54
|
+
"raw_table",
|
|
55
|
+
"register_type",
|
|
56
|
+
"resolve_null",
|
|
57
|
+
"revert_patches",
|
|
58
|
+
"setup_data",
|
|
59
|
+
"typed_wrap",
|
|
60
|
+
"wrap",
|
|
61
|
+
]
|