mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00

Update our pyproject.toml file to include some non-Python data files, e.g., our container image and assets. This way, we can use `poetry build` to create a source distribution / Python wheel from our source repository. Note that this list of data files is already defined in our `setup.py` script. In that script, one can find some extra goodies: 1. We can conditionally include data files in our Python package. We use this to include Qubes data only in our Qubes packages. 2. We can specify where will the data files be installed in the end-user system. The above are non-goals for Poetry [1], especially (2), because modern Python wheels are not supposed to install files in arbitrary places within the user's host, nor should the install invocation use sudo. Instead, this is a task that's better suited for the .deb / .rpm packages. So, why do we bother updating our `pyproject.toml` and not use `setup.py` instead? Because `setup.py` is deprecated [2,3], and the latest Python packaging RFCs [4], as well as most recent Fedora guidelines [5] use `pyproject.toml` as the source of truth, instead of `setup.py`. In subsequent commits, we will also use just `pyproject.toml` for RPM packaging. [1]: https://github.com/python-poetry/poetry/issues/890 [2]: https://peps.python.org/pep-0517/#source-trees [3]: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html [4]: https://peps.python.org/pep-0517/ [5]: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/
61 lines
1.5 KiB
TOML
61 lines
1.5 KiB
TOML
[tool.poetry]
|
|
name = "dangerzone"
|
|
version = "0.4.2"
|
|
description = "Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs"
|
|
authors = ["Freedom of the Press Foundation <info@freedom.press>", "Micah Lee <micah.lee@theintercept.com>"]
|
|
license = "MIT"
|
|
include = [
|
|
"share/",
|
|
"qubes/",
|
|
"install/linux/press.freedom.dangerzone.*",
|
|
"README.md"
|
|
]
|
|
|
|
[tool.poetry.dependencies]
|
|
python = ">=3.7,<3.12"
|
|
click = "*"
|
|
appdirs = "*"
|
|
PySide6 = "^6.4.1"
|
|
colorama = "*"
|
|
pyxdg = {version = "*", platform = "linux"}
|
|
requests = "*"
|
|
markdown = "*"
|
|
packaging = "*"
|
|
|
|
[tool.poetry.scripts]
|
|
dangerzone = 'dangerzone:main'
|
|
dangerzone-cli = 'dangerzone:main'
|
|
|
|
# Dependencies required for packaging the code on various platforms.
|
|
[tool.poetry.group.package.dependencies]
|
|
setuptools = "*"
|
|
cx_freeze = {version = "^6.13.1", platform = "win32"}
|
|
pywin32 = {version = "*", platform = "win32"}
|
|
pyinstaller = {version = "*", platform = "darwin"}
|
|
|
|
# Dependencies required for linting the code.
|
|
[tool.poetry.group.lint.dependencies]
|
|
black = "*"
|
|
isort = "*"
|
|
mypy = "*"
|
|
types-PySide2 = "*"
|
|
types-Markdown = "*"
|
|
types-requests = "*"
|
|
|
|
# Dependencies required for testing the code.
|
|
[tool.poetry.group.test.dependencies]
|
|
pytest = "^7.1.2"
|
|
pytest-mock = "^3.10.0"
|
|
pytest-qt = "^4.2.0"
|
|
pytest-cov = "^3.0.0"
|
|
strip-ansi = "*"
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
skip = [".gitignore"]
|
|
# This is necessary due to https://github.com/PyCQA/isort/issues/1835
|
|
follow_links = false
|
|
|
|
[build-system]
|
|
requires = ["poetry-core>=1.2.0"]
|
|
build-backend = "poetry.core.masonry.api"
|