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

Call for testing ruff #75

Closed
github-actions bot opened this issue Jan 3, 2025 · 3 comments
Closed

Call for testing ruff #75

github-actions bot opened this issue Jan 3, 2025 · 3 comments
Labels

Comments

@github-actions
Copy link

github-actions bot commented Jan 3, 2025

A new version (0.8.5) of ruff was just pushed to the latest/candidate channel in the snap store. The following revisions are available.

CPU ArchitectureRevision
amd641213
arm641215
armhf1214
ppc64el1217
riscv641218
s390x1216

Automated testing

If configured, the snap will be installed in a VM, and any test results or screenshots will be posted to this issue as a comment shortly.

How to test it manually

  1. Stop the application if it was already running
  2. Upgrade to this version by running
snap refresh ruff --channel latest/candidate
  1. Start the app and test it out.
  2. Finally, add a comment below explaining whether this app is working, and include the output of the following command.
snap version; lscpu | grep Architecture; snap info ruff | grep installed

How to release it

Maintainers can promote this to stable by commenting /promote <rev>[,<rev>] latest/stable [done].

For example

  • To promote a single revision, run /promote <rev> latest/stable
  • To promote multiple revisions, run /promote <rev>,<rev> latest/stable
  • To promote a revision and close the issue, run /promote <rev>,<rev> latest/stable done

You can promote all revisions that were just built with:

/promote 1213,1215,1214,1217,1218,1216 latest/stable done
Copy link
Author

github-actions bot commented Jan 3, 2025

Automated testing success.

Full logs are available at https://github.com/snapcrafters/ruff/actions/runs/12596157446. The first 100, and last 100 lines of the log are displayed in the Summary below.

Logs
ruff 0.8.5 (11e873eb4 2025-01-02)
::endgroup::
::group::Help
Ruff: An extremely fast Python linter and code formatter.

Usage: ruff [OPTIONS] <COMMAND>

Commands:
check    Run Ruff on the given files or directories
rule     Explain a rule (or all rules)
config   List or describe the available configuration options
linter   List all supported upstream linters
clean    Clear any caches in the current directory and any subdirectories
format   Run the Ruff formatter on the given files or directories
server   Run the language server
analyze  Run analysis over Python source code
version  Display Ruff's version
help     Print this message or the help of the given subcommand(s)

Options:
-h, --help     Print help
-V, --version  Print version

Log levels:
-v, --verbose  Enable verbose logging
-q, --quiet    Print diagnostics, but nothing else
-s, --silent   Disable all logging (but still exit with status code "1" upon detecting
               diagnostics)

Global options:
    --config <CONFIG_OPTION>  Either a path to a TOML configuration file (`pyproject.toml` or
                              `ruff.toml`), or a TOML `<KEY> = <VALUE>` pair (such as you might
                              find in a `ruff.toml` configuration file) overriding a specific
                              configuration option. Overrides of individual settings using this
                              option always take precedence over all configuration files,
                              including configuration files that were also specified using
                              `--config`
    --isolated                Ignore all configuration files

For help with a specific command, see: `ruff help <command>`.
::endgroup::
::group::Rules:
# airflow-variable-name-task-id-mismatch (AIR001)

Derived from the **Airflow** linter.

## What it does
Checks that the task variable name matches the `task_id` value for
Airflow Operators.

## Why is this bad?
When initializing an Airflow Operator, for consistency, the variable
name should match the `task_id` value. This makes it easier to
follow the flow of the DAG.

