/ Docs
7.5
/

Contributing

DipDup is a free and open-source software licensed under the MIT License. The source code is available on GitHub.

Contributor Guide

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

General

  • All code in this repository MUST be licensed under the MIT License.
  • Python code in this repository MUST run on Python 3.11. Using modern language features is encouraged.
  • Python code in this repository MUST run in Linux, macOS, Docker, and environments on amd64 and arm64 architectures.
  • We use the PDM package manager to set up the development environment. You SHOULD install it and run pdm run -l to see available shortcuts.
  • Have fun!

Git workflow

  • Branch names MUST follow prefix/short-description format. Prefixes currently in use: feat for features, fix for bugfixes, docs for documentation, exp for experiments, ci for GHA and Docker stuff, aux for everything else.
  • Commits in pull requests MUST be squashed when merging to next.
  • Issues and pull requests MUST have a descriptive title; they SHOULD be linked to each other, appropriately labeled, and assigned to maintainers while in progress.

Codestyle

We use several tools to enforce codestyle and code quality: black for autoformatting, ruff for linting, and mypy for typechecking. All checks MUST pass before merging the code to the default branch. Everything not enforced by these tools is up to the developer. But here are some recommendations:

  • Consistency is the key. If you see a pattern in the codebase, follow it.
  • Use NOTE, TODO, and FIXME prefixes for meaningful comments. They help a lot to navigate the codebase.
  • Lazy imports are important to keep startup time low for tiny commands. We also do it for project imports, so not a big deal.
  • Some methods and attributes are made private to avoid polluting the public API. Feel free to access them from the outside if you know what you are doing.
  • Finally, about exact language features. f-string formatting is preferred over other syntax. Be careful with the walrus operator. Don't forget else in conditional expressions. Listen to your mom. We have no consensus about the match-case yet.

Changelog

  • All changes that affect user (developer) experience MUST be documented in the CHANGELOG.md file.
  • Changes that significantly affect DipDup maintainers' experience MAY be documented in the CHANGELOG.md file.
  • The changelog MUST conform to the "Keep a Changelog" specification (CI will break otherwise). Group order we use: Added, Fixed, Changed, Deprecated, Removed, Performance, Security, Other.
  • Lines describing changes MUST be sorted and begin with the component name (usually Python module name).

Documentation

  • A page in "Release notes" section MUST accompany all major releases. Minor releases SHOULD be documented as well. Avoid includes in Release notes pages as they are not intended to change over time.

Maintainer Guide

Dependencies

  • All dependencies MUST be declared in pyproject.toml file and pinned to non-breaking versions (e.g. ~1.2).

Security

  • GitHub Dependabot alerts about vulnerable dependencies MUST be investigated and resolved as soon as possible.
  • Security-related bugfixes MUST be mentioned in the changelog under the "Security" section.

Privacy

  • DipDup MUST NOT collect any data from users.
  • DipDup SHOULD NOT perform network requests to APIs not defined in config as datasources. Current exceptions: version check with GitHub.

Docker images

  • DipDup dockerfiles use autogenerated requirements.txt files. Maintainers MUST run pdm run update script on every change in dependencies.
  • Docker images for stable releases MUST be published on Docker Hub and GitHub Container Registry.
  • Maintainers MAY publish arbitrary images on GHCR and remove them when not needed.

Installer

  • Installer module MUST depend on Python stdlib only.

Scaffolding

  • Project templates SHOULD cover all index types available in DipDup.
  • They also MAY contain additional features and integrations.

Demo projects

  • Demos are stored in src directory. They MUST be generated automatically from project templates using replay files.
  • Maintainers SHOULD run pdm demos command regularly to ensure that demo projects are up to date.

Releases

  • Release versions MUST conform to Semantic Versioning. Releases that introduce breaking changes MUST be major ones.
  • Only the latest major version is supported in general. Important fixes SHOULD be backported to the previous major release (currently, 6.5)

Releasing a new version currently requires some manual actions:

  • Ensure that all GH issues and PRs are closed and linked to the milestone.
  • Checkout to aux/X.Y.Z branch from next (or master for 6.5). Update DipDup version in pyproject.toml.
  • Run make before_release to lock dependencies, dump requirements.txt files, generate demo projects etc.
  • Commit and push all changes with msg like Bump version X.Y.Z. Open a PR, and link it to the milestone.
  • Now you may want to switch Docker images of demos we host to aux-X.Y.Z tag as a smoke test.
  • Merge the PR, then git tag X.Y.Z && git push origin X.Y.Z. Wait for release.yml and docs.yml pipelines to finish.

6.5 branch

  • DipDup 6.5 is supported until March 2024. Maintainers MUST backport bugfixes from the main branch until then. All Tezos and TzKT-related code was synced with next, so it should be a relatively easy task.
  • 6.5 docs and installer are hosted on GH Pages at docs.dipdup.io.

MIT License

MIT License

Copyright (c) 2021 Baking Bad

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker