-
Notifications
You must be signed in to change notification settings - Fork 36
feat: check for __all__ presence in __init__.py files #766
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
base: main
Are you sure you want to change the base?
Changes from all commits
2f0ac9b
e4da761
66993a9
e1f4dcb
2c84b47
8e670c8
bd06203
cbdab61
2791005
6a49bdf
ba7f3c7
cb5be6f
aa051de
409e514
15d4287
e6c8984
86d152a
1e9379e
ed11d95
4c66dae
e1935d0
4dd2148
e2de73b
cf2d408
53b4db6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,7 @@ jobs: | |
| docker image ls -a | ||
| - name: Start demo | ||
| run: | | ||
| git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts | ||
| git clone -b "diracx-issue-426-__all__-in-__init__" https://github.com/AcquaDiGiorgio/diracx-charts.git ../diracx-charts | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
|
|
||
| declare -a demo_args=() | ||
| demo_args+=("--enable-open-telemetry") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ default_language_version: | |
| python: python3 | ||
|
|
||
| ci: | ||
| skip: [generate-pixi-docs, settings-doc-check] | ||
| skip: [generate-pixi-docs, settings-doc-check, check-init-files] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to ignore that check in the CI. |
||
|
|
||
| default_stages: [pre-commit] | ||
|
|
||
|
|
@@ -90,7 +90,7 @@ repos: | |
| hooks: | ||
| - id: generate-pixi-docs | ||
| name: Generate pixi tasks documentation | ||
| entry: pixi run -e default python .github/workflows/generate_pixi_tasks_doc.py | ||
| entry: pixi run -e default python scripts/generate_pixi_tasks_doc.py | ||
| language: system | ||
| pass_filenames: false | ||
| files: ^pixi\.toml$|^pixi\.lock$ # only run if pixi files change | ||
|
|
@@ -103,3 +103,12 @@ repos: | |
| language: system | ||
| pass_filenames: false | ||
| files: ^(diracx-.*/src/diracx/.*/settings\.py|diracx-routers/src/diracx/routers/otel\.py|docs/.*\.j2|docs/templates/.*\.jinja|scripts/generate_settings_docs\.py)$ | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: check-init-files | ||
| name: Check __all__ dunder in __init__.py files | ||
| language: system | ||
| entry: pixi run -e default python scripts/check_init_files_precommit_hook.py | ||
| files: ^(diracx-|extensions/gubbins/gubbins-).*__init__\.py$ | ||
| exclude: _generated | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = ("jobs",) | ||
|
|
||
| from . import jobs | ||
| __all__ = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = ("app",) | ||
| __all__ = ["app"] | ||
|
|
||
| import asyncio | ||
| import json | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = ["app"] | ||
|
|
||
| from . import legacy | ||
| from .config import app | ||
|
|
||
| __all__ = ("app",) | ||
|
|
||
| app.add_typer(legacy.app, name="legacy") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,3 @@ | ||
| from __future__ import absolute_import | ||
|
|
||
| __all__ = [ | ||
| "aio", | ||
| "models", | ||
| "sync", | ||
| ] | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| from . import aio | ||
| from . import models | ||
| from . import sync | ||
| __all__ = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert the changes here please?