Skip to content
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

Copy common config files from utils in freeze step #4194

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ var/
.installed.cfg
*.egg
/cache
pyproject.toml
.pre-commit-config.yaml

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is automatically copied from notifications-utils@84.0.0

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.3.7'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: black
name: black (python)
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ PYTHON_EXECUTABLE_PREFIX := $(shell test -d "$${VIRTUALENV_ROOT}" && echo "$${VI

.PHONY: bootstrap
bootstrap: generate-version-file ## Set up everything to run the app
pip3 install -r requirements.txt
python -c "from notifications_utils.version_tools import copy_config; copy_config()"
pip3 install -r requirements_for_test.txt
createdb notification_api || true
(. environment.sh && flask db upgrade) || true
Expand Down Expand Up @@ -103,6 +101,7 @@ watch-tests: ## Watch tests and run on change
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt
pip install --upgrade pip-tools
pip-compile requirements.in
python -c "from notifications_utils.version_tools import copy_config; copy_config()"

.PHONY: bump-utils
bump-utils: # Bump notifications-utils package to latest version
Expand Down
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is automatically copied from notifications-utils@84.0.0

[tool.black]
line-length = 120

[tool.ruff]
line-length = 120

target-version = "py311"

lint.select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe cyclomatic complexity
"G", # flake8-logging-format
"T20", # flake8-print
"UP", # pyupgrade
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"RSE", # flake8-raise
"PIE", # flake8-pie
]
lint.ignore = []
exclude = [
"migrations/versions/",
"venv*",
"__pycache__",
"node_modules",
"cache",
"migrations",
"build",
"sample_cap_xml_documents.py",
]