Commit graph

75 commits

Author SHA1 Message Date
deeplow
832775f34e
Bump version to 0.6.0 2024-02-13 11:12:19 +00:00
deeplow
3fb797cdd1
Temporarily pin PyMuPDF==1.23.8 in container
PyMuPDF 1.23.9 swapped the new fitz implementation (fitz_new)
with the fitz module. In the new module there are prints in the code
that interfere with our stdout for sending JSON from the container.
Pinning the version seems to have no adverse consequences [1], since
fitz_old hasn't had significant changes and it gives breathing room for
the print-related issue to be tackled in PR [2].

Fixes temporarily #700

[1]: https://github.com/freedomofpress/dangerzone/issues/700#issuecomment-1938357651
[2]: https://github.com/pymupdf/PyMuPDF/pull/3137
2024-02-12 11:37:46 +00:00
Alex Pyrgiotis
d7ee162852
Add support for Python 3.12
Fedora 39 ships with Python 3.12 by default, which Dangerzone previously
did not support due to limitations from the PySide6 package. Now that
the PySide6 package has been updated to 6.6.1, and the limitation has
lifted, we should to reflect this in pyproject.toml.
2024-01-31 17:07:32 +02:00
Alex Pyrgiotis
d854657883
Include data files only in source distribution
Make Poetry include data files only in the source distribution, and not
on our wheels. This mainly makes RPM packaging a bit easier, but does
not solve the problem of how to install files to
`/usr/share/dangerzone`.

Also, include files using globs, which is the way Poetry prefers.

Fixes #678
Refs #677
2024-01-23 16:19:45 +02:00
deeplow
f27296cd45
Replace MIT license with AGPLv3
License change required due to the inclusion of the AGPL-licensed
PyMuPDF. This library greatly benefited Dangerzone in many aspects
detailed in [1].

Fixes #658

[1]: https://github.com/freedomofpress/dangerzone/issues/658
2024-01-04 09:57:49 +00:00
deeplow
1cd87f73a8
Bump pymupdf to 1.23.8 2024-01-03 12:58:35 +00:00
deeplow
2b082913a0
Bump pymupdf version 1.23.7
The build was failing due to a missing kernel libraries. Adding the
linux-headers dependency solves the issue.
2024-01-03 12:58:35 +00:00
deeplow
250d8356cd
Hash-verify container pip install & merge build-image
Ensure that when the container image is installing pymupdf (unavailable
in the repos) with verified hashes. To do so, it has the pymupdf
dependency declared in a "container" group in `pyproject.toml`, which
then gets exported into a requirements.txt, which is then used for
hash-verification when building the container.

Because this required modifying the container image build scripts, they
were all merged to avoid duplicate code. This was an overdue change
anyways.
2024-01-03 12:58:35 +00:00
deeplow
a3a64882a3
Add PyMuPDF to dev env in Qubes
Since PyMuPDF is now used in Pixels to PDF we needed to add it to the
qubes development environment.
2024-01-03 12:58:32 +00:00
deeplow
77d5ea5940
Add PyMuPDF in pixels_to_pdf replacing old logic
Adding PyMuPDF essentially make the code much simpler since it can do
everything that we'd need multiple programs for. It also includes
tesseract-OCR integration, which this commit makes use of.
2024-01-03 12:56:33 +00:00
Alex Pyrgiotis
7fc797f913
Bump version to 0.5.1 2023-12-06 17:54:25 +02:00
Alex Pyrgiotis
f02597aa4f
Make isort use .gitignore properly
By using `--skip / --extend-skip .gitignore`, we actually never read the
.gitignore file. We have to use `--skip-gitignore` instead.

This requires Git in the development environment, so we need to install
Git in our CI runners as well.
2023-10-13 22:45:37 +03:00
Alex Pyrgiotis
1961899bed
Bump version to 0.5.0 2023-10-03 11:32:38 +03:00
Garrett Robinson
79c1d6db0f
Use extend_skip to avoid overriding isort's skip default
This preserves isort's default behavior of ignoring virtualenvs with
common names like `venv` or `.venv`, which is helpful when running
`isort` in a local development environment that uses such a
virtualenv.
2023-09-28 17:21:00 +03:00
Alex Pyrgiotis
3dea16bcd2
Include non-Python data files into Python package
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/
2023-09-20 16:38:55 +03:00
Alex Pyrgiotis
5431e059bf
Update build-system entry in pyproject.toml
Update the `build-backend` attribute, in accordance with the Python
Poetry docs [1]. Also, bump the minimum required poetry-core version to
1.2.0, since this is the version that introduced the Poetry dependency
groups [2], i.e., the [tool.poetry.group] sections in pyproject.toml.

