11 Commits
Author SHA1 Message Date
Oliver Hamlet 88cbaa58af Describe this repo as unmaintained in the readme
The libloot repo's Python wrapper is experimental and may not be kept, so link to a specific commit that has it and word the message to be true even if the wrapper is removed in the future.
2025-06-12 17:16:57 +01:00
Oliver Hamlet 900d5132ce Update actions/upload-artifact to v4 2025-04-29 22:53:34 +01:00
Oliver Hamlet 929d3ac659 Update Windows CI to windows-2025
windows-2019 will be fully retired by the end of June, and 2025 is the latest version.

This means that Windows build artifacts will be built using MSVC 2022, not MSVC 2019. They should be ABI-compatible across this change, since they expose no third-party types and Microsoft say that their compiler and standard library didn't break ABI between 2019 and 2022, but a newer version of the redistributable might be needed.
2025-04-29 22:40:08 +01:00
Oliver Hamlet ddc40b70e9 Replace use of set-output in GitHub Actions workflows
It's deprecated and will be disabled at some point.
2023-06-05 17:52:05 +01:00
Oliver Hamlet 43ba191ac5 Update GitHub Actions
To resolve deprecation warnings in workflows.
2023-06-05 17:49:53 +01:00
Oliver Hamlet 64293324c3 Stop uploading snapshot artifacts to Artifactory
The JFrog account that's used by the LOOT organisation will be
deactivated on 2023-07-02 because JFrog are sunsetting their free
accounts.
2023-06-05 17:34:29 +01:00
Oliver Hamlet 5a9179be1b Update pybind11 to 2.9.2
pybind11 2.6.0 increased the minimum required version of CMake to 3.4.
2022-07-02 17:00:47 +01:00
Oliver Hamlet 6f6b2269cf Migrate to windows-2019 GitHub Actions runners
windows-2016 was scheduled for removal in April 2022, though the
previous commit's build still worked.

This also means that the MSVC 2019 redistributable is now required.
Although libloot 0.15 is built with MSVC 2017, 2019 can link code
build with 2017 and the 2019 redistributable effectively replaces
the 2017 redistributable, so there's no compatibility issues.
2022-07-02 16:49:52 +01:00
Oliver Hamlet 024ab1f1e5 Drop support for Python 2.7
It's been end of life since January 2020.
2022-07-02 16:36:14 +01:00
Oliver Hamlet a7d26204a1 Replace Bintray with Artifactory
JFrog are closing down the former tomorrow.
2021-04-30 22:37:45 +01:00
Oliver Hamlet 8247ef9f62 Migrate CI to GitHub Actions 2021-02-14 15:19:12 +00:00
8 changed files with 205 additions and 105 deletions
+88
View File
@@ -0,0 +1,88 @@
name: CI
on:
push:
# Don't run this workflow when a tag is pushed.
branches:
- '*'
pull_request:
env:
MSVC_CONFIG: RelWithDebInfo
jobs:
windows:
runs-on: windows-2025
strategy:
matrix:
platform: [Win32, x64]
python-version: [3.7]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Python architecture
id: get-python-architecture
shell: bash
run: |
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=x86
else
PLATFORM=x64
fi
echo "architecture=$PLATFORM" >> $GITHUB_OUTPUT
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ steps.get-python-architecture.outputs.architecture }}
- name: Get descriptive version
id: get-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
SAFE_DESC_REF=${DESC_REF//[\/<>\"|]/_}
echo "version=$SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
cmake --build . --config ${{ env.MSVC_CONFIG }}
- name: Run tests
run: |
cd build
ctest -C ${{ env.MSVC_CONFIG }}
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack -C ${{ env.MSVC_CONFIG }}
VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=win32
else
PLATFORM=win64
fi
echo "filename=libloot-python-${VERSION}-${PLATFORM}.zip" >> $GITHUB_OUTPUT
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-archive.outputs.filename }}
path: build/package/${{ steps.build-archive.outputs.filename }}
if: github.event_name == 'push'
+92
View File
@@ -0,0 +1,92 @@
name: Release
on:
push:
tags: '*'
env:
MSVC_CONFIG: RelWithDebInfo
jobs:
create_release:
runs-on: ubuntu-18.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
git_tag: ${{ steps.get-git-tag.outputs.name }}
steps:
- name: Get Git tag
id: get-git-tag
run: echo "name=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-git-tag.outputs.name }}
release_name: libloot-python v${{ steps.get-git-tag.outputs.name }}
body: |
Requires Windows 7 or later and the [MSVC 2022 x86 redistributable](https://aka.ms/vs/17/release/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
windows:
runs-on: windows-2025
needs: create_release
strategy:
matrix:
platform: [Win32, x64]
python-version: [3.7]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get descriptive version
id: get-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
SAFE_DESC_REF=${DESC_REF//[\/<>\"|]/_}
echo "version=$SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
cmake --build . --config ${{ env.MSVC_CONFIG }}
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack -C ${{ env.MSVC_CONFIG }}
VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=win32
else
PLATFORM=win64
fi
echo "filename=libloot-python-${VERSION}-${PLATFORM}.zip" >> $GITHUB_OUTPUT
- name: Upload Archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/package/${{ steps.build-archive.outputs.filename }}
asset_name: ${{ steps.build-archive.outputs.filename }}
asset_content_type: application/x-7z-compressed
+7 -10
View File
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.1)
cmake_minimum_required (VERSION 3.4)
project (libloot-python)
include(ExternalProject)
@@ -40,7 +40,7 @@ configure_file("${CMAKE_SOURCE_DIR}/python/setup.py" "${CMAKE_BINARY_DIR}/genera
# pybind11
#######################################
set(PYBIND11_VERSION "2.4.2")
set(PYBIND11_VERSION "2.9.2")
set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz")
set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}.tar.gz")
set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}")
@@ -156,25 +156,22 @@ ENDIF ()
# Get version info using Git if available
find_package(Git)
IF (NOT DEFINED CPACK_PACKAGE_VERSION)
IF (GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --long --always
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --long --always --abbrev=7
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF (DEFINED ENV{APPVEYOR_REPO_BRANCH})
set(GIT_DESCRIBE_STRING "${GIT_DESCRIBE_STRING}_$ENV{APPVEYOR_REPO_BRANCH}")
ELSEIF (DEFINED ENV{TRAVIS_BRANCH})
set(GIT_DESCRIBE_STRING "${GIT_DESCRIBE_STRING}_$ENV{TRAVIS_BRANCH}")
ENDIF()
string(REPLACE "/" "-" GIT_DESCRIBE_STRING ${GIT_DESCRIBE_STRING})
ELSE()
SET (GIT_DESCRIBE_STRING "unknown-version")
ENDIF ()
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_VERSION "${GIT_DESCRIBE_STRING}-python$ENV{PYTHON_VERSION}")
ENDIF()
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/package")
include(CPack)
+7 -3
View File
@@ -1,20 +1,24 @@
libloot-python
==============
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/k2ugge3po7254o1o/branch/master?svg=true)](https://ci.appveyor.com/project/LOOT/libloot-python/branch/master)
**This repository is no longer maintained. A more complete and up to date Python wrapper can be found in the [libloot repository](https://github.com/loot/libloot/tree/aaacebefa053a6b7504bf61a73d2783a5436ca25/python).**
![CI](https://github.com/loot/libloot-python/workflows/CI/badge.svg?branch=master&event=push)
[![Documentation Status](https://readthedocs.org/projects/loot-api-python/badge/)](http://loot-api-python.readthedocs.io/)
A Python module that wraps libloot, generated by [pybind11](https://github.com/pybind/pybind11). Not everything in the API is exposed: coverage can be extended on request (or by pull request).
## Downloads
Snapshot builds are available on [Bintray](https://bintray.com/loot/snapshots/libloot-python). The snapshot build archives are named like so:
Releases are hosted on [GitHub](https://github.com/loot/libloot-python/releases).
Snapshot builds are available as artifacts from [GitHub Actions runs](https://github.com/loot/libloot-python/actions), though they are only kept for 90 days and can only be downloaded when logged into a GitHub account. The snapshot build archives are named like so:
```
libloot-python-<short revision ID>-python<python version>-win<architecture>.zip
```
For example `libloot-python-94de368-python2.7-win32.zip` was built using the revision with shortened commit ID `94de368`.
For example `libloot-python-94de368-python3.7-win32.zip` was built using the revision with shortened commit ID `94de368`.
## Documentation
-80
View File
@@ -1,80 +0,0 @@
os: Visual Studio 2017
version: "{build}-{branch}"
configuration: RelWithDebInfo
platform:
- Win32
- x64
environment:
bintray_auth_token:
secure: PgsEA6TjHVf718zMnK7J/fT1hUAVNKBeWhpYgYaeCyeZk37VT4Ics6j7+B7ElLEr
github_auth_token:
secure: yDqT5l/e5MntbW99V6+MHlfFgNv+UIogFfeyUVqtFk5lFRB/dAraLLwKCLl6y+DH
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.7
install:
- ps: (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Ortham/ci-scripts/2.0.0/delete_old_bintray_versions.py', "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py")
before_build:
- ps: $env:PYTHON_DIRECTORY_VERSION=$env:PYTHON_VERSION.Replace(".", "")
- cd %APPVEYOR_BUILD_FOLDER%
- ps: mkdir build
- cd build
- ps: |
if ($env:PLATFORM -eq 'Win32') {
cmake .. -G "Visual Studio 15 2017" -DPYTHON_EXECUTABLE="C:\Python${env:PYTHON_DIRECTORY_VERSION}\python.exe"
} else {
cmake .. -G "Visual Studio 15 2017" -A x64 -DPYTHON_EXECUTABLE="C:\Python${env:PYTHON_DIRECTORY_VERSION}-x64\python.exe"
}
build:
verbosity: minimal
project: 'c:\projects\libloot-python\build\libloot-python.sln'
test_script:
- cd %APPVEYOR_BUILD_FOLDER%\build
- ctest -C %CONFIGURATION%
after_test:
- cd %APPVEYOR_BUILD_FOLDER%\build
- cpack -C %CONFIGURATION%
- ps: $env:GIT_DESCRIBE = ((git describe --tags --long --always) | Out-String) -replace "`n|`r", ""
- ps: $env:PACKAGE_VERSION = $env:GIT_DESCRIBE + "_" + ($env:APPVEYOR_REPO_BRANCH.replace("/", "-"))
- ps: $env:ARCHITECTURE = $env:PLATFORM.substring($env:PLATFORM.length - 2)
artifacts:
- path: build\package\libloot-python-$(PACKAGE_VERSION)-python$(PYTHON_VERSION)-win$(ARCHITECTURE).zip
name: libloot-python
deploy:
- provider: BinTray
username: wrinklyninja
api_key:
secure: PgsEA6TjHVf718zMnK7J/fT1hUAVNKBeWhpYgYaeCyeZk37VT4Ics6j7+B7ElLEr
subject: loot
repo: snapshots
package: libloot-python
version: $(PACKAGE_VERSION)
publish: true
artifact: libloot-python
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
release: libloot-python v$(APPVEYOR_REPO_TAG_NAME)
description: |
Requires Windows 7 or later and the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
auth_token:
secure: yDqT5l/e5MntbW99V6+MHlfFgNv+UIogFfeyUVqtFk5lFRB/dAraLLwKCLl6y+DH
artifact: libloot-python
draft: false
on:
appveyor_repo_tag: true
on_success:
- ps: python "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py" -g loot/libloot-python -b loot/snapshots/libloot-python -u wrinklyninja -k $env:bintray_auth_token -t $env:github_auth_token -n 30
+1 -1
View File
@@ -3,7 +3,7 @@ libloot-python
This archive contains a build of the libloot-python wrapper module and its corresponding 32-bit Windows build of libloot.
The DLL requires the [MSVC 2017 x86 redistributable](https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe)
The DLL requires the [MSVC 2022 x86 redistributable](https://aka.ms/vs/17/release/vc_redist.x86.exe)
to be installed.
See the [online documentation](http://loot-api-python.readthedocs.org/) for more information.
+2 -2
View File
@@ -10,13 +10,13 @@ Build archives contain two binaries:
* ``loot.*.pyd`` is the Python wrapper
* ``loot.dll`` is the C++ library DLL that the Python wrapper was built against.
The C++ DLL requires the `Visual C++ 2017 Redistributable (x86)`_
The C++ DLL requires the `Visual C++ 2022 Redistributable (x86)`_
to be installed.
To use the wrapper, copy both files to wherever you want to import them from
(they must be in the same folder), and you're done!
.. _Visual C++ 2017 Redistributable (x86): https://download.visualstudio.microsoft.com/download/pr/749aa419-f9e4-4578-a417-a43786af205e/d59197078cc425377be301faba7dd87a/vc_redist.x86.exe
.. _Visual C++ 2022 Redistributable (x86): https://aka.ms/vs/17/release/vc_redist.x86.exe
Using the wrapper
=================
+1 -2
View File
@@ -79,11 +79,10 @@ setup(
distclass=BinaryDistribution,
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: C++'
'Operating System :: Microsoft :: Windows',
'Intended Audience :: Developers',
],
python_requires='>=2.7',
python_requires='>=3.7',
)