Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace setuptools bdist_rpm before its deprecation #298

Closed
deeplow opened this issue Dec 27, 2022 · 4 comments · Fixed by #538 or #994
Closed

Replace setuptools bdist_rpm before its deprecation #298

deeplow opened this issue Dec 27, 2022 · 4 comments · Fixed by #538 or #994
Assignees
Milestone

Comments

@deeplow
Copy link
Contributor

deeplow commented Dec 27, 2022

bdist_rpm, our current .rpm packaging tool is on its way to the grave. We need to replace it before deprecation. The deprecation reasoning is that the setuptools devs want to focus only on supporting building for pypi.

@deeplow
Copy link
Contributor Author

deeplow commented Dec 27, 2022

CxFreeze (our packaging method MacOS) have merged the code from bdist_rpm into their code base in preparation for this deprecation.

Using CxFreeze for .rpm packaging may turn out to be a viable solution.

@apyrgio apyrgio added this to the 0.5.0 milestone Jun 13, 2023
@deeplow deeplow self-assigned this Aug 23, 2023
@deeplow
Copy link
Contributor Author

deeplow commented Aug 23, 2023

Turns out that bdist_rpm is preventing execution of new Dangerzone installations (see #514). Rather than fix it, we will do our own RPM packaging, which would need to happen anyhow due to the present issue.

@deeplow
Copy link
Contributor Author

deeplow commented Aug 23, 2023

Python RPM packaging findings

RPM packaging python packages has had recent changes, according to the docs:

This version of Python Packaging Guidelines is in effect since 2021 and represents a major rewrite and paradigm shift. Not all packages are updated to reflect this.

In particular rpmbuild can now generate Fedora dependencies from our pyproject.toml file (in theory).

The python3 macros are documented here.

@apyrgio
Copy link
Contributor

apyrgio commented Aug 31, 2023

pyproject.toml vs setup.py

The modern Python and Fedora packaging guidelines use pyproject.toml as the source of truth for creating Python packages, instead of setup.py:

Our pyproject.toml currently misses a few things before it can be used to create a Python source distribution (tarball). Namely, it does not include non-Python data files.

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 (see python-poetry/poetry#890) especially point (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.

Ultimately, we have to accept this Poetry shortcoming and include package data in our source distributions unconditionally, and without specifying a target installation path.

apyrgio added a commit that referenced this issue Aug 31, 2023
Replace the deprecated `bdist_rpm` method of creating RPMs for
Dangerzone. Instead, update our `install/linux/build-rpm.py` script, to
build Dangerzone RPMs using our SPEC file under
`install/linux/dangerzone.spec`. The script now essentially creates a
source distribution (sdist) using `poetry build`, and then uses
`rpmbuild` to create binary and source RPMs.

Fixes #298
apyrgio added a commit that referenced this issue Aug 31, 2023
Replace the deprecated `bdist_rpm` method of creating RPMs for
Dangerzone. Instead, update our `install/linux/build-rpm.py` script, to
build Dangerzone RPMs using our SPEC file under
`install/linux/dangerzone.spec`. The script now essentially creates a
source distribution (sdist) using `poetry build`, and then uses
`rpmbuild` to create binary and source RPMs.

Fixes #298
apyrgio added a commit that referenced this issue Aug 31, 2023
Replace the deprecated `bdist_rpm` method of creating RPMs for
Dangerzone. Instead, update our `install/linux/build-rpm.py` script, to
build Dangerzone RPMs using our SPEC file under
`install/linux/dangerzone.spec`. The script now essentially creates a
source distribution (sdist) using `poetry build`, and then uses
`rpmbuild` to create binary and source RPMs.

Fixes #298
apyrgio added a commit that referenced this issue Aug 31, 2023
Replace the deprecated `bdist_rpm` method of creating RPMs for
Dangerzone. Instead, update our `install/linux/build-rpm.py` script, to
build Dangerzone RPMs using our SPEC file under
`install/linux/dangerzone.spec`. The script now essentially creates a
source distribution (sdist) using `poetry build`, and then uses
`rpmbuild` to create binary and source RPMs.

Fixes #298
apyrgio added a commit that referenced this issue Aug 31, 2023
Replace the deprecated `bdist_rpm` method of creating RPMs for
Dangerzone. Instead, update our `install/linux/build-rpm.py` script, to
build Dangerzone RPMs using our SPEC file under
`install/linux/dangerzone.spec`. The script now essentially creates a
source distribution (sdist) using `poetry build`, and then uses
`rpmbuild` to create binary and source RPMs.

Fixes #298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants