-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMPROVEMENT: simplify and speedup pypi publishing
- Loading branch information
1 parent
6fa0cfe
commit 2f7c993
Showing
4 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Creates the ardupilot_methodic_configurator pip python package. | ||
This file is part of Ardupilot methodic configurator. https://github.com/ArduPilot/MethodicConfigurator | ||
SPDX-FileCopyrightText: 2024 Amilcar do Carmo Lucas <[email protected]> | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
""" | ||
|
||
import fnmatch | ||
import os | ||
|
||
from setuptools import setup | ||
|
||
|
||
# recursively find all files that match the globs and return tuples with their directory and a list of relative paths | ||
def find_data_files(globs: list[str]) -> list[tuple[str, list[str]]]: | ||
data_files_path_base = "ardupilot_methodic_configurator" | ||
ret = [] | ||
for dirpath, _dirnames, filenames in os.walk(data_files_path_base): | ||
data_files = [] | ||
for glob in globs: | ||
for filename in fnmatch.filter(filenames, glob): | ||
relative_path = os.path.join(dirpath, filename) | ||
data_files.append(relative_path) | ||
if data_files: | ||
ret.append((os.path.relpath(dirpath, data_files_path_base), data_files)) | ||
return ret | ||
|
||
|
||
setup( | ||
packages=["ardupilot_methodic_configurator"], | ||
# this is used by bdist | ||
data_files=[*find_data_files(["*.param", "*.jpg", "*.json", "*.xml", "*.mo"])], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
#!/bin/bash | ||
|
||
sudo pip uninstall -y MethodicConfigurator | ||
pip uninstall -y MethodicConfigurator | ||
sudo rm -Rf /usr/local/MethodicConfigurator/ | ||
|
||
sudo pip uninstall -y ardupilot_methodic_configurator | ||
pip uninstall -y ardupilot_methodic_configurator | ||
sudo rm -Rf /usr/local/ardupilot_methodic_configurator/ | ||
|
||
sudo rm -Rf /usr/local/vehicle_templates/ | ||
sudo rm -Rf /usr/local/locale/ | ||
rm -Rf ~/.local/locale | ||
rm -Rf ~/.local/vehicle_templates | ||
|
||
rm -Rf ~/.local/MethodicConfigurator | ||
rm -Rf ~/.local/bin/MethodicConfigurator | ||
rm -Rf build dist/ MethodicConfigurator.egg-info/ | ||
|
||
rm -Rf ~/.local/ardupilot_methodic_configurator | ||
rm -Rf ~/.local/bin/ardupilot_methodic_configurator | ||
rm -Rf build dist/ ardupilot_methodic_configurator.egg-info/ | ||
python -m build --wheel . | ||
|
||
# Use either this | ||
sudo pip install -U dist/ardupilot_methodic_configurator-0.9.16-py3-none-any.whl | ||
uv venv --python 3.12 | ||
source .venv/bin/activate | ||
uv pip install -U build packaging pip setuptools wheel | ||
|
||
# Or this | ||
#pip install -U dist/ardupilot_methodic_configurator-0.9.16-py3-none-any.whl | ||
python -m build | ||
|
||
uv pip install -U dist/ardupilot_methodic_configurator-1.0.8-py3-none-any.whl | ||
|
||
cd .. | ||
ardupilot_methodic_configurator --language=pt | ||
~/.local/bin/ardupilot_methodic_configurator --language=pt | ||
|
||
ardupilot_methodic_configurator --language=pt --loglevel=DEBUG | ||
ls -larct /usr/local | ||
|