Skip to content

Commit

Permalink
Reimplementing python packaging replacing setup.py with pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Feb 3, 2025
1 parent df4c725 commit ff5c3ea
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd /build/globaleaks-whistleblowing-software

sudo apt-get -y update

sudo apt-get -y install brotli curl git debhelper devscripts dh-apparmor dh-python python3-all python3-pip python3-setuptools python3-sphinx
sudo apt-get -y install brotli curl git debhelper devscripts dh-apparmor dh-python python3-all python3-pybuild python3-pip python3-setuptools python3-sphinx

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_tests_backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ setupClient

# Running backend tests
echo "Running backend tests"
cd $GITHUB_WORKSPACE/backend && coverage run setup.py test
cd $GITHUB_WORKSPACE/backend && coverage run -m twisted.trial globaleaks.tests
if [ $? -ne 0 ]; then
backend_test_failed=1
fi
Expand Down
31 changes: 31 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "globaleaks"
dynamic = ["version"]
description = "An open-source whistleblowing platform"
readme = "README.md"
requires-python = ">=3.8"
authors = [
{ name = "GlobaLeaks", email = "[email protected]" }
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
]

# Metadata dynamically loaded from the globaleaks package
[tool.setuptools.dynamic]
version = { attr = "globaleaks.__version__" }
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
where = ["."]
include = ["globaleaks*"]

# Ensure non-Python files (e.g., templates, config files) are included
[tool.setuptools.package-data]
globaleaks = ["**/*"]
39 changes: 0 additions & 39 deletions backend/setup.py

This file was deleted.

1 change: 1 addition & 0 deletions debian/controlX/control.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.buster
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.focal
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions debian/controlX/control.noble
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends:
devscripts,
dh-apparmor,
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-setuptools,
python3-sphinx
Expand Down
1 change: 1 addition & 0 deletions documentation/developer/Environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The guide assumes you run a Debian based system and that the following software
* grunt-cli
* node
* npm
* pybuild-plugin-pyproject
* python3
* python3-dev
* python3-pip
Expand Down

0 comments on commit ff5c3ea

Please sign in to comment.