pydantic / pydantic/pytest-examples

author examples as .py files?

Open
#62 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
178
Forks
25
Avg merge
4d 1h
Merged PRs (30d)
7

Description

thanks for the great package - its really easy to use and useful.

I was wondering if it could be possible to author the examples as python files rather than markdown files with python code blocks?
... because writing the python code in a .md without the benefit of code-completion etc. is a little painful

maybe:

  • by embedding a python file into the markdown examples file at runtime (<< include myexample.py >>)
  • or perhaps as a %format python file with %[markdown] blocks?

or maybe you already have a way to avoid this irritation?

many thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how pytest-examples currently discovers and processes Python code in Markdown examples. Clarify whether the goal is standalone .py authoring, embedding Python files, or another format, then define tests that demonstrate the chosen workflow and confirm existing Markdown examples still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.