From 93cab14d63f8f5b765e5f81eac6e9e44681e10e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:43:20 +0000 Subject: [PATCH 1/5] Initial plan From ef5e26356570a46c353aea761347a5db9d829c50 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:45:57 +0000 Subject: [PATCH 2/5] Migrate from Poetry to uv: Convert pyproject.toml to PEP 621 format and update README Co-authored-by: mihow <158175+mihow@users.noreply.github.com> --- README.md | 40 ++++++++++++------ pyproject.toml | 107 +++++++++++++++++++++++++------------------------ 2 files changed, 82 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 504ddaf..a0cf557 100644 --- a/README.md +++ b/README.md @@ -21,30 +21,46 @@ Software, algorithms and research related to the Automated Monitoring of Insects ## Setup -Poetry is used to manage the dependencies common to all scripts and sub-projects. Some sub-projects may manage their own dependencies if necessary. +[uv](https://github.com/astral-sh/uv) is used to manage the dependencies common to all scripts and sub-projects. uv is a fast, modern Python package manager. -1. Install [Poetry](https://python-poetry.org/docs/#installation) +1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) + ```bash + # On macOS and Linux + curl -LsSf https://astral.sh/uv/install.sh | sh + + # On Windows + powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + ``` 2. Clone this repository -2. Create a `.env` or copy `.env.example` and update the values -3. Run `poetry install` in the root of the repository -4. Install pre-commit hooks `poetry run pre-commit install` +3. Create a `.env` or copy `.env.example` and update the values +4. Install dependencies in the root of the repository: + ```bash + uv sync + ``` +5. Install pre-commit hooks: + ```bash + uv run pre-commit install + ``` + +### [Optional] Conda + uv +An optional way to setup the environment is to use [Conda](https://conda.io/projects/conda/en/latest/index.html) for creating and managing the Python environment, while using [uv](https://docs.astral.sh/uv/) for managing the packages and dependencies. -### [Optional] Conda + Poetry -An optional way to setup the environment is to use [Conda](https://conda.io/projects/conda/en/latest/index.html) for creating and managing the environment, while using [Poetry](https://python-poetry.org/) for managing the packages and dependencies. Run the following steps to setup: 1. [Install Conda](https://docs.anaconda.com/free/miniconda/) 2. Create conda environment using the `environment.yml`: `conda env create -f environment.yml` 3. Activate the conda environment: `conda activate ami-ml` -4. Install packages in the root of the repository using Poetry: `poetry install` +4. Install packages in the root of the repository using uv: `uv sync` ## Usage Activate the virtual environment before running scripts ```bash -poetry shell +source .venv/bin/activate # On Linux/macOS +# or +.venv\Scripts\activate # On Windows ``` -Example for running a script (in the poetry shell): +Example for running a script (in the activated environment): ```bash python src/localization/inference_localization.py \ @@ -53,8 +69,8 @@ python src/localization/inference_localization.py \ --model_type fasterrcnn_mobilenet_v3_large_fpn ``` -Alternatively, one can run the scripts without activating poetry's shell: +Alternatively, one can run scripts without activating the environment: ```bash - poetry run python