## Example
```python
from airflow.operators import PythonOperator


incorrect_name = PythonOperator(task_id="my_task")

Use instead:

from airflow.operators import PythonOperator


my_task = PythonOperator(task_id="my_task")

airflow-dag-no-schedule-argument (AIR301)

Derived from the Airflow linter.

This rule is in preview and is not stable. The --preview flag is required for use.

What it does

Checks for a DAG() class or @dag() decorator without an explicit
schedule parameter.

Why is this bad?

The default schedule value on Airflow 2 is timedelta(days=1), which is
almost never what a user is looking for. Airflow 3 changes this the default
to None, and would break existing DAGs using the implicit default.

If your DAG does not have an explicit schedule argument, Airflow 2
schedules a run for it every day (at the time determined by start_date).
Such a DAG will no longer be scheduled on Airflow 3 at all, without any
exceptions or other messages visible to the user.

Example

from airflow import DAG


# Using the implicit default schedule.
dag = DAG(dag_id="my_dag")

(Logs truncated. See full logs at: https://github.com/snapcrafters/ruff/actions/runs/12596157446)

mypyc/irbuild/statement.py:122:11: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
120 | from .match import MatchVisitor
121 |
122 | GenFunc = Callable[[], None]
| ^^^^^^^^ UP006
123 | ValueGenFunc = Callable[[], Value]
|
= help: Replace with collections.abc.Callable

mypyc/irbuild/statement.py:123:16: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
122 | GenFunc = Callable[[], None]
123 | ValueGenFunc = Callable[[], Value]
| ^^^^^^^^ UP006
|
= help: Replace with collections.abc.Callable

mypyc/lower/registry.py:8:13: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
6 | from mypyc.irbuild.ll_builder import LowLevelIRBuilder
7 |
8 | LowerFunc = Callable[[LowLevelIRBuilder, list[Value], int], Value]
| ^^^^^^^^ UP006
|
= help: Replace with collections.abc.Callable

mypyc/lower/registry.py:14:38: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
14 | def lower_primitive_op(name: str) -> Callable[[LowerFunc], LowerFunc]:
| ^^^^^^^^ UP006
15 | """Register a handler that generates low-level IR for a primitive op."""
|
= help: Replace with collections.abc.Callable

mypyc/test/testutil.py:42:11: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
41 | def builtins_wrapper(
42 | func: Callable[[DataDrivenTestCase], None], path: str
| ^^^^^^^^ UP006
43 | ) -> Callable[[DataDrivenTestCase], None]:
44 | """Decorate a function that implements a data-driven test case to copy an
|
= help: Replace with collections.abc.Callable

mypyc/test/testutil.py:43:6: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
41 | def builtins_wrapper(
42 | func: Callable[[DataDrivenTestCase], None], path: str
43 | ) -> Callable[[DataDrivenTestCase], None]:
| ^^^^^^^^ UP006
44 | """Decorate a function that implements a data-driven test case to copy an
45 | alternative builtins module implementation in place before performing the
|
= help: Replace with collections.abc.Callable

mypyc/test/testutil.py:73:11: UP006 Use collections.abc.Callable instead of Callable for type annotation
|
72 | def perform_test(
73 | func: Callable[[DataDrivenTestCase], None], builtins_path: str, testcase: DataDrivenTestCase
| ^^^^^^^^ UP006
74 | ) -> None:
75 | for path, _ in testcase.files:
|
= help: Replace with collections.abc.Callable

Found 176 errors.
warning: The following rule may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the select or extend-select configuration, or adding it to the ignore configuration.
8 files reformatted, 305 files left unchanged
warning: The following rule may cause conflicts when used with the formatter: ISC001. To avoid unexpected behavior, we recommend disabling this rule, either by removing it from the select or extend-select configuration, or adding it to the ignore configuration.
51 files reformatted, 262 files left unchanged
::endgroup::

::group::Repository: https://github.com/tiangolo/fastapi
Cloning into 'ruff-snap-test-gJZV7nTr'...
docs_src/sql_databases_peewee/sql_app/database.py:7:43: B039 Do not use mutable data structures for ContextVar defaults
|
5 | DATABASE_NAME = "test.db"
6 | db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
7 | db_state = ContextVar("db_state", default=db_state_default.copy())
| ^^^^^^^^^^^^^^^^^^^^^^^ B039
|
= help: Replace with None; initialize with `.set()``

Found 1 error.
docs_src/sql_databases_peewee/sql_app/database.py:7:43: B039 Do not use mutable data structures for ContextVar defaults
|
5 | DATABASE_NAME = "test.db"
6 | db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
7 | db_state = ContextVar("db_state", default=db_state_default.copy())
| ^^^^^^^^^^^^^^^^^^^^^^^ B039
|
= help: Replace with None; initialize with `.set()``

Found 4 errors (3 fixed, 1 remaining).
1282 files left unchanged
198 files reformatted, 1084 files left unchanged
::endgroup::


</details>

@lengau
Copy link
Contributor

lengau commented Jan 4, 2025

/promote 1213,1215,1214,1217,1218,1216 latest/stable done

Copy link
Author

github-actions bot commented Jan 4, 2025

The following revisions were released to the latest/stable channel: 1213,1215,1214,1217,1218,1216.

@github-actions github-actions bot closed this as completed Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant