Coder Social home page Coder Social logo

pyproject-cookiecutter's Introduction

Python project template for cookiecutter

PythonSupported Dependencies Status

Code style: black Pre-commit Bandit

Features

How to start

cookiecutter gh:KaiL4eK/pyproject-cookiecutter
  • Answer some questions and get ready to code!

Notes

Cookiecutter is not working properly (errors during project creation)

Check that you've installed version for python3. You can call python3 -m cookiecutter gh:KaiL4eK/pyproject-cookiecutter to ensure that it is called with required python version.

[Windows] warning: LF will be replaced by CRLF in ...

Check this answer. In short, setup git config core.autocrlf false to disable line-ending check. Or you can setup as you wish.

How to improve project MORE

[Linux] Use safety as pre-commit hook to check for security

  - repo: https://github.com/Lucas-C/pre-commit-hooks-safety
    rev: v1.3.0
    hooks:
      - id: python-safety-dependencies-check

This hook sometimes breaks on Windows, be careful!

Use bandit as pre-commit hook to check for security

  - repo: https://github.com/PyCQA/bandit
    rev: 1.7.0
    hooks:
      - id: bandit
        exclude: ^tests/
        args:
          - -s
          - B311

Use black or other formatter as pre-commit hook or just setup in your IDE/Development Environment

  - repo: local
      # Requires to be installed in venv
      - id: black
        name: black
        entry: poetry run black --config pyproject.toml
        types: [python]
        language: system
# For pyptoject.toml

[tool.black]
# https://github.com/psf/black
target-version = ["py38"]
line-length = 100
color = true

exclude = '''
/(
    \.git
    | \.hg
    | \.mypy_cache
    | \.tox
    | \.venv
    | _build
    | buck-out
    | build
    | dist
    | env
    | venv
)/
'''

Use other ways to update code via formatters just if you know what they do

  - repo: https://github.com/asottile/pyupgrade
    rev: v2.31.0
    hooks:
      - id: pyupgrade
        args:
          - --py3-plus

  - repo: https://github.com/humitos/mirrors-autoflake
    rev: v1.3
    hooks:
      - id: autoflake
        args:
          [
            "--in-place",
            "--remove-all-unused-imports",
            "--remove-unused-variable",
            "--remove-duplicate-keys",
          ]

Thanks to

pyproject-cookiecutter's People

Contributors

serykhelena avatar alexdevedu avatar kail4ek 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.