Files
dlt/docs/examples/CONTRIBUTING.md
David Scharf 3ebbfa1f9e migrate to uv (#2766)
* move pyproject.toml and makefile from old branch and add inbetween changes

* update workflow files to use uv

* run new version of formatter

* fix building of images with uv

* possibly fix docs linting

* downgrade lancedb dependency to fix tests

* fix gcs compat mode for s3 for newest boto

* fix docstrings in examples

* add some uv constraints

* update readme.md and contributing.md and some other places

* allow duckdb 0.8 in range

* add link-mode copy to uv venv on windows

* remove poetry lockfile and unneeded lockfile checker

* fix chess api related failures

* sleep after dremio start..

* set correct package in pyproject

* Revert "add some uv constraints"

This reverts commit d611e9ecce.

# Conflicts:
#	pyproject.toml
#	uv.lock

* add missing databricks sql connector version bounds
2025-06-19 10:11:24 +02:00

1.6 KiB

How to contribute your example

Note: All paths in this guide are relative to the dlt repository directory.

Add snippet

  • Go to docs/examples/.
  • Copy the template in ./_template/...
  • Make sure the folder and your examples script have the same name
  • Update the doc string which will compromise the generated markdown file, check the other examples how it is done
  • If your example requires any secrets, add the vars to the example.secrects.toml but do not enter the values.
  • Add your example code, make sure you have a if __name__ = "__main__" clause in which you run the example script, this will be used for testing
  • You should add one or two assertions after running your example

Testing

  • You can test your example simply by running your example script from your example folder. On CI a test will be automatically generated.

Checking your generated markdown

The command npm start starts a local development server and opens up a browser window.

  • To install npm read README.
  • You should your example be automatically added to the examples section in the local version of the docs. Check the rendered output and see wether it looks the way you intended.

Add ENV variables

If you use any secrets for the code snippets, e.g. Zendesk requires credentials. Please talk to us. We will add them to our google secrets vault.

Add dependencies

If your example requires any additional dependency, then you can add it

  • To pyproject.toml in the [dependency-groups] section in the docs group.
  • Do not forget to update your uv.lock file with uv sync command and commit.