[BUILDING] Add doc. and CI steps for standalone building with Nuitka #243
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Integration | |
on: [push, pull_request] | |
jobs: | |
python_test: | |
name: Run against Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CLICOLOR_FORCE: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- 'macOS-latest' | |
- 'ubuntu-latest' | |
python-version: | |
# - '3.7' | |
# - '3.8' | |
- '3.9' | |
# - '3.10' | |
- '3.11' | |
- '3.12-dev' | |
- 'pypy3.9' | |
include: | |
- os: 'ubuntu-20.04' | |
python-version: '3.6' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install required dependencies for standalone builds | |
run: | | |
sudo apt update && sudo apt install -y patchelf | |
python -m pip install --upgrade pip setuptools | |
pip install nuitka pex stickytape pyinstaller | |
- name: Install module regularly | |
run: pip install . | |
- name: Simple module executions | |
run: | | |
time archey | |
time python -m archey | |
- name: Run our test suite | |
run: python -m unittest | |
# Currently disabled against Python 3.12. | |
- name: Standalone building (with Nuitka) | |
if: ${{ matrix.python-version != '3.12-dev' }} | |
run: | | |
python -m nuitka \ | |
--onefile \ | |
--include-package=archey.logos \ | |
--output-filename=archey \ | |
--output-dir=dist \ | |
--quiet \ | |
archey/__main__.py | |
time ./dist/archey | |
rm dist/archey | |
# Currently disabled against Python 3.12. | |
- name: Standalone building (with PEX) | |
if: ${{ matrix.python-version != '3.12-dev' }} | |
run: | | |
pex \ | |
-o dist/archey \ | |
-m archey \ | |
. | |
time ./dist/archey | |
rm dist/archey | |
- name: Standalone building (with Stickytape) | |
run: | | |
stickytape \ | |
--copy-shebang \ | |
--add-python-path . \ | |
--output-file dist/archey \ | |
--add-python-module archey.logos."$(python -c 'import distro; print(distro.id())')" \ | |
archey/__main__.py | |
chmod +x dist/archey | |
time ./dist/archey | |
rm dist/archey | |
# Disabled against PyPy (see <https://stackoverflow.com/a/22245203>). | |
# Currently disabled against Python 3.12. | |
- name: Standalone building (with PyInstaller) | |
if: ${{ matrix.python-version != 'pypy3.9' && matrix.python-version != '3.12-dev' }} | |
run: | | |
pyinstaller \ | |
--distpath dist \ | |
--specpath dist \ | |
--name archey \ | |
--onefile archey/__main__.py \ | |
--hidden-import archey.logos."$(python -c 'import distro; print(distro.id())')" \ | |
--log-level WARN | |
time ./dist/archey | |
rm dist/archey | |
python_lint: | |
name: Lint Python sources | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install lint tools and project (for its dependencies) | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint pylint-secure-coding-standard mypy black isort | |
pip install . | |
- name: Lint sources against Pylint | |
run: pylint archey/ | |
- name: Lint sources against Mypy | |
run: mypy archey/ | |
- name: Run isort | |
run: isort --check --diff archey/ | |
- name: Run Black | |
run: black --check --diff archey/ | |
shell: | |
name: Lint packaging shell scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: shellcheck packaging/* | |
man: | |
name: Lint manual page | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: sudo apt update && sudo apt install -y groff | |
- run: | | |
groff -man -Tascii -z archey.1 2&>1 | tee errors | |
test ! -s errors |