*: 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))
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]

5
Vagrantfile vendored
View File

@ -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

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
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

View File

@ -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

View File

@ -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'

View File

@ -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.*",