Skip to content

Commit ddf8c8c

Browse files
committed
Add from __future__ import annotations everywhere
Command was isort arcade -a 'from __future__ import annotations' But before running it, I find-and-replaced a # isort:skip comment onto every existing import to prevent sorting
1 parent 95a12e7 commit ddf8c8c

File tree

323 files changed

+651
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+651
-5
lines changed

arcade/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
44
A Python simple, easy to use module for creating 2D games.
55
"""
6-
# flake8: noqa: E402
6+
from __future__ import annotations
77

8+
# flake8: noqa: E402
89
# Error out if we import Arcade with an incompatible version of Python.
910
import sys
1011
import os

arcade/__main__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from arcade.management import show_info
24

35

arcade/__pyinstaller/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import os
24

35

arcade/__pyinstaller/hook-arcade.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
For a walk through of building an Arcade application with pyinstaller see:
1010
https://api.arcade.academy/en/latest/tutorials/bundling_with_pyinstaller/index.html
1111
"""
12+
from __future__ import annotations
13+
1214
from pathlib import Path
1315

1416
import arcade

arcade/application.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
The main window class that all object-oriented applications should
33
derive from.
44
"""
5+
from __future__ import annotations
6+
57
import logging
68
import os
79
import time

arcade/background/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Optional, Tuple
24

35
from PIL import Image

arcade/background/background.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Optional, Union, Tuple
24

35
from arcade.window_commands import get_window

arcade/background/background_texture.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Optional, List, Tuple
24

35
from PIL import Image

arcade/background/groups.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Optional, Union, List, Tuple
24

35
import arcade.gl as gl

arcade/cache/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Any, List
24
from .hit_box import HitBoxCache
35
from .texture import TextureCache

arcade/cache/hit_box.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Simple : Scanning the corners for the texture
99
* Detailed : fairly detailed hit box generated by pymunk with detail parameter
1010
"""
11+
from __future__ import annotations
12+
1113
import gzip
1214
import json
1315
from pathlib import Path

arcade/cache/image_data.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Dict, Optional, TYPE_CHECKING
24
from weakref import WeakValueDictionary
35

arcade/cache/texture.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Dict, Optional, TYPE_CHECKING, Union, List
24
from pathlib import Path
35
from weakref import WeakValueDictionary

arcade/camera.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Camera class
33
"""
4+
from __future__ import annotations
5+
46
import math
57
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
68

arcade/color/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
This module pre-defines several colors.
33
"""
4+
from __future__ import annotations
5+
46
from arcade.types import Color
57

68
AERO_BLUE = Color(201, 255, 229, 255)

arcade/context.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Arcade's version of the OpenGL Context.
33
Contains pre-loaded programs
44
"""
5+
from __future__ import annotations
6+
57
from pathlib import Path
68
from typing import Any, Iterable, Dict, Optional, Tuple, Union, Sequence
79
from contextlib import contextmanager

arcade/controller.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
For more info on this API, see https://pyglet.readthedocs.io/en/latest/programming_guide/input.html#using-controllers
55
"""
66

7+
from __future__ import annotations
8+
79
import pyglet.input
810