[1]: https://python-poetry.org/docs/pyproject/#poetry-and-pep-517
[2]: https://python-poetry.org/docs/managing-dependencies/#dependency-groups
2023-09-20 16:38:55 +03:00
Alex Pyrgiotis
b83d2495eb
Remove stale dangerzone-container entrypoint
The dangerzone-container entrypoint, as specified in pyproject.toml, is
stale, for the following reasons:

1. It's not mentioned in the setup.py script, so it was never included
   in our Linux distributions.
2. The code in `dangerzone.__init__.py` that decides if it will invoke
   the GUI or CLI backend, just takes `dangerzone-cli` into account for
   this decision, and does not mention dangerzone-container anywhere.
2023-09-20 16:38:55 +03:00
Alex Pyrgiotis
7bc0129f94
Let black and isort respect .gitignore
In order to let isort respect .gitignore, we need to specify this in the
tool.isort entry, in pyproject.toml.

For black, we don't need any extra tweaks. This is weird, since until a
few months ago black did not respect .gitignore. Maybe something has
changed in the meantime but if not, we should revert this change.
2023-09-20 16:38:55 +03:00
Alex Pyrgiotis
0296844e36
Bump version to 0.4.2 2023-08-02 13:43:05 +03:00
Alex Pyrgiotis
9768714b4a
Make isort compatible with Black
The isort tool is not compatible with Black by default. This leads to a
tug of war between these tools, when we run `make lint-apply` -> `make
lint`. Fix this by forcing isort to be compatible with Black.
2023-08-01 14:38:32 +03:00
deeplow
8b8f2a207c
Remove remains of parallel tests completely
Parallel tests had given us issues in the part [1]. This time, they
weren't playing well with pytest-qt. One hypothesis is that Qt
application components run as singletons and don't play well when there
are two instances.

The symptom we were experiencing was infinite recursion and removing
pytest-xdist solved the issue.

[1]: https://github.com/freedomofpress/dangerzone/issues/217
2023-07-25 15:17:24 +01:00
Alex Pyrgiotis
ca81b4a5f3
Add pytest-qt test dependency 2023-07-24 16:49:31 +03:00
Alex Pyrgiotis
5ae8b871b6
Add UpdaterThread class
Add a new Python module called "updater", which contains the logic for
prompting the user to enable updates, and checking our GitHub releases
for new updates.

This class has some light dependency to Qt functionality, since it needs
to:

* Show a prompt to the user,
* Run update checks asynchronously in a Qt thread,
* Provide the main window with the result of the update check

Refs #189
2023-07-24 14:22:27 +03:00
Alex Pyrgiotis
70a2e710d6
Bump version to 0.4.1
This release brings a split in the MacOS binaries, since we now have
separate ones for Intel and Apple Silicon architectures, so we must
reflect this in the README as well.
2023-04-18 23:01:00 +03:00
Alex Pyrgiotis
bb0de52b01
Bump version to 0.4.1-rc3 2023-04-03 19:36:48 +03:00
Alex Pyrgiotis
a33dcfbb51
Replace First Look Media references
Update several references to First Look Media in the code, to better
reflect the current status, where Freedom of the Press Foundation has
taken over the stewardship of the project.

Fixes #343
2023-03-08 18:40:55 +02:00
Alex Pyrgiotis
16375bfdf9
Use PySide6 in our dev environments
Drop PySide2 from our dependencies (previously used only on Linux
environments) and use PySide6 in all dev environments. The reason is
that PySide2 (from PyPI) does not support Python 3.11, and the variants
that do (Fedora/Debian packages) need to backport fixes from PySide6.

Our original attempt was to build PySide2 wheels for Python 3.11 but
it was not simple, nor maintainable. So, we were left with two options:

1. Install Python 3.10 in dev environments that have Python 3.11 by
   default.
2. Use PySide6 in all of our environments.

In both cases, we break package parity with the user's system, since we
are not testing Dangerzone under the same conditions. However, since
option (2) is forwards-compatible with where we want to move the
project (use Qt6 and PySide6), we chose that one.

Fixes #330
2023-02-07 18:52:09 +02:00
deeplow
81e9ccf30a
Add PySide6 dependency for Windows and MacOS
We're not yet adding them to Linux, since PySide6 is not yet available
in Linux distros' packages, whereas with Linux and macOS our packaging
process includes the shipped binaries.

