Skip to content

Commit 4214ab2

Browse files
committed
Merge branch 'main' into fix-source-options
2 parents 5d79e47 + 29acf6c commit 4214ab2

21 files changed

+166
-212
lines changed

.dockerignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
build:
1717
strategy:
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2020
platform: ["ubuntu-latest", "macos-latest", "windows-latest"]
2121
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
2222
# Optional - x64 or x86 architecture, defaults to x64
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
python -m pip install --upgrade pip
4646
python -m pip install .
47-
python -m pip install -r requirements-dev.txt
47+
python -m pip install --group dev
4848
4949
- name: Lint with ruff
5050
run: |
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Sort imports with usort
5858
run: |
59-
usort diff mapillary_tools/
59+
usort diff mapillary_tools
6060
6161
- name: Type check with mypy
6262
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
run: |
9393
python -m pip install --upgrade pip
9494
python -m pip install .
95-
python -m pip install -r requirements-dev.txt
95+
python -m pip install --group dev
9696
9797
- name: Validate version
9898
run: |

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,40 @@ mapillary_tools --help
2828
<!--ts-->
2929

3030
- [Supported File Formats](#supported-file-formats)
31+
- [Image Formats](#image-formats)
32+
- [Video Formats](#video-formats)
3133
- [Installation](#installation)
34+
- [Standalone Executable](#standalone-executable)
35+
- [Installing via pip](#installing-via-pip)
36+
- [Installing on Android Devices](#installing-on-android-devices)
3237
- [Usage](#usage)
3338
- [Process and Upload](#process-and-upload)
3439
- [Process](#process)
3540
- [Upload](#upload)
3641
- [Advanced Usage](#advanced-usage)
3742
- [Local Video Processing](#local-video-processing)
43+
- [Install FFmpeg](#install-ffmpeg)
44+
- [Video Processing](#video-processing)
3845
- [Geotagging with GPX](#geotagging-with-gpx)
46+
- [New video geotagging features (experimental)](#new-video-geotagging-features-experimental)
47+
- [Usage](#usage-1)
48+
- [Examples](#examples)
49+
- [Generic supported videos](#generic-supported-videos)
50+
- [External GPX](#external-gpx)
51+
- [Insta360 stitched videos](#insta360-stitched-videos)
52+
- [Limitations of `--video_geotag_source`](#limitations-of---video_geotag_source)
3953
- [Authenticate](#authenticate)
54+
- [Examples](#examples-1)
4055
- [Image Description](#image-description)
4156
- [Zip Images](#zip-images)
4257
- [Development](#development)
58+
- [Setup](#setup)
59+
- [Option 1: Using uv (Recommended)](#option-1-using-uv-recommended)
60+
- [Option 2: Using pip with virtual environment](#option-2-using-pip-with-virtual-environment)
61+
- [Running the code](#running-the-code)
62+
- [Tests](#tests)
63+
- [Code Quality](#code-quality)
64+
- [Release and Build](#release-and-build)
4365

4466
<!--te-->
4567

@@ -465,49 +487,78 @@ git clone [email protected]:mapillary/mapillary_tools.git
465487
cd mapillary_tools
466488
```
467489

468-
Set up the virtual environment. It is optional but recommended:
490+
### Option 1: Using uv (Recommended)
491+
492+
Use [uv](https://docs.astral.sh/uv/) - a fast Python package manager.
493+
494+
Install the project in development mode with all dependencies:
469495

470496
```sh
471-
pip install pipenv
497+
# Install the project and development dependencies
498+
uv sync --group dev
499+
500+
# Activate the virtual environment
501+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
472502
```
473503

474-
Install dependencies:
504+
### Option 2: Using pip with virtual environment
505+
506+
Set up a virtual environment (recommended):
475507

476508
```sh
477-
pipenv install -r requirements.txt
478-
pipenv install -r requirements-dev.txt
509+
python -m venv .venv
510+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
479511
```
480512

481-
Enter the virtualenv shell:
513+
Install the project in development mode:
482514

483515
```sh
484-
pipenv shell
516+
# Install the project and all dependencies in editable mode
517+
pip install -e .
518+
519+
# Install development dependencies
520+
pip install --group dev
485521
```
486522

523+
## Running the code
524+
487525
Run the code from the repository:
488526

489527
```sh
490-
python3 -m mapillary_tools.commands --version
528+
# If you have mapillary_tools installed in editable mode
529+
mapillary_tools --version
530+
531+
# Alternatively
532+
python -m mapillary_tools.commands --version
491533
```
492534

493535
## Tests
494536

495537
Run tests:
496538

497539
```sh
498-
# test all cases
499-
python3 -m pytest -s -vv tests
500-
# or test a single case specifically
501-
python3 -m pytest -s -vv tests/unit/test_camm_parser.py::test_build_and_parse
540+
# Test all cases
541+
pytest -s -vv tests
542+
# Or test a single case specifically
543+
pytest -s -vv tests/unit/test_camm_parser.py::test_build_and_parse
502544
```
503545

504-
Run linting:
546+
## Code Quality
547+
548+
Run code formatting and linting:
505549

506550
```sh
507-
# format code
508-
black mapillary_tools tests
509-
# sort imports
551+
# Format code with ruff
552+
ruff format mapillary_tools tests
553+
554+
# Lint code with ruff
555+
ruff check mapillary_tools tests
556+
557+
# Sort imports with usort
510558
usort format mapillary_tools tests
559+
560+
# Type checking with mypy
561+
mypy mapillary_tools
511562
```
512563

513564
## Release and Build

docker/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker/Dockerfile-dev

Lines changed: 0 additions & 10 deletions
This file was deleted.

mapillary_tools/geotag/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def to_description(
5151
)
5252
)
5353

54-
return results + error_metadatas
54+
return T.cast(list[types.ImageMetadataOrError], results + error_metadatas)
5555

5656
# This method is passed to multiprocessing
5757
# so it has to be classmethod or staticmethod to avoid pickling the instance
@@ -117,7 +117,7 @@ def to_description(
117117
)
118118
)
119119

120-
return results + error_metadatas
120+
return T.cast(list[types.VideoMetadataOrError], results + error_metadatas)
121121

122122
# This method is passed to multiprocessing
123123
# so it has to be classmethod or staticmethod to avoid pickling the instance

mapillary_tools/process_geotag_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _validate_metadatas(
308308
)
309309
)
310310

311-
return validated_metadatas + error_metadatas
311+
return T.cast(list[types.MetadataOrError], validated_metadatas + error_metadatas)
312312

313313

314314
def process_finalize(

0 commit comments

Comments
 (0)