run: |
sudo apt-get update
sudo apt-get install pandoc
+ python3 -m pip install --upgrade setuptools wheel pip
python3 -m pip install pytest mypy types-cryptography isort pyflakes
npm install -g pyright
- name: Test execution from current working directory (sudo call)
run: sudo python3 -m mkosi -h
- - name: Test user installation
- run: |
- python3 -m pip install --user .
- $HOME/.local/bin/mkosi -h
- python3 -m pip uninstall --yes mkosi
-
- - name: Test editable user installation
- run: |
- python3 -m pip install --user --no-use-pep517 --editable .
- $HOME/.local/bin/mkosi -h
- python3 -m pip uninstall --yes mkosi
-
- name: Test venv installation
run: |
python3 -m venv testvenv
+ testvenv/bin/python3 -m pip install --upgrade setuptools wheel pip
testvenv/bin/python3 -m pip install .
testvenv/bin/mkosi -h
+ rm -rf testenv
- - name: Test venv installation (sudo call)
+ - name: Test editable venv installation
run: |
- sudo testvenv/bin/mkosi -h
-
- - name: Test system installation
- run: |
- sudo python3 -m pip install .
- sudo mkosi -h
- sudo python3 -m pip uninstall --yes mkosi
+ python3 -m venv testvenv
+ testvenv/bin/python3 -m pip install --upgrade setuptools wheel pip
+ testvenv/bin/python3 -m pip install --editable .
+ testvenv/bin/mkosi -h
+ rm -rf testenv
- name: Test zipapp creation
run: |
- uses: actions/checkout@v3
- uses: ./
- - name: Install dependencies
- run: sudo apt-get update && sudo apt-get install --no-install-recommends python3-pexpect python3-pytest
-
- # Do a manual install so we have the latest changes from the pull request available.
+ # Make sure the latest changes from the pull request are used.
- name: Install
- run: sudo python3 -m pip install ..
+ run: sudo ln -svf $PWD/bin/mkosi /usr/bin/mkosi
+ working-directory: ./
- name: Configure ${{ matrix.distro }}/${{ matrix.format }}
run: |
EOF
- name: Build ${{ matrix.distro }}/${{ matrix.format }}
- run: python3 -m mkosi --debug build
+ run: mkosi --debug build
# systemd-resolved is enabled by default in Arch/Debian/Ubuntu (systemd default preset) but fails to
# start in a systemd-nspawn container with --private-users so we mask it out here to avoid CI failures.
- name: Boot ${{ matrix.distro }}/${{ matrix.format }} systemd-nspawn
if: matrix.format == 'disk' || matrix.format == 'directory'
- run: sudo python3 -m mkosi --debug boot
+ run: sudo mkosi --debug boot
- name: Boot ${{ matrix.distro }}/${{ matrix.format }} UEFI
if: matrix.format == 'disk'
- run: timeout -k 30 10m python3 -m mkosi --debug qemu
+ run: timeout -k 30 10m mkosi --debug qemu
+++ /dev/null
-README.md
\ No newline at end of file
- name: Install
shell: bash
- run: sudo python3 -m pip install ${{ github.action_path }}
+ run: sudo ln -svf ${{ github.action_path }}/bin/mkosi /usr/bin/mkosi
+[build-system]
+requires = ["setuptools", "setuptools-scm"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "mkosi"
+authors = [
+ {name = "mkosi contributors", email = "systemd-devel@lists.freedesktop.org"},
+]
+version = "14"
+description = "Build Bespoke OS Images"
+readme = "README.md"
+requires-python = ">=3.9"
+license = {file = "LICENSE"}
+
+[project.scripts]
+mkosi = "mkosi.__main__:main"
+
+[tool.setuptools]
+packages = ["mkosi"]
+
+[tool.setuptools.package-data]
+"*" = ["*.sh", "*.hook", "*.conf", "*.install"]
+
[tool.isort]
profile = "black"
+include_trailing_comma = true
multi_line_output = 3
py_version = "39"
[tool.pytest.ini_options]
asyncio_mode = "auto"
+
+[tool.mypy]
+python_version = 3.9
+# belonging to --strict
+warn_unused_configs = true
+disallow_any_generics = true
+disallow_subclassing_any = true
+disallow_untyped_calls = true
+disallow_untyped_defs = true
+disallow_untyped_decorators = true
+disallow_incomplete_defs = true
+check_untyped_defs = true
+no_implicit_optional = true
+warn_redundant_casts = true
+warn_unused_ignores = false
+warn_return_any = true
+no_implicit_reexport = true
+# extra options not in --strict
+pretty = true
+show_error_codes = true
+show_column_numbers = true
+warn_unreachable = true
+allow_redefinition = true
+strict_equality = true
+
+[[tool.mypy.overrides]]
+module = ["argcomplete"]
+ignore_missing_imports = true
+++ /dev/null
-[flake8]
-max-line-length = 119
-[isort]
-multi_line_output = 3
-include_trailing_comma = True
-[mypy]
-python_version = 3.9
-# belonging to --strict
-warn_unused_configs = True
-disallow_any_generics = True
-disallow_subclassing_any = True
-disallow_untyped_calls = True
-disallow_untyped_defs = True
-disallow_untyped_decorators = True
-disallow_incomplete_defs = True
-check_untyped_defs = True
-no_implicit_optional = True
-warn_redundant_casts = True
-warn_unused_ignores = False
-warn_return_any = True
-no_implicit_reexport = True
-# extra options not in --strict
-pretty = True
-show_error_codes = True
-show_column_numbers = True
-warn_unreachable = True
-allow_redefinition = True
-strict_equality = True
-[mypy-argcomplete]
-ignore_missing_imports = True
+++ /dev/null
-#!/usr/bin/python3
-# SPDX-License-Identifier: LGPL-2.1+
-
-from setuptools import setup, find_packages
-from setuptools.command.install import install
-
-
-class InstallCommand(install):
- def run(self):
- self.spawn(['pandoc', '-t', 'man', '-s', '-o', 'mkosi.1', 'mkosi.md'])
- install.run(self)
-
-
-setup(
- name="mkosi",
- version="14",
- description="Build Bespoke OS Images",
- url="https://github.com/systemd/mkosi",
- maintainer="mkosi contributors",
- maintainer_email="systemd-devel@lists.freedesktop.org",
- license="LGPLv2+",
- python_requires=">=3.9",
- packages = find_packages(".", exclude=["tests"]),
- package_data = {"": ["*.sh", "*.hook", "*.conf", "*.install"]},
- include_package_data = True,
- entry_points = { "console_scripts": ["mkosi = mkosi.__main__:main"] },
- cmdclass = { "install": InstallCommand },
- data_files = [('share/man/man1', ["mkosi.1"])],
-)