Fixes #211
2023-01-30 11:42:18 +00:00
deeplow
ab2f9ead9a
Replace PySide2-stubs with types-PySide2
Replace PySide2-stubs with types-PySide2, both of which are projects
that provide PySide2 typing hints, for the following reasons:

1. types-PySide2 is more complete and allows us to ditch some 'type:
   ignore' comments for Mypy.
2. PySide2-stubs also brings PySide2 as a dependency, which cannot be
   installed in MacOS M1 machines.

Refs #177
2023-01-30 11:42:09 +00:00
Alex Pyrgiotis
ea99b1e1dd
Narrow down installed system packages
Narrow down the system packages that we install in dev environments. The
rationale is that we get most of the Python dependencies from Poetry, so
we don't need to install them from the system as well.

The packages that we do need to install are non-Python ones, and this
commit adds some that were missing: make, python3-stdeb. Also, we
explicitly install the base Qt5 libraries, in order to get the graphics
and C++ libraries that we can't get from PyPI.
2023-01-16 18:48:09 +02:00
Alex Pyrgiotis
e5ec5a279c
Separate Poetry dependencies into groups
Create two separate groups for Poetry dependencies:

1. test: Dependencies required for testing Dangerzone.
2. lint: Dependencies required for linting the code with `make lint`.
2022-12-15 18:28:10 +02:00
deeplow
361001579e
Bump version to v0.4.0 2022-12-01 15:58:01 +00:00
deeplow
99f23216d6
Fix limited PATH in produced .exe and .msi
Cx-Freeze 6.13.0 limited the PATH of the build executables, making it so
Dangerzone couldn't find Docker through shutil.which().

More information on the issue is available at:
https://github.com/marcelotduarte/cx_Freeze/issues/1674
2022-12-01 14:58:30 +00:00
deeplow
c6a0b59379
Add unit tests to cover archive-related methods
Additionally this adds the pytest-mock dev dependency to be able to mock
certain methods.
2022-11-24 11:16:34 +00:00
Guthrie McAfee Armstrong
e552411db2
Support Python 3.10
PySide2 5.15.2.1 added support for Python 3.10
2022-10-25 10:23:00 +01:00
deeplow
d5eefeab3d
report non-containerized code coverage 2022-09-13 13:17:22 +01:00
deeplow
9e3d404ed8
make test: add to Makefile & enabled parallel runs
parallel pytest via pytest-xdist
2022-09-13 13:08:01 +01:00
deeplow
4251d824ab
add pytest dep. for testing
The parameterizatin features of pytest over the default unittest
will be useful to reduce test code. Furthermore, pytest is already
used by folks at FPF so there won't be any learning curve if folks
want to work on it.
2022-09-13 13:07:15 +01:00
Guthrie McAfee Armstrong
36d96ccb5c
Add unit tests 2022-09-13 13:06:59 +01:00
deeplow
eabf7a9c18
bump version (0.3.2) & append to CHANGELOG.md 2022-08-25 09:23:40 +01:00
deeplow
bc7188eb4d
add dev dependency: PySide2-stubs
Mypy was returning many errors relating to PySide2, which didn't
make much sense. This is apparently because there are missing type
hinting stubs for PySide2.

The temporary solution is to add this devel dependency.

Upstream issue: (remove dep. when solved)
  - https://bugreports.qt.io/browse/PYSIDE-1675
2022-08-22 11:13:29 +01:00
deeplow
93392f8206
add mypy as dev dependency (type checking lint) 2022-08-22 10:30:35 +01:00
deeplow
b73efb30ae
add isort as dev dependency 2022-08-22 10:03:49 +01:00
Guthrie McAfee Armstrong
e63c931800
Remove psutil, termcolor, and wmi dependencies 2022-08-19 15:16:19 +01:00
Guthrie McAfee Armstrong
575c4b2302
Remove macholib dependency (fix #145) 2022-08-19 15:16:16 +01:00
Guthrie McAfee Armstrong
395eba0a74
Remove requests dependency 2022-08-19 15:16:14 +01:00
Micah Lee
17e1121e57
Version bump to 0.3.1 and update changelog 2021-12-14 10:27:41 -08:00
Micah Lee
bc8b9d62b4
Switch Windows package from pyinstaller to cx_freeze 2021-12-13 15:23:45 -08:00
Micah Lee
3e11dc11e0
Switch back to PyInstaller from PyPi 2021-11-29 15:04:20 -08:00
Micah Lee
317f2a03b5
Version bump to 0.3 2021-11-24 10:27:13 -08:00