-
Notifications
You must be signed in to change notification settings - Fork 69
Modern Python packaging #147
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
Changes from all commits
909e16c
58bad8c
c6e3143
af80340
7d34abe
231abcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[meson.build] | ||
indent_style = space | ||
indent_size = 8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,55 +2,64 @@ | |
# vi: ts=2 sw=2 et: | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
# | ||
name: Build test | ||
name: Build | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- feature/meson-build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just to make GH Action run on my fork repo when I push the code. |
||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ matrix.python }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-22.04", "ubuntu-24.04"] | ||
python: [ | ||
"3.7", | ||
"3.8", | ||
"3.9", | ||
"3.10", | ||
"3.11.0-rc.1", | ||
"3.11", | ||
"3.12", | ||
"3.13", | ||
] | ||
name: Python ${{ matrix.python }} | ||
exclude: | ||
- os: "ubuntu-22.04" | ||
python: "3.13" | ||
- os: "ubuntu-24.04" | ||
python: "3.7" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3.7 is very old at this point. I guess we could drop that. But OTOH, the code will work fine with those old versions, so it should be fine to keep testing and supporting those old versions until there's some particular reason to raise the minimum. |
||
runs-on: ${{ matrix.os }} | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ matrix.python }}-${{ matrix.os }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
name: Python ${{ matrix.python }} on ${{ matrix.os }} | ||
steps: | ||
- name: Repository checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x64 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install gcc libsystemd-dev | ||
python -m pip install pytest sphinx | ||
sudo apt -y install gcc libsystemd-dev universal-ctags | ||
|
||
- name: Build (Python ${{ matrix.python }}) | ||
run: | | ||
set -x | ||
make -j | ||
make doc SPHINXOPTS="-W -v" | ||
|
||
- name: Test (Python ${{ matrix.python }}) | ||
run: | | ||
make check | ||
uv build | ||
uv sync --no-editable | ||
cd _build | ||
uv run --no-editable --group docs -m sphinx -b html -W -v ../docs html |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- feature/meson-build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? |
||
pull_request: | ||
branches: | ||
- main | ||
|
@@ -18,7 +19,7 @@ permissions: | |
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
@@ -33,21 +34,24 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: +security-extended,security-and-quality | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install gcc libsystemd-dev | ||
sudo apt -y install gcc libsystemd-dev universal-ctags | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
uses: github/codeql-action/analyze@v3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ | |
# vi: ts=2 sw=2 et: | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
# | ||
name: Install test | ||
name: Install then test | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- feature/meson-build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? |
||
|
||
permissions: | ||
contents: read | ||
|
@@ -24,16 +25,14 @@ jobs: | |
container: [ | ||
"archlinux:latest", | ||
"debian:testing", | ||
"quay.io/centos/centos:stream8", | ||
"quay.io/centos/centos:stream10", | ||
"quay.io/fedora/fedora:rawhide", | ||
"ubuntu:focal", | ||
"ubuntu:noble", | ||
] | ||
container: | ||
image: ${{ matrix.container }} | ||
name: ${{ matrix.container }} | ||
steps: | ||
- name: Repository checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
|
@@ -51,10 +50,14 @@ jobs: | |
|
||
case "$DIST_ID" in | ||
arch) | ||
pacman --noconfirm -Sy "${DEPS_COMMON[@]}" systemd-libs | ||
python3 -m ensurepip | ||
pacman --noconfirm -Sy -u "${DEPS_COMMON[@]}" systemd-libs python-pip | ||
;; | ||
centos) | ||
dnf config-manager --set-enabled crb | ||
dnf install -y epel-release | ||
dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip | ||
;; | ||
centos|fedora) | ||
fedora) | ||
dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip | ||
;; | ||
ubuntu|debian) | ||
|
@@ -66,13 +69,23 @@ jobs: | |
exit 1 | ||
esac | ||
|
||
python3 -m pip install pytest sphinx | ||
python3 -m pip install --break-system-packages build pytest | ||
|
||
- name: Fix Git config to satisfy Meson | ||
run: git config --global safe.directory "*" | ||
|
||
# Checkout repo after installing Git, or the "checkout" GH Action will download our source as non-Git repo, making Meson fail | ||
# to build Python source dist. | ||
- name: Repository checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build & install | ||
- name: Install & test | ||
shell: bash | ||
run: | | ||
set -x | ||
python3 -m pip install -I -v . | ||
git --version | ||
python3 -m build | ||
python3 -m pip install --break-system-packages . | ||
# Avoid importing the systemd module from the git repository | ||
cd / | ||
python3 -c 'from systemd import journal; print(journal.__version__)' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
__pycache__/ | ||
*.py[co] | ||
/journald/*.so | ||
/TAGS | ||
TAGS | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
_build | ||
build | ||
Comment on lines
+10
to
11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see both |
||
eggs | ||
parts | ||
|
@@ -16,6 +17,7 @@ sdist | |
develop-eggs | ||
.installed.cfg | ||
MANIFEST | ||
.venv | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
@@ -30,3 +32,6 @@ pip-log.txt | |
|
||
#Mr Developer | ||
.mr.developer.cfg | ||
|
||
# Zed | ||
.zed |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer this file to be added first, so that the meson file is not reformatted in the middle of the series.