-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Establish Python project template used throughout repos. #5
Comments
I believe a lot of inspiration can be taken from this blog post. Not only do they have a nice python-project template, but also they are able to perform bulk actions on already created repositories |
|
.pre-commit-config.yamlI would propose using the following configuration: ---
ci:
autoupdat_schedule: quarterly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: ^.*data/
- id: trailing-whitespace
exclude: miscellaneous/structures/SiO2.xyz
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black, --filter-files]
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--count, --show-source, --statistics]
additional_dependencies:
- flake8-bugbear
- flake8-builtins
- flake8-comprehensions
- flake8-debugger
- flake8-logging-format
- pep8-naming
- pyflakes
- tryceratops
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies:
- types-click-spinner
- types-requests
- types-tabulate
- types-toml
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt if the repo contains notebooks, it makes sense to add the following - repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
args: [--py38-plus]
- id: nbqa-isort
args: [--profile=black]
- id: nbqa-black if the repo contains - repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
hooks:
- id: setup-cfg-fmt |
Flake8 configuration file.It would be great, of course, to make the config below a part of the
|
There is also black for notebooks. Here is a nice way to configure it: |
Currently, there are multiple ways a Python project can be organized.
Here are the choices
Currently, I am working on a Python cookie-cutter repository to establish those. The issue is to be closed when all choices are made and the template repository reflects them.
The cookie-cutter repository will be largely based on https://github.com/woltapp/wolt-python-package-cookiecutter. I will also create an accompanying template similar to https://github.com/simonw/python-lib-template-repository. The idea is that the latter takes the cookie-cutter one, fills in the values and annihilates himself (see this file for the details).
The text was updated successfully, but these errors were encountered: