-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: optimised the pyproject.toml for mock-site * chore: optimised the pyproject.toml for consent-api
- Loading branch information
Showing
7 changed files
with
1,039 additions
and
5,642 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,29 @@ | ||
[tool.poetry] | ||
name = "consent-api" | ||
version = "0.1.0" | ||
description = "Single Consent is a service that streamlines user cookie preferences across multiple websites by generating a unique ID for each user's consent choice, centrally storing it, and ensuring subsequent websites respect those preferences." | ||
description = "Consent API extracted from monolith" | ||
authors = ["Your Name <you@example.com>"] | ||
license = "MIT License - Copyright (c) 2023 Government Digital Service - See ./LICENSE" | ||
license = "MIT License" | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
aiosqlite = "0.19.0" | ||
alembic = "1.12.0" | ||
asyncpg = "0.28.0" | ||
alembic = "1.12.0" | ||
essentials = "1.1.5" | ||
fastapi-etag = "0.4.0" | ||
gunicorn = "21.2.0" | ||
httpx = "0.25.0" | ||
locust = "^2.17.0" | ||
pytest = "7.4.2" | ||
pytest-asyncio = "0.21.1" | ||
pytest-cov = "4.1.0" | ||
pytest-splinter4 = "0.3.0" | ||
pytest-xdist = "3.3.1" | ||
python-dotenv = "1.0.0" | ||
selenium = "4.9.1" | ||
wtforms = "3.1.0" | ||
uvicorn = {version = "^0.23.2", extras = ["standard"]} | ||
starlette = "^0.41.3" | ||
pydantic = "^2.10.3" | ||
fastapi = { version = "^0.115.6", extras = ["standard"] } | ||
uvicorn = { version = "^0.23.2", extras = ["standard"] } | ||
pydantic = "^2.10.3" | ||
pydantic-settings = "^2.0.3" | ||
sqlmodel = "^0.0.22" | ||
python-multipart = "^0.0.19" | ||
fastapi = {extras = ["standard"], version = "^0.115.6"} | ||
govuk-frontend-jinja = "^3.4.0" | ||
pretty-errors = "^1.2.25" | ||
requests = "^2.32.3" | ||
|
||
|
||
[tool.poetry.group.infra.dependencies] | ||
pulumi = ">=3.0.0,<4.0.0" | ||
pulumi-gcp = ">=6.0.0,<7.0.0" | ||
ruamel-yaml = "0.17.21" | ||
google-cloud-run = "^0.10.0" | ||
|
||
gunicorn = "^23.0.0" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
ipython = "8.10.0" | ||
pre-commit = "^3.5.0" | ||
|
||
|
||
[tool.poetry.group.ci.dependencies] | ||
aiosqlite = "0.19.0" | ||
black = "22.12.0" | ||
flake8 = "6.0.0" | ||
flake8-bugbear = "22.10.27" | ||
flake8-docstrings = "1.6.0" | ||
isort = "5.11.4" | ||
mypy = "0.991" | ||
pep8-naming = "0.13.2" | ||
types-sqlalchemy = "1.4.53.17" | ||
pytest = "7.4.2" | ||
pytest-cov = "4.1.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
|
||
[tool.black] | ||
extend-exclude = "^/migrations/" | ||
|
||
[tool.ruff] | ||
extend-exclude = ["migrations"] | ||
extend-ignore = ["E203"] | ||
ignore-init-module-imports = true | ||
select = ["E", "F", "I", "B", "C4", "SIM", "N", "FLY", "UP"] | ||
|
||
[tool.ruff.flake8-bugbear] | ||
extend-immutable-calls = ["fastapi.Depends", "fastapi.Form"] | ||
|
||
[tool.ruff.isort] | ||
force-single-line = true | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import os | ||
import sys | ||
|
||
def get_tree_structure_and_contents(root_dir, extensions): | ||
structure = [] | ||
file_contents = [] | ||
|
||
# Helper function to recursively build the tree and gather file contents | ||
def build_tree_and_collect_contents(path, prefix=""): | ||
entries = sorted(os.listdir(path)) | ||
has_valid_files = False | ||
sub_structure = [] | ||
|
||
for i, entry in enumerate(entries): | ||
full_path = os.path.join(path, entry) | ||
is_last = (i == len(entries) - 1) | ||
|
||
if os.path.isdir(full_path): | ||
# Recursively process subdirectories | ||
result = build_tree_and_collect_contents(full_path, prefix + ("│ " if not is_last else " ")) | ||
if result: | ||
sub_structure.append(f"{prefix}{'└── ' if is_last else '├── '}{entry}/") | ||
sub_structure.extend(result) | ||
has_valid_files = True | ||
elif any(entry.endswith(ext) for ext in extensions): | ||
# Add file to the tree structure | ||
sub_structure.append(f"{prefix}{'└── ' if is_last else '├── '}{entry}") | ||
has_valid_files = True | ||
|
||
# Collect the content of the file | ||
try: | ||
with open(full_path, 'r', encoding='utf-8') as f: | ||
content = f.read() | ||
file_contents.append(f"===== {entry} =====\n{content}\n") | ||
except Exception as e: | ||
file_contents.append(f"===== {entry} =====\nError reading file: {e}\n") | ||
|
||
return sub_structure if has_valid_files else None | ||
|
||
# Start building the tree and collecting contents from the root directory | ||
root_tree = build_tree_and_collect_contents(root_dir) | ||
if root_tree: | ||
structure.append(f"{root_dir}/") | ||
structure.extend(root_tree) | ||
|
||
return structure, file_contents | ||
|
||
def main(): | ||
if len(sys.argv) < 2: | ||
print("Usage: python script.py <extension1> <extension2> ...") | ||
sys.exit(1) | ||
|
||
# Collect the file extensions to filter by | ||
extensions = [f".{ext.lstrip('.')}" for ext in sys.argv[1:]] | ||
|
||
# Get tree structure and file contents for the current directory | ||
root_dir = os.getcwd() | ||
structure, file_contents = get_tree_structure_and_contents(root_dir, extensions) | ||
|
||
# Write to output file | ||
with open("structure.txt", "w", encoding='utf-8') as file: | ||
if structure: | ||
file.write("\n".join(structure) + "\n\n") | ||
else: | ||
file.write("No files found with specified extensions.\n\n") | ||
|
||
# Append file contents | ||
file.write("\n".join(file_contents)) | ||
|
||
print("Directory structure and file contents written to structure.txt") | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.