From 41712b4e9123ed756cdde1b9b3e5f779bec313a5 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Thu, 19 Dec 2024 00:37:20 -0500 Subject: [PATCH] chore: Remove unnecessary build-related files This also moves `flatpak-pip-generator.py` to `build-aux`. --- .gitignore | 1 + .vscode/launch.json | 21 ----------- .vscode/settings.json | 18 ---------- .vscode/tasks.json | 27 -------------- CODING_GUIDE.md | 2 +- README.md | 2 +- {utils => build-aux}/flatpak-pip-generator.py | 0 {utils => build-aux}/install.sh | 0 build.sh | 36 ------------------- sonar-project.properties | 15 -------- utils/pylint-parser.py | 31 ---------------- 11 files changed, 3 insertions(+), 150 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json rename {utils => build-aux}/flatpak-pip-generator.py (100%) rename {utils => build-aux}/install.sh (100%) mode change 100755 => 100644 delete mode 100644 build.sh delete mode 100644 sonar-project.properties delete mode 100644 utils/pylint-parser.py diff --git a/.gitignore b/.gitignore index 8026614376..74e228fb31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode/ .mypy_cache/ .pytest_cache/ /.project diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index a52fc05de4..0000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.1.0", - "app-id": "", - "configurations": [ - { - "type": "python", - "name": "Build", - "preLaunchTask": "Flatpak: build", - "request": "attach" - }, - { - "type": "python", - "name": "Build eos", - "preLaunchTask": "Flatpak: build-eos", - "request": "attach" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9771a0be8a..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "python.analysis.extraPaths": [ - "./build/files/lib/python3.9/site-packages", - "./build/var/run/host/lib/python3.10/site-packages" - ], - "files.watcherExclude": { - "**/.dart_tool": true, - "**/.git/objects/**": true, - "**/.git/subtree-cache/**": true, - "**/node_modules/*/**": true, - "**/.hg/store/**": true, - ".flatpak/**": true, - "_build/**": true - }, - "mesonbuild.configureOnOpen": false, - "mesonbuild.buildFolder": "_build", - "mesonbuild.mesonPath": "/var/home/nahuelwexd/Proyectos/Bottles/.flatpak/meson.sh" -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index b836d57c43..0000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Flatpak: build", - "command": "flatpak-spawn", - "args": [ - "--host", - "flatpak", - "run", - "org.flatpak.Builder", - "build", - "com.usebottles.bottles.dev.yml", - "--user", - "--install", - "--force-clean", - "&&", - "flatpak-spawn", - "--host", - "flatpak", - "run", - "com.usebottles.bottles" - ], - "type": "shell" - } - ] -} diff --git a/CODING_GUIDE.md b/CODING_GUIDE.md index 46889e5a61..e05f07f6a7 100644 --- a/CODING_GUIDE.md +++ b/CODING_GUIDE.md @@ -33,7 +33,7 @@ pytest . Regenerate PYPI dependency manifest when requirements.txt changed ```bash -python ./utils/flatpak-pip-generator.py --runtime org.gnome.Sdk -r requirements.txt -o com.usebottles.bottles.pypi-deps --yaml +python ./build-aux/flatpak-pip-generator.py --runtime org.gnome.Sdk -r requirements.txt -o com.usebottles.bottles.pypi-deps --yaml ``` ## I18n files diff --git a/README.md b/README.md index 936dd872e7..8614afdec6 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ There are two methods to build Bottles. The first and longer method is using `or Since Bottles is primarily and officially distributed as a Flatpak, we only provide instructions to directly build it inside a Flatpak environment: 1. Download and install the latest build of Bottles: [bottles-x86_64.zip](https://nightly.link/bottlesdevs/Bottles/workflows/build_flatpak/main/bottles-x86_64.zip). Unzip it, and run `flatpak install bottles.flatpak` (use `--user` if necessary) -2. Run `flatpak run -d --filesystem=$PWD --command=bash com.usebottles.bottles.Devel` from the root of the repository, followed by `./utils/install.sh`. This will build Bottles and install it under the `build/` directory. +2. Run `flatpak run -d --filesystem=$PWD --command=bash com.usebottles.bottles.Devel` from the root of the repository, followed by `./build-aux/install.sh`. This will build Bottles and install it under the `build/` directory. 3. Run `./build/bin/bottles` to launch Bottles Due to GNOME Builder limitations, Builder cannot build Bottles for the time being; see [GNOME/gnome-builder#2061](https://gitlab.gnome.org/GNOME/gnome-builder/-/issues/2061) for more context. This is the best workaround we can provide. diff --git a/utils/flatpak-pip-generator.py b/build-aux/flatpak-pip-generator.py similarity index 100% rename from utils/flatpak-pip-generator.py rename to build-aux/flatpak-pip-generator.py diff --git a/utils/install.sh b/build-aux/install.sh old mode 100755 new mode 100644 similarity index 100% rename from utils/install.sh rename to build-aux/install.sh diff --git a/build.sh b/build.sh deleted file mode 100644 index 1fdb0b378c..0000000000 --- a/build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -run_flatpak() { - flatpak-spawn --host flatpak-builder -v build build-aux/com.usebottles.bottles.Devel.json --user --install --force-clean && flatpak-spawn --host flatpak run com.usebottles.bottles.Devel -} - -run_host() { - flatpak-builder build -v build-aux/com.usebottles.bottles.Devel.json --user --install --force-clean && flatpak run com.usebottles.bottles.Devel -} - -run_container() { - host-spawn flatpak-builder build -v build-aux/com.usebottles.bottles.Devel.json --user --install --force-clean && host-spawn flatpak run com.usebottles.bottles.Devel -} - -if [ -x "$(command -v flatpak-spawn)" ]; then - run_flatpak - exit $? -fi - -if [ -f "/run/.containerenv" ]; then - if [ -x "$(command -v flatpak)" ]; then - run_host - exit $? - fi - - if [ -x "$(command -v host-spawn)" ]; then - run_container - exit $? - fi - - echo "Looks like you are running in a container, but you don't have flatpak or host-spawn installed." - echo "Nothing to do here." -fi - -run_host -exit $? diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 06b39e8b4d..0000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,15 +0,0 @@ -sonar.projectKey=bottlesdevs_Bottles_AYiLYqAz9CPJrZw6oxDU -sonar.projectName=Bottles - -sonar.sources=. -sonar.python.version=3 - -sonar.issue.ignore.multicriteria=p1 - -# Resolve: "Cognitive Complexity of functions should not be too high" -sonar.issue.ignore.multicriteria.p1.ruleKey=python:S3776 -sonar.issue.ignore.multicriteria.p1.resourceKey=**/*.py - -sonar.c.file.suffixes=- -sonar.cpp.file.suffixes=- -sonar.objc.file.suffixes=- diff --git a/utils/pylint-parser.py b/utils/pylint-parser.py deleted file mode 100644 index f5572b30ec..0000000000 --- a/utils/pylint-parser.py +++ /dev/null @@ -1,31 +0,0 @@ -import sys -import subprocess - -git_diff_raw = subprocess.run( - 'git diff --name-only origin/main | grep "\.py$"', - capture_output=True, - shell=True, - check=False, -) - -git_diff = git_diff_raw.stdout.decode("ascii").splitlines() - -if len(git_diff) == 0: - sys.exit(0) - -pylint_result = subprocess.run( - "pylint bottles", capture_output=True, shell=True, check=False -) - -should_print = False -for l in pylint_result.stdout.decode("ascii").splitlines(): - if l.startswith("******"): - file_name = l.split("************* Module ")[1].replace(".", "/") + ".py" - should_print = file_name in git_diff - - if should_print: - if "E1101: Instance of 'Child' has no " in l: - continue - if "E0602: Undefined variable '_' (undefined-variable)" in l: - continue - print(l)