from gherkin.parser import Parser
from gherkin.pickles.compiler import compile
parser = Parser()
gherkin_document = parser.parse("Feature: ...")
pickles = compile(gherkin_document)
Traceback (most recent call last):
File "/Users/<user>/projects/python/repository/script.py", line 2, in <module>
from gherkin.pickles.compiler import compile
ImportError: cannot import name 'compile' from 'gherkin.pickles.compiler' (/Users/<user>/projects/python/repository/venv/lib/python3.10/site-packages/gherkin/pickles/compiler.py)
Updated example runs without issue:
from gherkin.parser import Parser
from gherkin.pickles.compiler import Compiler
parser = Parser()
gherkin_document = parser.parse("Feature: ...")
pickles = Compiler().compile(gherkin_document)
🏷️ What kind of change is this?
:bank: Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)
🤔 What's changed?
Updated the Python example for compatibility with the latest API of the package.
⚡️ What's your motivation?
Fix Python example so is working and runnable.
See the compiler.py module for API reference.
Current example, using previous API:
Updated example runs without issue:
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
NA.
📋 Checklist: