Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
Last active November 3, 2022 11:32
Show Gist options
  • Save panicoenlaxbox/cae8c72260db38ecd82f9f830fff985b to your computer and use it in GitHub Desktop.
Save panicoenlaxbox/cae8c72260db38ecd82f9f830fff985b to your computer and use it in GitHub Desktop.
Minimum steps to follow to be able to have fun with Python
$directory = "PythonApp1"
$app = "python_app1"
mkdir $directory
cd $directory
pipenv install --dev mypy pytest black isort flake8 assertpy pre-commit
mkdir src & mkdir src\$app & mkdir tests
echo "[tool.black]`
line-length = 120`
target-version = ['py310']` # https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html?highlight=target-version#command-line-options
`
[tool.isort]`
multi_line_output = 3`
include_trailing_comma = true`
force_grid_wrap = 0`
use_parentheses = true`
ensure_newline_before_comments = true`
line_length = 120`
`
[tool.mypy]`
show_error_codes = true`
pretty = true`
show_error_context = true`
show_column_numbers = true`
warn_unused_ignores = true`
`
[[tool.mypy.overrides]]`
module = ""assertpy""`
ignore_missing_imports = true`
[tool.pytest.ini_options]`
pythonpath = ""src/""" > pyproject.toml
echo "[flake8]`
max-line-length = 120" > .flake8
echo "fail_fast: true`
repos:`
- repo: https://github.com/PyCQA/isort`
rev: 5.10.1`
hooks:`
- id: isort`
verbose: true`
- repo: https://github.com/psf/black`
rev: 22.10.0`
hooks:`
- id: black`
verbose: true`
- repo: https://gitlab.com/PyCQA/flake8`
rev: 3.9.2`
hooks:`
- id: flake8`
verbose: true`
- repo: https://github.com/pre-commit/mirrors-mypy`
rev: v0.982`
hooks:`
- id: mypy`
verbose: true" > .pre-commit-config.yaml
Invoke-RestMethod -Method Get -Uri "https://www.toptal.com/developers/gitignore/api/python,pycharm,visualstudiocode" | Out-File .gitignore
git init
pipenv shell
# Maybe you have to execute next commands by yourself
pre-commit install
pre-commit autoupdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment