Skip to content

🌱 Substrate is a modern Copier template for scaffolding Python packages and apps

License

Notifications You must be signed in to change notification settings

superlinear-ai/substrate

Repository files navigation

Open in Dev Containers Open in GitHub Codespaces Copier

🌱 Substrate

A modern Copier template for scaffolding Python packages and apps.

🎁 Features

✨ Using

Tip

You should first install uv to be able to run the commands below.

Create a new Python project

To create a new Python project with this template, run:

uvx copier copy gh:superlinear-ai/substrate path/to/local/repository

Update your Python project

To update your Python project to the latest template version, run:

uvx copier update

Release a new version of your Python project

If you have enabled Conventional Commits, you can create a new version tag and update CHANGELOG.md based on your commit messages with:

git checkout main
cz bump
git push origin main --tags

πŸͺ Migrating from Cookiecutter

Important

This project was formerly known as Poetry Cookiecutter and was based on Poetry and Cookiecutter. We will continue to support the original Cookiecutter-based template side by side with the new Copier-based template. However, we do encourage users to upgrade to the new Copier-based template by following the instructions below.

To migrate a project from Cookiecutter to Copier, follow these steps:

  1. In your project repository, run:

    # Create a new branch
    git checkout -b rescaffold
    
    # Remove files specific to Poetry
    rm -f poetry.lock
    
    # Rescaffold the project without changing src/ and tests/
    uvx copier copy --overwrite --exclude src/ --exclude tests/ gh:superlinear-ai/substrate .
  2. Review the changes to pyproject.toml and reinsert your project's dependencies.

  3. Review the changes to README.md and reinsert your project's documentation.

  4. Commit and push all changes with:

    # Stage all changes
    git add .
    
    # Commit the staged changes
    git commit -m "build: upgrade scaffolding"
    
    # Push the committed changes
    git push origin rescaffold
  5. Create a PR from your branch, review it, and merge it!