Git Product home page Git Product logo

python_project_template's Introduction

Python project template files

Template files for bootstrapping a new Python project.

Purpose

Bootstrapping a new Python project requires some steps to take and files to create. This project is a set of basic configuration and environments files that are usually needed by every Python project. Default Python version for this project chosen - 3.8.

Directory structure

The project consists of <project_name> (replace with your project name), and tests folder. Separating these two folders allows deploying files only from <project_name> folder, leaving the test folder only for testing purposes.

Tools used in this project

We use the following tools for purposes of testing, styling, and type checking. Many of them find their configuration in project root's setup.cfg.

  • pytest
    • Widely used package for testing and style-checking in Python
    • Install: pip install pytest
    • Run: pytest . from project root
  • flake8
    • Checks code style against PEP8 and tons of other stuff (e.g. blank lines, unused imports, max line length, cyclomatic complexity, ...)
    • Install: pip install pytest-flake8
    • Run: pytest . --flake8 from project root
  • black
    • Automatic code formatter
    • Install: pip install black
    • Run: black . from project root
  • pydocstyle
    • Checks style of docstrings
    • Install: pip install pytest-pydocstyle
    • Run: pytest . --pydocstyle from project root
  • tox
    • Ad-hoc virtual environment to test code with fresh Python runtime, helps with testing if setup.py includes everything it needs to
    • Install: pip install tox
    • Run: tox from project root
  • mypy
    • (Very non-perfect) type checking for Python
    • Install: pip install mypy
    • Run: mypy . --ignore-missing-imports from project root

How to bootstrap a new Python project

Copy contents of the project directory, then:

  1. Rename README.md.template file to README.md so that you have a template readme file. Edit this file accordingly.
  2. Change folder name "project_name" according to your project name
  3. Update setup.cfg and setup.py files, replace <your_project_name> with your project name, and edit corresponding fields according to your needs.

python_project_template's People

Contributors

bsdelnik avatar

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.