911
__all__ = [

arcade/csscolor/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
This module pre-defines colors as defined by the W3C CSS standard:
33
https://www.w3.org/TR/2018/PR-css-color-3-20180315/
44
"""
5+
from __future__ import annotations
6+
57
from arcade.types import Color
68

79
ALICE_BLUE = Color(240, 248, 255, 255)

arcade/draw_commands.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
graphics card each time a shape is drawn. For faster drawing, see the
77
Buffered Draw Commands.
88
"""
9+
from __future__ import annotations
10+
911
import array
1012
import math
1113
from typing import Optional, Tuple

arcade/drawing_support.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Functions used to support drawing. No Pyglet/OpenGL here.
33
"""
44

5+
from __future__ import annotations
6+
57
import math
68

79
__all__ = ["get_points_for_thick_line"]

arcade/earclip.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from: https://github.com/linuxlewis/tripy/blob/master/tripy.py
44
"""
55

6+
from __future__ import annotations
7+
68
from arcade.types import Point, PointList
79
from typing import List, Tuple
810

arcade/easing.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Functions used to support easing
33
"""
4+
from __future__ import annotations
5+
46
from math import pi, sin, cos
57
from dataclasses import dataclass
68
from typing import Callable, Tuple

arcade/examples/array_backed_grid.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
If Python and Arcade are installed, this example can be run from the command line with:
1414
python -m arcade.examples.array_backed_grid
1515
"""
16+
from __future__ import annotations
17+
1618
import arcade
1719

1820
# Set how many rows and columns we will have

arcade/examples/array_backed_grid_buffered.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
If Python and Arcade are installed, this example can be run from the command line with:
1414
python -m arcade.examples.array_backed_grid_buffered
1515
"""
16+
from __future__ import annotations
17+
1618
import arcade
1719

1820
# Set how many rows and columns we will have

arcade/examples/array_backed_grid_sprites_1.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
If Python and Arcade are installed, this example can be run from the command line with:
1313
python -m arcade.examples.array_backed_grid_sprites_1
1414
"""
15+
from __future__ import annotations
16+
1517
import arcade
1618

1719
# Set how many rows and columns we will have

arcade/examples/array_backed_grid_sprites_2.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
If Python and Arcade are installed, this example can be run from the command line with:
1313
python -m arcade.examples.array_backed_grid_sprites_2
1414
"""
15+
from __future__ import annotations
16+
1517
import arcade
1618

1719
# Set how many rows and columns we will have

arcade/examples/astar_pathfinding.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
python -m arcade.examples.astar_pathfinding
88
"""
99

10+
from __future__ import annotations
11+
1012
import arcade
1113
import random
1214

arcade/examples/asteroid_smasher.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
the command line with:
1414
python -m arcade.examples.asteroid_smasher
1515
"""
16+
from __future__ import annotations
17+
1618
import random
1719
import math
1820
import arcade

arcade/examples/background_blending.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
python -m arcade.examples.background_blending
1010
"""
1111

12+
from __future__ import annotations
13+
1214
import arcade
1315
import arcade.background as background
1416

arcade/examples/background_groups.py

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
python -m arcade.examples.background_groups
1212
"""
1313

14+
from __future__ import annotations
15+
1416
import arcade
1517
import arcade.background as background
1618

arcade/examples/background_parallax.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
python -m arcade.examples.background_parallax
1414
"""
1515

16+
from __future__ import annotations
17+
1618
import arcade
1719
import arcade.background as background
1820

arcade/examples/background_scrolling.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
If Python and Arcade are installed, this example can be run from the command line with:
1010
python -m arcade.examples.background_scrolling
1111
"""
12+
from __future__ import annotations
13+
1214
import arcade
1315
import arcade.background as background
1416

arcade/examples/background_stationary.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
python -m arcade.examples.background_stationary
99
"""
1010

11+
from __future__ import annotations
12+
1113
import arcade
1214
import arcade.background as background
1315

arcade/examples/bloom_defender.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
python -m arcade.examples.bloom_defender
88
"""
99

10+
from __future__ import annotations
11+
1012
import arcade
1113
import random
1214

arcade/examples/bouncing_rectangle.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
python -m arcade.examples.bouncing_rectangle
88
"""
99

10+
from __future__ import annotations
11+
1012
import arcade
1113

1214
# --- Set up the constants

arcade/examples/camera_platform.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
python -m arcade.examples.camera_platform
99
"""
1010

11+
from __future__ import annotations
12+
1113
import time
1214

1315
import arcade

arcade/examples/conway_alpha.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
typing:
99
python -m arcade.examples.conway_alpha
1010
"""
11+
from __future__ import annotations
12+
1113
import arcade
1214
import random
1315

arcade/examples/drawing_primitives.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
python -m arcade.examples.drawing_primitives
1616
"""
1717

18+
from __future__ import annotations
19+
1820
# Import the Arcade library. If this fails, then try following the instructions
1921
# for how to install arcade:
2022
# https://api.arcade.academy/en/latest/install/index.html

arcade/examples/drawing_text.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
If Python and Arcade are installed, this example can be run from the command line with:
55
python -m arcade.examples.drawing_text
66
"""
7+
from __future__ import annotations
8+
79
import arcade
810

911
SCREEN_WIDTH = 1200

arcade/examples/drawing_text_objects.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
If Python and Arcade are installed, this example can be run from the command line with:
66
python -m arcade.examples.drawing_text_objects
77
"""
8+
from __future__ import annotations
9+
810
import arcade
911

1012
SCREEN_WIDTH = 1200

arcade/examples/drawing_text_objects_batch.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
If Python and Arcade are installed, this example can be run from the command line with:
1111
python -m arcade.examples.drawing_text_objects_batch
1212
"""
13+
from __future__ import annotations
14+
1315
import arcade
1416
import pyglet.graphics
1517

arcade/examples/dual_stick_shooter.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
If Python and Arcade are installed, this example can be run from the command line with:
88
python -m arcade.examples.dual_stick_shooter
99
"""
10+
from __future__ import annotations
11+
1012
import math
1113
import pprint
1214
import random

arcade/examples/easing_example_1.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
If Python and Arcade are installed, this example can be run from the command line with:
1111
python -m arcade.examples.easing_example_1
1212
"""
13+
from __future__ import annotations
14+
1315
import arcade
1416
from arcade import easing
1517
from arcade.types import Color

arcade/examples/easing_example_2.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
If Python and Arcade are installed, this example can be run from the command line with:
1010
python -m arcade.examples.easing_example_2
1111
"""
12+
from __future__ import annotations
13+
1214
import arcade
1315
from arcade import easing
1416

arcade/examples/follow_path.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
python -m arcade.examples.follow_path
1010
"""
1111

12+
from __future__ import annotations
13+
1214
import arcade
1315
import math
1416

arcade/examples/full_screen_example.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
python -m arcade.examples.full_screen_example
1010
"""
1111

12+
from __future__ import annotations
13+
1214
import arcade
1315

1416
SPRITE_SCALING = 0.5

arcade/examples/gl/3d_cube.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
If Python and Arcade are installed, this example can be run from the command line with:
55
python -m arcade.examples.gl.3d_cube
66
"""
7+
from __future__ import annotations
8+
79
from pyglet.math import Mat4
810
import arcade
911
from arcade.gl import geometry

0 commit comments

Comments
 (0)