Skip to content

Stop importing print_function#1048

Merged
tridge merged 1 commit intoArduPilot:masterfrom
peterbarker:pr/future-print-function-remove
May 30, 2025
Merged

Stop importing print_function#1048
tridge merged 1 commit intoArduPilot:masterfrom
peterbarker:pr/future-print-function-remove

Conversation

@peterbarker
Copy link
Contributor

the future is here

We can probably do without more of these - but these we can definitely do without

the future is here
@tridge tridge merged commit 667e127 into ArduPilot:master May 30, 2025
14 checks passed
cclauss added a commit to cclauss/pymavlink that referenced this pull request Jul 8, 2025
Completes
* ArduPilot#1048
> ### the future is here

https://python-future.org/whatsnew.html
> The new version number of 1.0.0 indicates that the `python-future` project, like Python 2, is now done.

Start with `ruff rule UP010` [unnecessary-future-import](https://docs.astral.sh/ruff/rules/unnecessary-future-import) and `ruff rule UP029` [unnecessary-builtin-import](https://docs.astral.sh/ruff/rules/unnecessary-builtin-import).

% `ruff check --select=UP --statistics`
```
641	UP031	[ ] printf-string-formatting
 57	UP004	[*] useless-object-inheritance
 48	UP029	[ ] unnecessary-builtin-import  # <-- This pull request
 48	UP032	[*] f-string
 27	UP008	[ ] super-call-with-parameters
 21	UP024	[*] os-error-alias
 18	UP030	[ ] format-literals
 13	UP006	[ ] non-pep585-annotation
 13	UP015	[*] redundant-open-modes
  8	UP010	[*] unnecessary-future-import  # <-- This pull request
  5	UP035	[ ] deprecated-import
  3	UP018	[*] native-literals
  2	UP009	[*] utf8-encoding-declaration
  2	UP039	[*] unnecessary-class-parentheses
  1	UP020	[*] open-alias
  1	UP021	[*] replace-universal-newlines
  1	UP022	[ ] replace-stdout-stderr
Found 909 errors.
[*] 156 fixable with the `--fix` option (530 hidden fixes can be enabled with the `--unsafe-fixes` option).
```
1. `ruff check --select=UP010 --fix  # from __future__ import ...`
2. `ruff check --select=UP029 --fix --unsafe-fixes  # from builtins import ...`
3. `git grep future ` # Remove instances related to the python-future dependency.

localhost:
```bash
source .venv/bin/activate
pytest  # 1 failed, 50 passed, 8 skipped, 1 warning in 16.02s -- tests/test_mavftp.py OSError: Address already in use
pip uninstall future
pytest  # 1 failed, 50 passed, 8 skipped, 1 warning in 16.02s -- tests/test_mavftp.py OSError: Address already in use
```
___What other testing approaches should be considered?___
tridge pushed a commit that referenced this pull request Jul 11, 2025
Completes
* #1048
> ### the future is here

https://python-future.org/whatsnew.html
> The new version number of 1.0.0 indicates that the `python-future` project, like Python 2, is now done.

Start with `ruff rule UP010` [unnecessary-future-import](https://docs.astral.sh/ruff/rules/unnecessary-future-import) and `ruff rule UP029` [unnecessary-builtin-import](https://docs.astral.sh/ruff/rules/unnecessary-builtin-import).

% `ruff check --select=UP --statistics`
```
641	UP031	[ ] printf-string-formatting
 57	UP004	[*] useless-object-inheritance
 48	UP029	[ ] unnecessary-builtin-import  # <-- This pull request
 48	UP032	[*] f-string
 27	UP008	[ ] super-call-with-parameters
 21	UP024	[*] os-error-alias
 18	UP030	[ ] format-literals
 13	UP006	[ ] non-pep585-annotation
 13	UP015	[*] redundant-open-modes
  8	UP010	[*] unnecessary-future-import  # <-- This pull request
  5	UP035	[ ] deprecated-import
  3	UP018	[*] native-literals
  2	UP009	[*] utf8-encoding-declaration
  2	UP039	[*] unnecessary-class-parentheses
  1	UP020	[*] open-alias
  1	UP021	[*] replace-universal-newlines
  1	UP022	[ ] replace-stdout-stderr
Found 909 errors.
[*] 156 fixable with the `--fix` option (530 hidden fixes can be enabled with the `--unsafe-fixes` option).
```
1. `ruff check --select=UP010 --fix  # from __future__ import ...`
2. `ruff check --select=UP029 --fix --unsafe-fixes  # from builtins import ...`
3. `git grep future ` # Remove instances related to the python-future dependency.

localhost:
```bash
source .venv/bin/activate
pytest  # 1 failed, 50 passed, 8 skipped, 1 warning in 16.02s -- tests/test_mavftp.py OSError: Address already in use
pip uninstall future
pytest  # 1 failed, 50 passed, 8 skipped, 1 warning in 16.02s -- tests/test_mavftp.py OSError: Address already in use
```
___What other testing approaches should be considered?___
@peterbarker peterbarker deleted the pr/future-print-function-remove branch August 21, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants