-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c44186
commit 5ce91e3
Showing
8 changed files
with
178 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Build from source using tox. | ||
name: build_tox | ||
on: [push, pull_request] | ||
permissions: read-all | ||
jobs: | ||
build_tox: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: '3.7' | ||
toxenv: 'py37' | ||
- python-version: '3.8' | ||
toxenv: 'py38' | ||
- python-version: '3.9' | ||
toxenv: 'py39' | ||
- python-version: '3.10' | ||
toxenv: 'py310' | ||
- python-version: '3.11' | ||
toxenv: 'py311' | ||
- python-version: '3.12' | ||
toxenv: 'py312' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install build dependencies | ||
run: | | ||
sudo add-apt-repository universe && | ||
sudo add-apt-repository -y ppa:deadsnakes/ppa && | ||
sudo add-apt-repository -y ppa:gift/dev && | ||
sudo apt-get update && | ||
sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools | ||
- name: Install tox | ||
run: | | ||
python3 -m pip install tox | ||
- name: Download test data | ||
run: | | ||
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi | ||
- name: Prepare build | ||
run: | | ||
./synclibs.sh --use-head && ./autogen.sh | ||
- name: Build Python wheel | ||
run: | | ||
tox -e${{ matrix.toxenv }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
name = liblnk-python | ||
version = @VERSION@ | ||
description = Python bindings module for liblnk | ||
long_description = Python bindings module for liblnk | ||
author = Joachim Metz | ||
author_email = [email protected] | ||
license = GNU Lesser General Public License v3 or later (LGPLv3+) | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Script to run Python test scripts. | ||
# | ||
# Copyright (C) 2009-2023, Joachim Metz <[email protected]> | ||
# | ||
# Refer to AUTHORS for acknowledgements. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser 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 Lesser General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import glob | ||
import os | ||
import sys | ||
import unittest | ||
|
||
|
||
if __name__ == "__main__": | ||
print(f"Using Python version {sys.version!s}") | ||
|
||
test_loader = unittest.TestLoader() | ||
test_runner = unittest.TextTestRunner(verbosity=2) | ||
|
||
test_scripts = test_loader.discover("tests", pattern="*.py") | ||
|
||
test_profile = ".pylnk" | ||
input_glob = "*.lnk" | ||
|
||
ignore_list = set() | ||
|
||
ignore_file_path = f"tests/input/{test_profile}/ignore" | ||
if os.path.isfile(ignore_file_path): | ||
with open(ignore_file_path, "r", encoding="utf-8") as file_object: | ||
ignore_list = set([line.strip() for line in file_object.readlines()]) | ||
|
||
source_file = None | ||
|
||
for test_set in glob.glob("tests/input/*"): | ||
test_set = test_set.rsplit('/', maxsplit=1)[-1] | ||
if not test_set or test_set[0] == '.' or test_set in ignore_list: | ||
continue | ||
|
||
source_files = glob.glob(f"tests/input/{test_set:s}/{input_glob:s}") | ||
if source_files: | ||
source_file = source_files[0] | ||
break | ||
|
||
setattr(unittest, "source", source_file) | ||
|
||
test_results = test_runner.run(test_scripts) | ||
if not test_results.wasSuccessful(): | ||
sys.exit(1) |
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
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