Skip to content

Commit

Permalink
Dropping Python 3.8, add support for 3.12 & 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWilkie committed Nov 18, 2024
1 parent 364f2ce commit 828021b
Show file tree
Hide file tree
Showing 13 changed files with 1,366 additions and 975 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/JOB_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: ["3.11"]
poetry-version: ["1.3.1"]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/JOB_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.11"
python-version: "3.12"

- name: Show filenames
run: echo ${{ inputs.files }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/JOB_generate_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/JOB_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.10"
python-version: "3.11"

- name: Show filenames
run: echo ${{ inputs.files }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/JOB_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.8"
- os: macos-latest
python-version: "3.9"
include:
- os: macos-13
python-version: "3.8"
- os: macos-13
python-version: "3.9"
# include:
# - os: macos-13
# python-version: "3.9"
runs-on: ${{ matrix.os }}
steps:
- name: Clean up disk space
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /tmp/*
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
Expand All @@ -35,7 +36,6 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.head_ref || github.ref }}

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/JOB_typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.10"
python-version: "3.11"

- name: Show filenames
run: echo ${{ inputs.files }}
Expand Down
37 changes: 19 additions & 18 deletions darwin/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,10 @@ def _import_properties(
metadata_property_classes, metadata_item_props = _parse_metadata_file(metadata_path)

# Get team properties
team_properties_annotation_lookup, team_item_properties_lookup = (
_get_team_properties_annotation_lookup(client, dataset.team)
)
(
team_properties_annotation_lookup,
team_item_properties_lookup,
) = _get_team_properties_annotation_lookup(client, dataset.team)

# Build metadata lookups
(
Expand Down Expand Up @@ -748,12 +749,13 @@ def _import_properties(
].add(t_prop_val.id)

# Create/Update team item properties based on metadata
item_properties_to_create_from_metadata, item_properties_to_update_from_metadata = (
_create_update_item_properties(
_normalize_item_properties(metadata_item_prop_lookup),
team_item_properties_lookup,
client,
)
(
item_properties_to_create_from_metadata,
item_properties_to_update_from_metadata,
) = _create_update_item_properties(
_normalize_item_properties(metadata_item_prop_lookup),
team_item_properties_lookup,
client,
)

console = Console(theme=_console_theme())
Expand Down Expand Up @@ -804,9 +806,10 @@ def _import_properties(
updated_properties.append(prop)

# get latest team properties
team_properties_annotation_lookup, team_item_properties_lookup = (
_get_team_properties_annotation_lookup(client, dataset.team)
)
(
team_properties_annotation_lookup,
team_item_properties_lookup,
) = _get_team_properties_annotation_lookup(client, dataset.team)

# Update item-level properties from annotations
_, item_properties_to_update_from_annotations = _create_update_item_properties(
Expand Down Expand Up @@ -835,9 +838,10 @@ def _import_properties(
updated_properties.append(prop)

# get latest team properties
team_properties_annotation_lookup, team_item_properties_lookup = (
_get_team_properties_annotation_lookup(client, dataset.team)
)
(
team_properties_annotation_lookup,
team_item_properties_lookup,
) = _get_team_properties_annotation_lookup(client, dataset.team)

# loop over metadata_cls_id_prop_lookup, and update additional metadata property values
for (annotation_class_id, prop_name), m_prop in metadata_cls_id_prop_lookup.items():
Expand Down Expand Up @@ -987,7 +991,6 @@ def _create_update_item_properties(

# If the property exists in the team, check that all values are present
if item_prop_name in team_item_properties_lookup:

t_prop = team_item_properties_lookup[item_prop_name]
# If the property is a text property it won't have predefined values, so continue
if t_prop.type == "text":
Expand All @@ -1014,7 +1017,6 @@ def _create_update_item_properties(

# If the property does not exist in the team, create it
else:

# If we've already planned to create this property, simply extend the property values
for prop in create_properties:
if prop.name == item_prop_name:
Expand Down Expand Up @@ -1957,7 +1959,6 @@ def _overwrite_warning(
files_with_item_properties_to_overwrite.append(local_file.full_path)

if files_with_annotations_to_overwrite or files_with_item_properties_to_overwrite:

# Overwriting of annotations
if files_with_annotations_to_overwrite:
console.print(
Expand Down
17 changes: 9 additions & 8 deletions e2e_tests/cli/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,15 @@ def compare_annotations_export(
actual_filename = get_actual_annotation_filename(
expected_filename, actual_annotation_files
)
expected_annotation_data, actual_annotation_data = (
parse_expected_and_actual_annotations(
expected_annotation_files,
actual_annotation_files,
expected_filename,
actual_filename,
annotation_format,
)
(
expected_annotation_data,
actual_annotation_data,
) = parse_expected_and_actual_annotations(
expected_annotation_files,
actual_annotation_files,
expected_filename,
actual_filename,
annotation_format,
)
for idx, expected_annotation_file in enumerate(expected_annotation_data):
actual_annotation_file = actual_annotation_data[idx]
Expand Down
Loading

0 comments on commit 828021b

Please sign in to comment.