Conversation
Add the initial debian/control file necessary for packaging debsbom for Debian. The source and binary package names are chosen based on how a handful of other Python tools are packaged [0][1][2], that is, "debsbom" for both. It should be noted that the X-Python3-Version field for the source package stanza is added, as suggested by the Debian Python packaging policy [3]. [0]: https://salsa.debian.org/python-team/packages/black/-/blob/592940bceecc090ff019c7e059a43f7590762442/debian/control [1]: https://salsa.debian.org/python-team/packages/ruff/-/blob/3754df1dd55b476f470a88d24be5fe9a40177c4b/debian/control [2]: https://salsa.debian.org/python-team/packages/mypy/-/blob/300f8d49ab58945999a93556364102662f0fc0cc/debian/control [3]: https://www.debian.org/doc/packaging-manuals/python-policy/index.html#specifying-supported-versions Signed-off-by: Max R. Carrara <max@aequito.sh>
"3.0 (quilt)" is the recommended format for this type of package [1]. [1]: https://wiki.debian.org/Projects/DebSrc3.0 Signed-off-by: Max R. Carrara <max@aequito.sh>
fmoessbauer
left a comment
There was a problem hiding this comment.
Many thanks for providing this debianization. Once we have the next release, I will integrate that into the repo on salsa.
PS: Of course I will keep your signed-off.
debian/copyright
Outdated
| Stavros Korokithakis <hi@stavros.io> | ||
| Sunil Kapil <snlkapil@gmail.com> | ||
| Vishwas B Sharma <sharma.vishwas88@gmail.com> | ||
| Zsolt Dollenstein <zsol.zsol@gmail.com> |
There was a problem hiding this comment.
Hi @Aequitosh , how did you create this list of copyright holders? A quick check on my side just has the following ones:
git shortlog --summary --numbered --email
250 Felix Moessbauer <felix.moessbauer@siemens.com>
106 Christoph Steiger <christoph.steiger@siemens.com>
39 Tamino Larisch <tamino.larisch@siemens.com>
9 Max R. Carrara <max@aequito.sh>
2 Syeda Shagufta Naaz <syedashagufta.naaz@siemens.com>
2 badrikesh prusty <badrikesh.prusty@siemens.com>
There was a problem hiding this comment.
Using decopy. Since it seemed like the only tool to actually generate files without distorted or otherwise buggy / glitchy output, and also because it seemed to be in line with black's copyright file, I assumed it was fine. Fine here meaning that the people listed there were correctly attributed.
You did just make me double-check though, and other Python packages' copyright files don't look similar at all... Now I do wonder why / how decopy generated the list the way it did. Surely we don't have to attribute some Python core team members and other Python package developers / maintainers here, do we?
I'll see if I can find a different tool that's maybe a bit more transparent for copyright review. I'll fix things up here too.
debian/copyright
Outdated
| Comment: See LICENSE | ||
|
|
||
| Files: debian/* | ||
| Copyright: 2018-2021, Neil Williams <codehelp@debian.org> |
There was a problem hiding this comment.
Same here, where does this come from?
debian/rules
Outdated
| http_proxy="127.0.0.1:9" \ | ||
| https_proxy="127.0.0.1:9" \ | ||
| make -C docs/ html SPHINXBUILD="$(SPHINXBUILD)" SPHINXOPTS="-j4" && \ | ||
| make -C docs/ man SPHINXBUILD="$(SPHINXBUILD)" SPHINXOPTS="-j4" |
There was a problem hiding this comment.
Do we really need parallel builds? If so, we probably would want to implement it similar to the example in the policy 4.9.1:
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
There was a problem hiding this comment.
Hm, given that the docs aren't that huge, I might just toss the flag out and keep things simple.
Thanks for pointing me to that part of the policy though, that might actually be helpful for some other (unrelated) stuff I've been working on here and there!
|
@fmoessbauer Quick update on the I've ran the initial generation of decopy debian src tests scriptsSimply because its manpage states:
However, when running it with After fiddling around with it for a bit, I figured out that supplying any positional arguments at all messes with its in-/exclusion logic. The correct way to hold it is as follows: decopy --exclude '^(build|\.venv|\.mypy_cache|\.pytest_cache|\.github|dist)/*'Add any additional directories to the regex that you want to exclude. Note that if you supply any positional arguments, Anyhow, the command above yields the following: This obviously makes much more sense, though it needs a little tidying up. (I don't know why I looked at the initial |
Add debian/copyright, which was initially generated using `decopy` [0]
and slightly modified to ensure correctness.
For reference, the complete command used to yield the initial
debian/copyright file is as follows:
decopy --exclude '^(build|\.venv|\.mypy_cache|\.pytest_cache|\.github|dist)/*'
This command should be used to keep the debian/copyright file updated
as the repository grows. Any directories not actually part of the
source tree should be added to the regex of the `--exclude` flag in
order to ensure correctness of the copyright file. In particular, it
avoids inclusion of copyright holders that have not actually
contributed to the repository, but are instead found in dependencies
or similar (e.g. inside a virtual environment in `.venv/`).
Signed-off-by: Max R. Carrara <max@aequito.sh>
Add debian/rules and configure pybuild [0]. In particular, ensure that pybuild runs the tests using pytest and puts the files to be packaged into the debian/debsbom directory. Furthermore, disable tests that require network access through the PYBUILD_TEST_ARGS env var. Luckily, all tests that require network access have already been marked as such, which is why this is quite straightforward. [0]: https://wiki.debian.org/Python/Pybuild Signed-off-by: Max R. Carrara <max@aequito.sh>
Generate the HTML docs as well as manpages in debian/rules. Package the HTML docs under a new binary Debian package named `python-debsbom-doc`. Note that the `http_proxy` and `https_proxy` env vars are passed to sphinx so that it doesn't try to do any intersphinx mappings, as network access is prohibited by Debian policy. Furthermore, add `debian/debsbom.manpages` so that the Debian tooling can figure out what manpages to package. Also add `debian/python-debsbom-doc.install` for the HTML docs. Finally, add proper `Recommends` fields for both `debsbom` and `python-debsbom-doc` packages, each pointing to the other one for discoverability's sake. Signed-off-by: Max R. Carrara <max@aequito.sh>
2095c4b to
27b8dde
Compare
|
Alright, everything should hopefully be correct now. To summarize:
|
|
Many thanks @Aequitosh for preparing the initial packaging. I kept your parts as-is and added further packaging tweaks (and adoptions to the latest version) on top. The result is now maintained on https://salsa.debian.org/python-team/packages/debsbom and also available under https://mentors.debian.net/package/debsbom/. |
Set up initial Debian packaging for
debsbom.Note: Depends on PRs #155 and #156.
In summary, this PR does the following:
debsbomdebian/controlfiles of other Python packages in Debian. Not sure what the actual policy is here; I decided to remain more specific here instead of being too lax. It's always easier to relax version requirements later on.python3-spdx-tools. This is deliberate, as this doesn't (yet?) exist in trixie as of writing.debsbom, containing thedebsbomCLIpython3-spdx-tools, for the same reasons as stated for the source package above.python-debsbom-doc, containing the docs (duh)As always, the commit messages contain additional (all necessary) details. They should hopefully serve as enough of an explanation of everything—if not, please don't hesitate to give a holler.
The only thing lacking here is the
debian/changelogfile, I'll leave that to you. 😉Also, as mentioned off-GitHub, this PR shan't be merged; instead, its commits will (eventually) land in the Debian Salsa repository for
debsbom. If there's anything you need me to change or adapt beforehand, please let me know.(Also, should go without saying, but please keep my
Signed-off-bytrailers and such around when you yeet this onto Salsa, thanks! 😇)