dangerzone/setup.py
deeplow 814d533c3b
Restructure container code
The files in `container/` no longer make sense to have that name since
the "document to pixels" part will run in Qubes OS in its own virtual
machine.

To adapt to this, this PR does the following:
- Moves all the files in `container` to `dangerzone/conversion`
- Splits the old `container/dangerzone.py` into its two components
  `dangerzone/conversion/{doc_to_pixels,pixels_to_pdf}.py` with a
  `common.py` file for shared functions
- Moves the Dockerfile to the project root and adapts it to the new
  container code location
- Updates the CircleCI config to properly cache Docker images.
- Updates our install scripts to properly build Docker images.
- Adds the new conversion module to the container image, so that it can
  be imported as a package.
- Adapts the container isolation provider to use the new way of calling
  the code.

NOTE: We have made zero changes to the conversion code in this commit,
except for necessary imports in order to factor out some common parts.
Any changes necessary for Qubes integration follow in the subsequent
commits.
2023-06-21 11:44:47 +03:00

60 lines
1.7 KiB
Python

#!/usr/bin/env python3
import os
import sys
import setuptools
with open("share/version.txt") as f:
version = f.read().strip()
def file_list(path):
files = []
for filename in os.listdir(path):
if os.path.isfile(os.path.join(path, filename)):
files.append(os.path.join(path, filename))
return files
setuptools.setup(
name="dangerzone",
version=version,
author="Freedom of the Press Foundation",
author_email="info@freedom.press",
license="MIT",
description="Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs",
long_description="""\
Dangerzone is an open source desktop application that takes potentially \
dangerous PDFs, office documents, or images and converts them to safe PDFs. \
It uses container technology to convert the documents within a secure sandbox.\
""",
url="https://github.com/freedomofpress/dangerzone",
packages=[
"dangerzone",
"dangerzone.conversion",
"dangerzone.gui",
"dangerzone.isolation_provider",
],
data_files=[
(
"share/applications",
["install/linux/press.freedom.dangerzone.desktop"],
),
(
"share/icons/hicolor/64x64/apps",
["install/linux/press.freedom.dangerzone.png"],
),
("share/dangerzone", file_list("share")),
],
classifiers=[
"Programming Language :: Python",
"Intended Audience :: End Users/Desktop",
"Operating System :: OS Independent",
],
entry_points={
"console_scripts": [
"dangerzone = dangerzone:main",
"dangerzone-cli = dangerzone:main",
]
},
)