*: All other changes need for new import path

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-08-17 15:55:37 -07:00 committed by James Valleroy
parent 3af63bbf21
commit 2782fba9bb
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
6 changed files with 26 additions and 29 deletions

View File

@ -58,14 +58,14 @@ FIND_ARGS := \
ROOT_DATA_FILES := $(shell find data -type f $(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: update-translations:
$(DJANGO_ADMIN) makemessages --all --domain django --keep-pot \ $(DJANGO_ADMIN) makemessages --all --domain django --keep-pot \
--verbosity=1 --ignore conftest.py --ignore doc --ignore build \ --verbosity=1 --ignore conftest.py --ignore doc --ignore build \
--ignore htmlcov --ignore screenshots --ignore debian --ignore \ --ignore htmlcov --ignore screenshots --ignore debian --ignore \
actions --ignore preseed --ignore static --ignore data \ actions --ignore preseed --ignore static --ignore data \
--settings plinth.settings --pythonpath . --settings freedombox.settings --pythonpath .
configure: configure:
# Nothing to do # Nothing to do
@ -78,7 +78,7 @@ build:
$(MAKE) -C doc -j 8 $(MAKE) -C doc -j 8
# Build .whl package # Build .whl package
rm -f dist/plinth-*.whl rm -f dist/freedombox-*.whl
$(PYTHON) -m build --no-isolation --skip-dependency-check --wheel $(PYTHON) -m build --no-isolation --skip-dependency-check --wheel
install: install:
@ -96,14 +96,14 @@ install:
# Python package # Python package
temp=$$(mktemp -d) && \ temp=$$(mktemp -d) && \
lib_dir=$$($(PYTHON) -c 'import sysconfig; print(sysconfig.get_paths(scheme="deb_system")["purelib"])') && \ 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 \ --no-deps --no-compile --no-warn-script-location \
--ignore-installed --target=$${temp} && \ --ignore-installed --target=$${temp} && \
$(INSTALL) -d $(DESTDIR)$${lib_dir} && \ $(INSTALL) -d $(DESTDIR)$${lib_dir} && \
rm -rf $(DESTDIR)$${lib_dir}/plinth $(DESTDIR)$${lib_dir}/plinth*.dist-info && \ rm -rf $(DESTDIR)$${lib_dir}/freedombox $(DESTDIR)$${lib_dir}/freedombox*.dist-info && \
mv $${temp}/plinth $${temp}/plinth*.dist-info $(DESTDIR)$${lib_dir} && \ mv $${temp}/freedombox $${temp}/freedombox*.dist-info $(DESTDIR)$${lib_dir} && \
rm -f $(DESTDIR)$${lib_dir}/plinth*.dist-info/licenses/COPYING.md && \ rm -f $(DESTDIR)$${lib_dir}/freedombox*.dist-info/licenses/COPYING.md && \
rm -f $(DESTDIR)$${lib_dir}/plinth*.dist-info/direct_url.json && \ rm -f $(DESTDIR)$${lib_dir}/freedombox*.dist-info/direct_url.json && \
$(INSTALL) -D -t $(BIN_DIR) bin/plinth $(INSTALL) -D -t $(BIN_DIR) bin/plinth
$(INSTALL) -D -t $(LIB_DIR)/freedombox bin/freedombox-privileged $(INSTALL) -D -t $(LIB_DIR)/freedombox bin/freedombox-privileged
$(INSTALL) -D -t $(BIN_DIR) bin/freedombox-cmd $(INSTALL) -D -t $(BIN_DIR) bin/freedombox-cmd
@ -121,7 +121,7 @@ install:
cp $(CP_ARGS) $${file} $${target} ; \ cp $(CP_ARGS) $${file} $${target} ; \
done done
for file in $(MODULE_DATA_FILES) ; do \ 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} ; \ $(INSTALL) --directory --mode=755 $${target} ; \
cp $(CP_ARGS) $${file} $${target} ; \ cp $(CP_ARGS) $${file} $${target} ; \
done done
@ -137,12 +137,12 @@ check-tests:
# Tests with coverage report # Tests with coverage report
check-tests-cov: check-tests-cov:
$(PYTHON) -m pytest $(PYTEST_ARGS) --cov=plinth \ $(PYTHON) -m pytest $(PYTEST_ARGS) --cov=freedombox \
--cov-report=html:./htmlcov --cov-report=term --cov-report=html:./htmlcov --cov-report=term
# Code quality checking using flake8 # Code quality checking using flake8
check-code: check-code:
$(PYTHON) -m flake8 plinth container $(PYTHON) -m flake8 freedombox container
# Static type checking using mypy # Static type checking using mypy
check-type: check-type:
@ -154,8 +154,8 @@ check-doc:
clean: clean:
make -C doc clean make -C doc clean
rm -rf Plinth.egg-info rm -rf Freedombox.egg-info
find plinth/locale -name *.mo -delete find freedombox/locale -name *.mo -delete
define DEVELOP_SERVICE_CONF define DEVELOP_SERVICE_CONF
[Service] [Service]

5
Vagrantfile vendored
View File

@ -17,15 +17,12 @@ Vagrant.configure(2) do |config|
config.vm.provision "shell", run: 'always', inline: <<-SHELL config.vm.provision "shell", run: 'always', inline: <<-SHELL
# Disable automatic upgrades # Disable automatic upgrades
echo -e 'APT::Periodic::Update-Package-Lists "0";\nAPT::Periodic::Unattended-Upgrade "0";' > //etc/apt/apt.conf.d/20auto-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 SHELL
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
cd /freedombox/ cd /freedombox/
make provision-dev make provision-dev
SHELL 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 config.vm.post_up_message = "FreedomBox virtual machine is ready
for development. To get the IP address: for development. To get the IP address:
$ vagrant ssh $ vagrant ssh

View File

@ -233,7 +233,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -yq --with-new-pkgs upgrade
# Install requirements for tests if not already installed as root # Install requirements for tests if not already installed as root
if ! [[ -e /usr/local/bin/geckodriver ]] if ! [[ -e /usr/local/bin/geckodriver ]]
then then
/freedombox/plinth/tests/functional/install.sh /freedombox/freedombox/tests/functional/install.sh
fi fi
# Wait for the server to start if functional tests are requested # Wait for the server to start if functional tests are requested

View File

@ -13,7 +13,7 @@ Restrictions: needs-root, breaks-testbed
# #
# Run unit and integration tests on installed files. # 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, @ Depends: e2fsprogs, git, python3-pytest, python3-pytest-cov, python3-pytest-django, @
Restrictions: breaks-testbed Restrictions: breaks-testbed

View File

@ -24,7 +24,7 @@ logger = logging.getLogger(__name__)
# temporary failure in requests served leading to failures in functional tests. # temporary failure in requests served leading to failures in functional tests.
# Workaround this by preventing auto-reloading for all but FreedomBox's python # Workaround this by preventing auto-reloading for all but FreedomBox's python
# modules. # modules.
AUTORELOAD_REGEX = r'^plinth' AUTORELOAD_REGEX = r'^freedombox'
_CUSTOM_STATIC_URL = '/custom/static' _CUSTOM_STATIC_URL = '/custom/static'

View File

@ -1,5 +1,5 @@
[project] [project]
name = "plinth" name = "freedombox"
description = "A web front end for administering FreedomBox" description = "A web front end for administering FreedomBox"
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
license-files = ["COPYING.md"] license-files = ["COPYING.md"]
@ -108,15 +108,15 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project.scripts] [project.scripts]
plinth = "plinth.__main__:main" plinth = "freedombox.__main__:main"
freedombox-privileged = "plinth.privileged_daemon:main" freedombox-privileged = "freedombox.privileged_daemon:main"
freedombox-cmd = "plinth.privileged_daemon:client_main" freedombox-cmd = "freedombox.privileged_daemon:client_main"
[tool.setuptools.dynamic] [tool.setuptools.dynamic]
version = {attr = "plinth.__version__"} version = {attr = "freedombox.__version__"}
[tool.setuptools.packages.find] [tool.setuptools.packages.find]
include = ["plinth", "plinth.*"] include = ["freedombox", "freedombox.*"]
[tool.setuptools.package-data] [tool.setuptools.package-data]
"*" = [ "*" = [
@ -130,7 +130,7 @@ include = ["plinth", "plinth.*"]
"*" = ["*/data/*"] "*" = ["*/data/*"]
[tool.isort] [tool.isort]
known_first_party = ["plinth"] known_first_party = ["freedombox"]
[tool.coverage.run] [tool.coverage.run]
branch = true branch = true
@ -141,7 +141,7 @@ precision = 2
omit = ["*/tests/*"] omit = ["*/tests/*"]
[tool.pytest.ini_options] [tool.pytest.ini_options]
addopts = "--ds=plinth.tests.data.django_test_settings" addopts = "--ds=freedombox.tests.data.django_test_settings"
markers = [ markers = [
"essential", "essential",
"functional", "functional",
@ -181,7 +181,7 @@ module = [
"pam.*", "pam.*",
"pexpect.*", "pexpect.*",
"pgi.*", "pgi.*",
"plinth.tests.config_local", "freedombox.tests.config_local",
"pytest_splinter.*", "pytest_splinter.*",
"ruamel.*", "ruamel.*",
"segno.*", "segno.*",