Skip to content

Commit

Permalink
Improve ruff config and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
polyaxon-ci committed Jan 5, 2025
1 parent 5eb1a36 commit af5865d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions haupt/haupt/common/settings/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def set_celery(

context[
"CELERY_WORKER_PREFETCH_MULTIPLIER"
] = config.celery_worker_prefetch_multiplier
] = config.celery_worker_prefetch_multiplier # fmt: skip

context["CELERY_TASK_ALWAYS_EAGER"] = config.celery_task_always_eager
if config.celery_task_always_eager:
Expand All @@ -42,19 +42,19 @@ def set_celery(
context["CELERY_HARD_TIME_LIMIT_DELAY"] = config.celery_hard_time_limit_delay
context[
"CELERY_WORKER_MAX_TASKS_PER_CHILD"
] = config.celery_worker_max_tasks_per_child
] = config.celery_worker_max_tasks_per_child # fmt: skip
context[
"CELERY_WORKER_MAX_MEMORY_PER_CHILD"
] = config.celery_worker_max_memory_per_child
] = config.celery_worker_max_memory_per_child # fmt: skip
context["CELERY_TASK_ROUTES"] = routes
if schedules:
context["CELERY_BEAT_SCHEDULE"] = schedules

context[
"CLEANING_INTERVALS_ACTIVITY_LOGS"
] = config.cleaning_intervals_activity_logs
] = config.cleaning_intervals_activity_logs # fmt: skip
context[
"CLEANING_INTERVALS_NOTIFICATIONS"
] = config.cleaning_intervals_notifications
] = config.cleaning_intervals_notifications # fmt: skip
context["CLEANING_INTERVALS_ARCHIVES"] = config.cleaning_intervals_archives
context["CLEANING_INTERVALS_DELETION"] = config.cleaning_intervals_deletion
2 changes: 1 addition & 1 deletion haupt/haupt/common/settings/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def set_core(context, config: PlatformConfig, use_db: bool = True):
context["FILE_UPLOAD_PERMISSIONS"] = RW_R_R_PERMISSIONS
context[
"MIN_ARTIFACTS_DELETION_TIMEDELTA"
] = config.min_artifacts_deletion_timedelta
] = config.min_artifacts_deletion_timedelta # fmt: skip
context["TTL_HEARTBEAT"] = config.ttl_heartbeat

context["WSGI_APPLICATION"] = "{}.wsgi.application".format(config.config_module)
Expand Down
2 changes: 1 addition & 1 deletion haupt/haupt/common/test_clients/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def do_request(
path,
data=None,
content_type=CONTENT_TYPE_APPLICATION_JSON,
**extra
**extra,
):
if data is None:
data = {}
Expand Down
6 changes: 3 additions & 3 deletions haupt/haupt/orchestration/scheduler/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@ def _persist_meta_info(self):
if self.run.is_matrix and self.compiled_operation.matrix.concurrency:
self.run.meta_info[
META_CONCURRENCY
] = self.compiled_operation.matrix.concurrency
] = self.compiled_operation.matrix.concurrency # fmt: skip
elif self.run.is_dag and self.compiled_operation.run.concurrency:
self.run.meta_info[
META_CONCURRENCY
] = self.compiled_operation.run.concurrency
] = self.compiled_operation.run.concurrency # fmt: skip

# Handle early stopping
if self.run.is_matrix and self.compiled_operation.matrix.early_stopping:
Expand Down Expand Up @@ -952,7 +952,7 @@ def update_pipeline_params():
pipeline_override["runPatch"] = {}
pipeline_override["runPatch"][
"environment"
] = run_config.environment.to_dict()
] = run_config.environment.to_dict() # fmt: skip
if compiled_operation.termination:
pipeline_override["termination"] = compiled_operation.termination.to_dict()
if compiled_operation.plugins:
Expand Down
3 changes: 1 addition & 2 deletions haupt/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ extra-standard-library = ["typing", "typing_extensions", "mock", "pytest", "fact
force-single-line = false
force-sort-within-sections = true
combine-as-imports = true
lines-between-types = 1
lines-after-imports = 2
section-order = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]

[lint.per-file-ignores]
# Do not enforce usage and import order rules in init files
Expand Down

0 comments on commit af5865d

Please sign in to comment.