Skip to content

Commit 8d40df6

Browse files
committed
docs(contributing): some small consistency fixes and improvements
Remove redundant and outdated install_* scripts Signed-off-by: Dr.-Ing. Amilcar do Carmo Lucas <amilcar.lucas@iav.de>
1 parent 118a296 commit 8d40df6

6 files changed

Lines changed: 120 additions & 132 deletions

File tree

CONTRIBUTING.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,38 @@ and also:
2525

2626
## Setting up developer environment
2727

28-
The instructions below assume that you have already installed git and forked the [MethodicConfigurator](https://github.com/ArduPilot/MethodicConfigurator.git) github repository.
28+
1. [Install git](https://git-scm.com/install/) on your computer.
29+
2. Create a free [personal github account](https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github)
30+
3. [Log in to your github account](https://github.com/login) using a browser
31+
4. [Fork the ArduPilot/MethodicConfigurator github repository](https://github.com/ArduPilot/MethodicConfigurator/fork).
32+
5. Clone your fork and navigate into it:
2933

30-
Clone your fork and navigate into it:
34+
```bash
35+
git clone https://github.com/YOUR_USER_NAME/MethodicConfigurator.git
36+
cd MethodicConfigurator
37+
```
3138

32-
```bash
33-
git clone https://github.com/YOUR_USER_NAME/MethodicConfigurator.git
34-
cd MethodicConfigurator
35-
```
39+
6. Run the following helper scripts:
3640

37-
Run the following helper scripts:
38-
39-
On Windows:
41+
On Windows:
4042

41-
```cmd
42-
.\SetupDeveloperPC.bat
43-
.\install_msgfmt.bat
44-
.\install_wsl.bat
45-
```
43+
```powershell
44+
.\SetupDeveloperPC.bat
45+
```
4646

47-
On Linux and MacOS:
47+
On Linux and macOS:
4848

49-
```bash
50-
./SetupDeveloperPC.sh
51-
```
49+
```bash
50+
./SetupDeveloperPC.sh
51+
```
5252

5353
The above scripts will:
5454

5555
* Configure Git and useful aliases
56-
* Install dependencies
56+
* Create a Python virtual environment and install project dependencies
5757
* Install recommended VSCode extensions
5858
* Set up pre-commit hooks for linting and formatting
59+
* Install GNU gettext tools for internationalization support
5960

6061
## Executing the code
6162

@@ -66,32 +67,32 @@ To run it locally (from your cloned repository):
6667

6768
On Windows:
6869

69-
```cmd
70+
```powershell
71+
.venv\Scripts\activate.ps1
7072
python3 -m ardupilot_methodic_configurator
7173
```
7274

73-
On MacOS & Linux:
75+
On macOS & Linux:
7476

7577
```bash
76-
source venv/bin/activate
77-
78+
source .venv/bin/activate
7879
python3 -m ardupilot_methodic_configurator
7980
```
8081

8182
More detailed usage instructions can be found in our [user manual](https://ardupilot.github.io/MethodicConfigurator/USERMANUAL)
8283

8384
## Submitting patches
8485

85-
We encourage you to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style for your commit messages, as used in this repository.
86+
Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style for your git commit messages.
8687

8788
Each commit should be signed off using the `--signoff` option in `git commit`.
8889
By signing off your commit, you certify that you agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
8990

90-
You can sign your commit by:
91+
You can sign by either your commit by pressing the *sign-off* button on `git gui` or by using the command line:
9192

9293
```bash
9394
# Sign off a commit as you're making it
94-
git commit --signoff -m"commit message"
95+
git commit --signoff -m "commit message"
9596
9697
# Add a signoff to the last commit you made
9798
git commit --amend --signoff
@@ -100,7 +101,7 @@ git commit --amend --signoff
100101
git rebase --signoff master
101102
```
102103

103-
Once your changes are ready, submit a [Pull Request (PR)](https://github.com/ArduPilot/MethodicConfigurator/pulls) on GitHub.
104+
Once your changes are ready, submit a [GitHub Pull Request (PR)](https://github.com/ArduPilot/MethodicConfigurator/pulls).
104105

105106
## Development Team
106107

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ You need to create and activate a new virtual environment before you can run the
9595
sudo apt install python3-tk
9696
python -m venv .ardupilot_methodic_configurator_venv
9797
source .ardupilot_methodic_configurator_venv/bin/activate
98-
python -m pip install --upgrade pip
99-
pip install ardupilot_methodic_configurator
98+
python -m pip install uv
99+
uv pip install ardupilot_methodic_configurator
100100
```
101101

102102
To run it, execute the command line:

SetupDeveloperPC.bat

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@echo off
22
setlocal enabledelayedexpansion
33

4+
:: Configure a Microsoft Windows developer PC for ArduPilot Methodic Configurator development.
5+
46
:: Store the original directory
57
set "ORIGINAL_DIR=%CD%"
68

@@ -48,18 +50,45 @@ if "!found!"=="0" (
4850

4951
:checkDone
5052

53+
:: Create a local virtual environment if it doesn't exist
54+
if not exist ".venv" (
55+
echo Creating Python virtual environment...
56+
python -m venv .venv
57+
)
58+
59+
:: Activate the virtual environment
60+
echo Activating virtual environment...
61+
call .venv\Scripts\activate.bat
5162

63+
call :InstallDependencies
5264
call :ConfigureArgComplete
5365
call :ConfigureGit
5466
call :ConfigureVSCode
5567
call :ConfigurePreCommit
68+
call :InstallMsgfmt
5669

5770
echo running pre-commit checks on all Files
5871
pre-commit run -a
5972

6073
:: Change back to the original directory
6174
cd /d %ORIGINAL_DIR%
6275

76+
echo.
77+
echo To run the ArduPilot methodic configurator GUI, execute the following commands:
78+
echo.
79+
echo .venv\Scripts\activate.ps1
80+
echo python3 -m ardupilot_methodic_configurator
81+
echo.
82+
echo If you encounter issues with auto-connecting to the wrong device on MS Windows,
83+
echo you can explicitly set the device with the --device command line option:
84+
echo.
85+
echo python3 -m ardupilot_methodic_configurator --device COMX
86+
echo.
87+
echo Replace COMX with the correct COM port for your device.
88+
echo.
89+
echo For more detailed usage instructions, please refer to the USERMANUAL.md file.
90+
echo.
91+
6392
echo Script completed successfully.
6493
exit /b
6594

@@ -85,7 +114,6 @@ git config --local alias.cm "commit -m"
85114
git config --local alias.pom "push origin master"
86115
git config --local alias.aa "add --all"
87116
git config --local alias.df diff
88-
git config --local alias.su "submodule update --init --recursive"
89117
git config --local credential.helper manager
90118
git config --local pull.rebase true
91119
git config --local push.autoSetupRemote
@@ -208,3 +236,14 @@ if !ERRORLEVEL! equ 0 (
208236
)
209237

210238
goto :eof
239+
240+
:InstallMsgfmt
241+
echo Installing GNU gettext tools (msgfmt)...
242+
call install_msgfmt.bat
243+
goto :eof
244+
245+
:InstallDependencies
246+
echo Installing project dependencies...
247+
python -m pip install uv
248+
uv pip install -e .[dev]
249+
goto :eof

SetupDeveloperPC.sh

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22
#
3+
# Configure a Linux or macOS developer PC for ArduPilot Methodic Configurator development.
4+
#
35
# SPDX-FileCopyrightText: 2024-2025 Amilcar do Carmo Lucas <amilcar.lucas@iav.de>
46
#
57
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -21,10 +23,18 @@ ORIGINAL_DIR=$(pwd)
2123
# Change to the directory where the script resides
2224
cd "$(dirname "$0")" || exit
2325

24-
# Create a local virtual environment if it doesn't exist
25-
if [ ! -d ".venv" ]; then
26-
echo "Creating Python virtual environment..."
27-
python3 -m venv .venv
26+
# Install macOS dependencies early if on macOS
27+
if command -v brew &> /dev/null; then
28+
echo "Installing macOS dependencies with Homebrew..."
29+
brew install uv python-tk@3.9
30+
echo "Creating Python virtual environment with uv..."
31+
uv venv --python 3.9
32+
else
33+
# Create a local virtual environment if it doesn't exist
34+
if [ ! -d ".venv" ]; then
35+
echo "Creating Python virtual environment..."
36+
python3 -m venv .venv
37+
fi
2838
fi
2939

3040
# Activate the virtual environment
@@ -38,18 +48,22 @@ InstallDependencies() {
3848
sudo apt-get update
3949
# Install Python3 PIL.ImageTk for GUI support
4050
echo "Installing Python3 PIL.ImageTk..."
41-
sudo apt-get install -y python3-pil.imagetk
51+
sudo apt-get install -y python3-pil.imagetk gettext
52+
python3 -m pip install uv
53+
elif command -v brew &> /dev/null; then
54+
echo "macOS dependencies already installed."
4255
else
43-
echo "apt-get not found. Skipping system package updates."
56+
echo "Neither apt-get nor brew found. Please install dependencies manually."
4457
fi
4558

59+
# No need to uninstall serial and pyserial anymore as the virtual environment is isolated
4660
# Uninstall serial and pyserial to avoid conflicts
47-
echo "Uninstalling serial and pyserial..."
48-
sudo python3 -m pip uninstall -y serial pyserial
61+
# echo "Uninstalling serial and pyserial..."
62+
# uv pip uninstall -y serial pyserial
4963

5064
# Install the project dependencies
5165
echo "Installing project dependencies..."
52-
python3 -m pip install -e .[dev]
66+
uv pip install -e .[dev]
5367
}
5468

5569
ConfigureGit() {
@@ -74,7 +88,6 @@ ConfigureGit() {
7488
git config --local alias.pom "push origin master"
7589
git config --local alias.aa "add --all"
7690
git config --local alias.df diff
77-
git config --local alias.su "submodule update --init --recursive"
7891
git config --local credential.helper manager
7992
git config --local pull.rebase true
8093
git config --local push.autoSetupRemote
@@ -120,6 +133,24 @@ ConfigureVSCode() {
120133
exit 1
121134
fi
122135

136+
echo "Installing code spellcheker extension..."
137+
if ! code --install-extension streetsidesoftware.code-spell-checker; then
138+
echo "Failed to install code spellcheker extension."
139+
exit 1
140+
fi
141+
142+
echo "Installing the Python VSCode extension..."
143+
if ! code --install-extension ms-python.python; then
144+
echo "Failed to install Python VSCode extension."
145+
exit 1
146+
fi
147+
148+
echo "Installing ruff extension..."
149+
if ! code --install-extension charliermarsh.ruff; then
150+
echo "Failed to install ruff extension."
151+
exit 1
152+
fi
153+
123154
fi
124155
}
125156

@@ -139,5 +170,14 @@ pre-commit run -a
139170
# Change back to the original directory
140171
cd "$ORIGINAL_DIR" || exit
141172

173+
echo ""
174+
echo "To run the ArduPilot methodic configurator GUI, execute the following commands:"
175+
echo ""
176+
echo "source .venv/bin/activate"
177+
echo "python3 -m ardupilot_methodic_configurator"
178+
echo ""
179+
echo "For more detailed usage instructions, please refer to the USERMANUAL.md file."
180+
echo ""
181+
142182
echo "Script completed successfully."
143183
exit 0

install_macos.sh

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

install_windows.bat

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

0 commit comments

Comments
 (0)