Skip to content

SCENE template installer - #1

Merged
C-Achard merged 11 commits into
mainfrom
cy/scene-cookiecutter
Nov 4, 2026
Merged

C-Achard merged 11 commits into
mainfrom
cy/scene-cookiecutter

Conversation

@C-Achard

@C-Achard C-Achard commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Adds scene-repo-template new, which generates a project (packaging, pre-commit, CI, Jupyter Book docs) from a template, with end-to-end tests.

@C-Achard C-Achard self-assigned this Nov 3, 2026
@C-Achard
C-Achard requested a balanced review from Copilot November 3, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Package-name validation permits names whose generated source is ignored by Git, causing pushed projects to fail installation in CI.

4 open issues
What changed in this PR

Adds scene-repo-template new to generate standalone SCENE projects while keeping the guidelines and contributed examples in this repository.

Changes:

  • Adds interactive and non-interactive project generation, input validation, and dry-run support.
  • Packages a reusable skeleton with Python packaging, pre-commit hooks, CI, and branded Jupyter Book documentation.
  • Updates setup guidance and adds generator tests, including CI-enabled end-to-end checks.
File Description
uv.lock Updates package identity and locks the prompt dependency.
TODO.md Revises remaining generator and repository work.
tests/​test_version.py Checks the renamed package’s version.
tests/​test_cli.py Tests generation, validation, and end-to-end setup.
src/​scene_repo_template/​version.py Defines the installer version.
src/​scene_repo_template/​skeleton/​jupyter-book/​dot-github/​workflows/​docs.yml Provides documentation build and deployment CI.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​myst.yml.tmpl Templates Jupyter Book configuration.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​index.md.tmpl Provides a personalized documentation landing page.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​images/​scene-logo.png Supplies the shared SCENE logo.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​images/​favicon.png Supplies the documentation favicon.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​_static/​scene.css Supplies the shared documentation theme.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​_static/​scene-palette.json Records the theme’s color palette.
src/​scene_repo_template/​skeleton/​jupyter-book/​docs/​_static/​footer.md Supplies the branded documentation footer.
src/​scene_repo_template/​skeleton/​common/​tests/​test_version.py.tmpl Templates the starter version test.
src/​scene_repo_template/​skeleton/​common/​README.md.tmpl Templates development and documentation instructions.
src/​scene_repo_template/​skeleton/​common/​pyproject.toml.tmpl Templates package metadata and tooling configuration.
src/​scene_repo_template/​skeleton/​common/​LICENSE Supplies the default Apache-2.0 license.
src/​scene_repo_template/​skeleton/​common/​dot-pre-commit-config.yaml Provides formatting and validation hooks.
src/​scene_repo_template/​skeleton/​common/​dot-gitignore Provides generated-project ignore rules.
src/​scene_repo_template/​skeleton/​common/​dot-github/​workflows/​tests.yml Provides cross-platform test CI.
src/​scene_repo_template/​skeleton/​common/​dot-github/​workflows/​lint.yml Provides lockfile and lint checks.
src/​scene_repo_template/​skeleton/​common/​__package__/​version.py Sets the starter package version.
src/​scene_repo_template/​skeleton/​common/​__package__/​__init__.py Exports the starter package version.
src/​scene_repo_template/​cli.py Implements prompts, validation, rendering, and dry runs.
src/​scene_repo_template/​__init__.py Exports the installer package version.
README.md Introduces the generator alongside the guidelines.
pyproject.toml Configures the installer, entry point, and skeleton data.
placeholder/​__init__.py Removes the old placeholder package initializer.
docs/​myst.yml References shared skeleton branding assets.
docs/​index.md References the shared logo location.
docs/​guides/​using-the-template.md Documents generator-based project setup.
.gitignore Corrects a comment typo.
.github/​workflows/​tests.yml Adds Node.js and enables end-to-end tests.

Review effort: Balanced

Comment thread src/scene_repo_template/cli.py Resolved
Comment thread src/scene_repo_template/cli.py Resolved
Comment thread src/scene_repo_template/cli.py Resolved
@C-Achard
C-Achard requested a balanced review from Copilot November 3, 2026 17:09
@C-Achard
C-Achard added this pull request to stack #4 November 3, 2026 17:12
@C-Achard
C-Achard force-pushed the cy/scene-cookiecutter branch from dae5133 to 44b72a7 Compare November 3, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Validation accepts malformed GitHub URLs and project or package names that conflict with toolchain dependencies, producing projects with invalid YAML or broken installation and test setups.

No open issues 🎉

3 previously missed issues

In code that hasn't changed since last review

Medium severity Reject tool dependency names in generated extras

src/​scene_repo_template/​cli.py:68

new pytest --yes is accepted, but the generated dev extra then depends on the project itself instead of the real pytest distribution, breaking the documented installation/test setup. The same collision affects pre-commit, pytest-cov, and jupyter-book in their respective extras. Reject these distribution names using normalized comparison, including variants such as Pre_Commit.

Medium severity Reject package names that shadow toolchain imports

src/​scene_repo_template/​cli.py:82

--package=pluggy is accepted, but running python -m pytest from the generated project imports its root-level stub instead of pytest's required pluggy dependency, which lacks PluginManager. Reject import names required by the generated toolchain, including transitive dependencies, so accepted names produce usable projects.

Medium severity Reject GitHub URLs without a hostname

src/​scene_repo_template/​cli.py:96

--github=https:// passes this validation, but URL normalization later reduces it to https:. The generated MyST configuration then contains github: https:, which is invalid YAML, so generation reports success but the documentation cannot build. Validate that the URL has a hostname before writing the project.

4 resolved since last review

Review effort: Balanced

@C-Achard
C-Achard requested a review from deruyter92 November 3, 2026 17:19

@deruyter92 deruyter92 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor suggestions. It works very well!

Some general comments about the License

  • It is now fixed to Apache 2.0. Should we add a --license option? To make it easy to change.
  • The guide only names pyproject.toml and LICENSE, but also docs/myst.yml and readme need to be updated.
  • The copyright owner and year are still blank. Since the author and year are know should we add those by default ?

And unrelated to the current PR, but as you know I am really a fan of making mkdocs the default instead of jupyterbook. It has the ability to do auto api docs and works well with notebooks too.

Comment thread src/scene_repo_template/cli.py Resolved
Comment thread src/scene_repo_template/cli.py Resolved
Comment thread src/scene_repo_template/cli.py Resolved
Comment thread src/scene_repo_template/cli.py Resolved
@C-Achard

C-Achard commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Making a separate PR for the license part

- Added __init__.py and version.py for package versioning.
- Implemented CLI in cli.py for creating new SCENE projects.
- Included skeleton files for common project structure, including LICENSE, README, and pyproject.toml templates.
- Set up GitHub Actions workflows for linting and testing.
- Created Jupyter Book documentation structure with templates.
- Updated tests to reflect new package name and structure.
- Added questionary dependency for interactive CLI prompts.
- Clarify license synchronization steps in documentation.
- Improve error handling and user prompts in CLI for better interactivity.
- Update output messages to include direct links to the template guide.
- Add tests for interactive CLI behavior and validation of user inputs.
@C-Achard
C-Achard force-pushed the cy/scene-cookiecutter branch from a4a7341 to 9699780 Compare November 4, 2026 10:18
@C-Achard
C-Achard merged commit 3b6df2c into main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants