From 2782fba9bbaaaa822ff2ed3850db29a38c60d590 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 17 Aug 2026 15:55:37 -0700 Subject: [PATCH] *: All other changes need for new import path Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- Makefile | 26 +++++++++++++------------- Vagrantfile | 5 +---- container | 2 +- debian/tests/control | 2 +- freedombox/web_server.py | 2 +- pyproject.toml | 18 +++++++++--------- 6 files changed, 26 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 30ef0d97e..b06b43f5d 100644 --- a/Makefile +++ b/Makefile @@ -58,14 +58,14 @@ FIND_ARGS := \ ROOT_DATA_FILES := $(shell find data -type f $(FIND_ARGS)) -MODULE_DATA_FILES := $(shell find $(wildcard plinth/modules/*/data) -type f $(FIND_ARGS)) +MODULE_DATA_FILES := $(shell find $(wildcard freedombox/modules/*/data) -type f $(FIND_ARGS)) update-translations: $(DJANGO_ADMIN) makemessages --all --domain django --keep-pot \ --verbosity=1 --ignore conftest.py --ignore doc --ignore build \ --ignore htmlcov --ignore screenshots --ignore debian --ignore \ actions --ignore preseed --ignore static --ignore data \ - --settings plinth.settings --pythonpath . + --settings freedombox.settings --pythonpath . configure: # Nothing to do @@ -78,7 +78,7 @@ build: $(MAKE) -C doc -j 8 # Build .whl package - rm -f dist/plinth-*.whl + rm -f dist/freedombox-*.whl $(PYTHON) -m build --no-isolation --skip-dependency-check --wheel install: @@ -96,14 +96,14 @@ install: # Python package temp=$$(mktemp -d) && \ lib_dir=$$($(PYTHON) -c 'import sysconfig; print(sysconfig.get_paths(scheme="deb_system")["purelib"])') && \ - $(PYTHON) -m pip install dist/plinth-*.whl --break-system-packages \ + $(PYTHON) -m pip install dist/freedombox-*.whl --break-system-packages \ --no-deps --no-compile --no-warn-script-location \ --ignore-installed --target=$${temp} && \ $(INSTALL) -d $(DESTDIR)$${lib_dir} && \ - rm -rf $(DESTDIR)$${lib_dir}/plinth $(DESTDIR)$${lib_dir}/plinth*.dist-info && \ - mv $${temp}/plinth $${temp}/plinth*.dist-info $(DESTDIR)$${lib_dir} && \ - rm -f $(DESTDIR)$${lib_dir}/plinth*.dist-info/licenses/COPYING.md && \ - rm -f $(DESTDIR)$${lib_dir}/plinth*.dist-info/direct_url.json && \ + rm -rf $(DESTDIR)$${lib_dir}/freedombox $(DESTDIR)$${lib_dir}/freedombox*.dist-info && \ + mv $${temp}/freedombox $${temp}/freedombox*.dist-info $(DESTDIR)$${lib_dir} && \ + rm -f $(DESTDIR)$${lib_dir}/freedombox*.dist-info/licenses/COPYING.md && \ + rm -f $(DESTDIR)$${lib_dir}/freedombox*.dist-info/direct_url.json && \ $(INSTALL) -D -t $(BIN_DIR) bin/plinth $(INSTALL) -D -t $(LIB_DIR)/freedombox bin/freedombox-privileged $(INSTALL) -D -t $(BIN_DIR) bin/freedombox-cmd @@ -121,7 +121,7 @@ install: cp $(CP_ARGS) $${file} $${target} ; \ done for file in $(MODULE_DATA_FILES) ; do \ - target=$$(dirname $(DESTDIR)$$(echo $${file} | sed -e 's|^plinth/modules/[^/]*/data||')) ; \ + target=$$(dirname $(DESTDIR)$$(echo $${file} | sed -e 's|^freedombox/modules/[^/]*/data||')) ; \ $(INSTALL) --directory --mode=755 $${target} ; \ cp $(CP_ARGS) $${file} $${target} ; \ done @@ -137,12 +137,12 @@ check-tests: # Tests with coverage report check-tests-cov: - $(PYTHON) -m pytest $(PYTEST_ARGS) --cov=plinth \ + $(PYTHON) -m pytest $(PYTEST_ARGS) --cov=freedombox \ --cov-report=html:./htmlcov --cov-report=term # Code quality checking using flake8 check-code: - $(PYTHON) -m flake8 plinth container + $(PYTHON) -m flake8 freedombox container # Static type checking using mypy check-type: @@ -154,8 +154,8 @@ check-doc: clean: make -C doc clean - rm -rf Plinth.egg-info - find plinth/locale -name *.mo -delete + rm -rf Freedombox.egg-info + find freedombox/locale -name *.mo -delete define DEVELOP_SERVICE_CONF [Service] diff --git a/Vagrantfile b/Vagrantfile index 126e36b44..888a1c439 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -17,15 +17,12 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", run: 'always', inline: <<-SHELL # Disable automatic upgrades echo -e 'APT::Periodic::Update-Package-Lists "0";\nAPT::Periodic::Unattended-Upgrade "0";' > //etc/apt/apt.conf.d/20auto-upgrades - # Do not run system plinth - systemctl stop plinth - systemctl disable plinth SHELL config.vm.provision "shell", inline: <<-SHELL cd /freedombox/ make provision-dev SHELL - config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh" + config.vm.provision "tests", run: "never", type: "shell", path: "freedombox/tests/functional/install.sh" config.vm.post_up_message = "FreedomBox virtual machine is ready for development. To get the IP address: $ vagrant ssh diff --git a/container b/container index c781891d1..46fd47e94 100755 --- a/container +++ b/container @@ -233,7 +233,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -yq --with-new-pkgs upgrade # Install requirements for tests if not already installed as root if ! [[ -e /usr/local/bin/geckodriver ]] then - /freedombox/plinth/tests/functional/install.sh + /freedombox/freedombox/tests/functional/install.sh fi # Wait for the server to start if functional tests are requested diff --git a/debian/tests/control b/debian/tests/control index 62f686301..f7d27d7da 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -13,7 +13,7 @@ Restrictions: needs-root, breaks-testbed # # Run unit and integration tests on installed files. # -Test-Command: PYTHONPATH='/usr/lib/python3/dist-packages/' py.test-3 -p no:cacheprovider --cov=plinth --cov-report=html:debci/htmlcov --cov-report=term +Test-Command: PYTHONPATH='/usr/lib/python3/dist-packages/' py.test-3 -p no:cacheprovider --cov=freedombox --cov-report=html:debci/htmlcov --cov-report=term Depends: e2fsprogs, git, python3-pytest, python3-pytest-cov, python3-pytest-django, @ Restrictions: breaks-testbed diff --git a/freedombox/web_server.py b/freedombox/web_server.py index 2c72b5660..17a63f42e 100644 --- a/freedombox/web_server.py +++ b/freedombox/web_server.py @@ -24,7 +24,7 @@ logger = logging.getLogger(__name__) # temporary failure in requests served leading to failures in functional tests. # Workaround this by preventing auto-reloading for all but FreedomBox's python # modules. -AUTORELOAD_REGEX = r'^plinth' +AUTORELOAD_REGEX = r'^freedombox' _CUSTOM_STATIC_URL = '/custom/static' diff --git a/pyproject.toml b/pyproject.toml index e4d93b816..d046a10a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "plinth" +name = "freedombox" description = "A web front end for administering FreedomBox" license = "AGPL-3.0-or-later" license-files = ["COPYING.md"] @@ -108,15 +108,15 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" [project.scripts] -plinth = "plinth.__main__:main" -freedombox-privileged = "plinth.privileged_daemon:main" -freedombox-cmd = "plinth.privileged_daemon:client_main" +plinth = "freedombox.__main__:main" +freedombox-privileged = "freedombox.privileged_daemon:main" +freedombox-cmd = "freedombox.privileged_daemon:client_main" [tool.setuptools.dynamic] -version = {attr = "plinth.__version__"} +version = {attr = "freedombox.__version__"} [tool.setuptools.packages.find] -include = ["plinth", "plinth.*"] +include = ["freedombox", "freedombox.*"] [tool.setuptools.package-data] "*" = [ @@ -130,7 +130,7 @@ include = ["plinth", "plinth.*"] "*" = ["*/data/*"] [tool.isort] -known_first_party = ["plinth"] +known_first_party = ["freedombox"] [tool.coverage.run] branch = true @@ -141,7 +141,7 @@ precision = 2 omit = ["*/tests/*"] [tool.pytest.ini_options] -addopts = "--ds=plinth.tests.data.django_test_settings" +addopts = "--ds=freedombox.tests.data.django_test_settings" markers = [ "essential", "functional", @@ -181,7 +181,7 @@ module = [ "pam.*", "pexpect.*", "pgi.*", - "plinth.tests.config_local", + "freedombox.tests.config_local", "pytest_splinter.*", "ruamel.*", "segno.*",