Git Product home page Git Product logo

template-python's Introduction

This is a template Python repository to start a fresh project with a default setup.

Tests Quality Checked with mypy Code style: black pdm-managed pre-commit License: MIT

The project setup includes:

  • Python >= 3.10
  • Ubuntu, MacOS, Windows latest OS versions
  • PDM for dependency management
  • GitHub Actions and pre-commit for linting, formatting, CI/CD
    • Black for code formatting
    • Mypy for static type checking
    • Pytest for testing
  • MIT license
  • The above badges of this README.md

Getting Started

  1. Install Python 3.10 in your local machine. For MacOS use
brew install [email protected]
  1. Click on the Use this template button at this page to create a new repository from this template (you must be logged in to GitHub to see the button).
  2. Name your repository and click Create repository from template. If the repository name is more than one word, make sure to use -hyphens- instead of spaces or underscores.
  3. Git clone the repository to your local machine.
  4. Cd into the repository directory.
  5. Run template_setup.py with
python3 template_setup.py [--user-name YOUR_GIT_USER_NAME] [--user-email YOUR_GIT_USER_EMAIL]
  1. Follow the instructions in the terminal.
    • Select y to make project installable when prompted by PDM

Running the setup script will:

  • Rename file contents, names, and directories that contains template repository name with the new repository name
  • Rename user name and user email in and README_main.md
  • Configure GitHub user name and user email locally
  • Remove pdm.lock, pyproject.toml, and requirements.txt
  • Remove README.md and rename README_main.md to README.md
  • If not installed pip install PDM in your local machine
  • Update PDM to the latest version
  • PDM init with Python 3.10
  • Install dependencies with PDM
  • Install pre-commit hooks to local .git folder
  • Remove template_setup.py
  • Prompt user an option to git add commit and push
  • Remove .mypy_cache and .pytest_cache folders

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.