FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make `pn init <name>` create the project directory · Issue #21 · pythonnative/pythonnative · GitHub

Repository navigation

Make pn init <name> create the project directory #21

Description

What

pn init my_app currently scaffolds into the current directory and only uses my_app as the project name in pythonnative.toml. Most scaffolding tools (npx create-react-app my_app, cargo new my_app, django-admin startproject my_app) create a new my_app/ directory, and our own docs read that way too, so newcomers are surprised when pn init my_app fills their working directory instead.

Proposed behavior

  • pn init (no name): scaffold into the current directory, named after it (current behavior).
  • pn init my_app: create ./my_app/, scaffold into it, and refuse to proceed if the directory already exists and isn't empty (unless --force is passed).
  • Update the final hint output so the next steps include cd my_app.

Where to look

  • src/pythonnative/cli/pn.py: init_project() (around line 105) does the scaffolding; _build_parser() (around line 868) defines the name and --force arguments.
  • tests/test_cli.py has existing CLI tests to extend.
  • Grep the docs for pn init and update any walkthroughs that assume the old behavior.

Acceptance criteria

  • pn init my_app creates and populates my_app/ with app/main.py, pythonnative.toml, and .gitignore.
  • Existing no-name behavior is unchanged.
  • Tests cover both forms plus the "directory already exists" refusal.
  • ./scripts/check.sh passes.

Notes for contributors

See CONTRIBUTING.md for setup. Suggested PR title: feat(cli): create project directory in pn init <name>.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL