-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add messages implementation for python
� Conflicts: � CHANGELOG.md
- Loading branch information
1 parent
2e33e68
commit 3d5ec13
Showing
67 changed files
with
2,309 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release Python | ||
|
||
on: | ||
push: | ||
branches: [release/*] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
permissions: | ||
id-token: write | ||
defaults: | ||
run: | ||
working-directory: python | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Show Python version | ||
run: python --version | ||
|
||
- uses: cucumber/[email protected] | ||
with: | ||
working-directory: "python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
name: test-python | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- main | ||
- renovate/** | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "pypy3.8" | ||
- "pypy3.9" | ||
- "pypy3.10" | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
exclude: | ||
- python-version: "pypy3.8" | ||
os: macos-latest | ||
- python-version: "pypy3.9" | ||
os: macos-latest | ||
- python-version: "pypy3.10" | ||
os: macos-latest | ||
- python-version: "3.8" | ||
os: macos-latest | ||
- python-version: "3.9" | ||
os: macos-latest | ||
- python-version: "3.10" | ||
os: macos-latest | ||
- python-version: "3.11" | ||
os: macos-latest | ||
- python-version: "pypy3.8" | ||
os: windows-latest | ||
- python-version: "pypy3.9" | ||
os: windows-latest | ||
- python-version: "pypy3.10" | ||
os: windows-latest | ||
- python-version: "3.8" | ||
os: windows-latest | ||
- python-version: "3.9" | ||
os: windows-latest | ||
- python-version: "3.10" | ||
os: windows-latest | ||
- python-version: "3.11" | ||
os: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U setuptools | ||
pip install tox tox-gh-actions codecov | ||
- name: Test with tox | ||
working-directory: ./python | ||
run: | | ||
tox | ||
- name: Gather codecov report | ||
working-directory: ./python | ||
run: | | ||
codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
*.rej | ||
*.py[cod] | ||
/.env | ||
*.orig | ||
**/__pycache__ | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
_build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
nosetests.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
.pytest_cache | ||
.ropeproject | ||
|
||
# Sublime | ||
/*.sublime-* | ||
|
||
#PyCharm | ||
/.idea | ||
|
||
# virtualenv | ||
/.Python | ||
/lib | ||
/include | ||
/share | ||
/local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
--- | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 24.8.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- "python/src" | ||
- "python/tests" | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-toml | ||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.14.0 | ||
hooks: | ||
- id: pretty-format-toml | ||
args: [--autofix] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.17.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py38-plus"] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.11.2 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [types-setuptools, types-certifi] | ||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: "1.3.2" | ||
hooks: | ||
- id: tox-ini-fmt | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint | ||
args: [--format, parsable, --strict] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
schemas = $(shell find ../jsonschema -name "*.json") | ||
|
||
.DEFAULT_GOAL = help | ||
|
||
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
HERE := $(dir $(MKFILE_PATH)) | ||
|
||
help: ## Show this help | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\n\nWhere <target> is one of:\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
generate: require install-deps | ||
datamodel-codegen \ | ||
--output-model-type "pydantic_v2.BaseModel" \ | ||
--input $(HERE)../jsonschema/Envelope.json \ | ||
--output $(HERE)src/cucumber_messages/messages.py \ | ||
--use-generic-container-types \ | ||
--allow-extra-fields \ | ||
--allow-population-by-field-name \ | ||
--snake-case-field \ | ||
--input-file-type=jsonschema \ | ||
--class-name Envelope \ | ||
--use-double-quotes \ | ||
--use-union-operator \ | ||
--disable-timestamp \ | ||
--target-python-version=3.8 | ||
|
||
require: ## Check requirements for the code generation (python is required) | ||
@python --version >/dev/null 2>&1 || (echo "ERROR: python is required."; exit 1) | ||
|
||
clean: ## Remove automatically generated files and related artifacts | ||
rm -rf $(HERE)src/_messages.py | ||
|
||
install-deps: ## Install generation dependencies | ||
python -m ensurepip --upgrade | ||
pip install $(HERE)[generation] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Messages | ||
|
||
Cucumber Messages for Python https://github.com/cucumber/messages |
Oops, something went wrong.