mirror of
https://github.com/loot/libloot-python.git
synced 2026-07-27 14:14:13 -07:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88cbaa58af | ||
|
|
900d5132ce | ||
|
|
929d3ac659 | ||
|
|
ddc40b70e9 | ||
|
|
43ba191ac5 | ||
|
|
64293324c3 | ||
|
|
5a9179be1b | ||
|
|
6f6b2269cf | ||
|
|
024ab1f1e5 | ||
|
|
a7d26204a1 | ||
|
|
8247ef9f62 |
@@ -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'
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
libloot-python
|
||||
==============
|
||||
|
||||
[](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).**
|
||||
|
||||

|
||||
[](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
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user