Compare commits

..
14 Commits
Author SHA1 Message Date
arcanis 198b9d4f5d move fixtures to __init__.py 2026-07-17 00:53:38 +03:00
arcanis da1ded5c0e fix setup script 2026-07-16 23:29:59 +03:00
arcanis 7f7e5da2d5 move root conftest into pytest plugins 2026-07-16 23:07:33 +03:00
arcanis 7c7b4a86af some play with renaming 2026-07-16 23:07:33 +03:00
arcanis ce985e6a7c cleanup pyproject 2026-07-16 23:07:33 +03:00
arcanis 6b21516f9d reformat tomls 2026-07-16 23:07:33 +03:00
arcanis 48511bc3f2 fix tox environments 2026-07-16 23:07:33 +03:00
arcanis 2233002ad3 fix docs generation 2026-07-16 23:07:33 +03:00
arcanis 11ed790ff2 straight forward conftest 2026-07-16 23:07:33 +03:00
arcanis 2be82611bf generic fixtures 2026-07-16 23:07:33 +03:00
arcanis a9767c3583 reorder tests 2026-07-16 23:07:33 +03:00
arcanis d02ed8627d migrate to hatch 2026-07-16 23:07:33 +03:00
arcanis f12278a31d build: reorganize scripts 2026-07-16 23:07:09 +03:00
arcanis 3492892cd2 build: replace deprecated ::set-output with GITHUB_OUTPUT 2026-07-08 15:01:06 +03:00
7 changed files with 55 additions and 37 deletions
@@ -26,10 +26,10 @@ cp "docker/systemd-nspawn.sh" "/usr/local/bin/systemd-nspawn"
# create fresh tarball # create fresh tarball
tox -e archive tox -e archive
# run makepkg # run makepkg
PKGVER=$(python -c "from src.ahriman import __version__; print(__version__)") PKGVER=$(PYTHONPATH=ahriman-core/src python -c "from ahriman import __version__; print(__version__)")
mv "dist/ahriman-$PKGVER.tar.gz" package/archlinux mv "dist/ahriman-$PKGVER.tar.gz" archlinux
chmod +777 package/archlinux # because fuck you that's why chmod +777 archlinux # because fuck you that's why
cd package/archlinux cd archlinux
sudo -u nobody -- makepkg -cf --skipchecksums --noconfirm sudo -u nobody -- makepkg -cf --skipchecksums --noconfirm
sudo -u nobody -- makepkg --packagelist | grep "ahriman-core-$PKGVER" | pacman -U --noconfirm --nodeps - sudo -u nobody -- makepkg --packagelist | grep "ahriman-core-$PKGVER" | pacman -U --noconfirm --nodeps -
if [[ -z $MINIMAL_INSTALL ]]; then if [[ -z $MINIMAL_INSTALL ]]; then
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
- name: Set image date - name: Set image date
id: args id: args
run: echo "::set-output name=date::$(date -d yesterday +'%Y-%m-%d')" run: echo "date=$(date -d yesterday +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Login to docker hub - name: Login to docker hub
uses: docker/login-action@v3 uses: docker/login-action@v3
+2 -2
View File
@@ -26,7 +26,7 @@ jobs:
- name: Extract version - name: Extract version
id: version id: version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Create changelog - name: Create changelog
id: changelog id: changelog
@@ -38,7 +38,7 @@ jobs:
- name: Create archive - name: Create archive
run: tox -e archive run: tox -e archive
env: env:
VERSION: ${{ steps.version.outputs.VERSION }} VERSION: ${{ steps.version.outputs.version }}
- name: Publish release - name: Publish release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
+2 -2
View File
@@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup the minimal service in arch linux container - name: Setup the minimal service in arch linux container
run: .github/workflows/setup.sh minimal run: .github/scripts/setup.sh minimal
run-setup: run-setup:
@@ -43,4 +43,4 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup the service in arch linux container - name: Setup the service in arch linux container
run: .github/workflows/setup.sh run: .github/scripts/setup.sh
-1
View File
@@ -1 +0,0 @@
"""Repository-local pytest plugins."""
@@ -1,3 +1,22 @@
#
# Copyright (c) 2021-2025 ahriman team.
#
# This file is part of ahriman
# (see https://github.com/arcan1s/ahriman).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import argparse import argparse
import datetime import datetime
import pytest import pytest
@@ -132,7 +151,7 @@ def pytest_configure() -> None:
# generic fixtures # generic fixtures
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def register_log_context() -> None: def _register_log_context() -> None:
""" """
register log context variables and factory register log context variables and factory
""" """
@@ -151,31 +170,6 @@ def args() -> argparse.Namespace:
repository=None, repository_id=None, wait_timeout=-1) repository=None, repository_id=None, wait_timeout=-1)
@pytest.fixture
def gpg(configuration: Configuration) -> GPG:
"""
fixture for empty GPG
Args:
configuration(Configuration): configuration fixture
Returns:
GPG: GPG test instance
"""
return GPG(configuration)
@pytest.fixture
def parser() -> argparse.ArgumentParser:
"""
fixture for command line arguments parser
Returns:
argparse.ArgumentParser: command line arguments parser instance
"""
return _parser()
@pytest.fixture @pytest.fixture
def aur_package_ahriman() -> AURPackage: def aur_package_ahriman() -> AURPackage:
""" """
@@ -324,6 +318,20 @@ def database(configuration: Configuration, mocker: MockerFixture) -> SQLite:
return SQLite.load(configuration) return SQLite.load(configuration)
@pytest.fixture
def gpg(configuration: Configuration) -> GPG:
"""
fixture for empty GPG
Args:
configuration(Configuration): configuration fixture
Returns:
GPG: GPG test instance
"""
return GPG(configuration)
@pytest.fixture @pytest.fixture
def local_client(database: SQLite, configuration: Configuration) -> Client: def local_client(database: SQLite, configuration: Configuration) -> Client:
""" """
@@ -493,6 +501,17 @@ def package_description_python2_schedule() -> PackageDescription:
) )
@pytest.fixture
def parser() -> argparse.ArgumentParser:
"""
fixture for command line arguments parser
Returns:
argparse.ArgumentParser: command line arguments parser instance
"""
return _parser()
@pytest.fixture @pytest.fixture
def remote_source() -> RemoteSource: def remote_source() -> RemoteSource:
""" """
+1 -1
View File
@@ -15,4 +15,4 @@ classifiers = [
ahriman-fixtures = "ahriman_fixtures" ahriman-fixtures = "ahriman_fixtures"
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["."] packages = ["ahriman_fixtures"]