1
0
mirror of https://github.com/python-LimeReport/python-LimeReport.git synced 2025-09-07 02:02:23 +03:00

Compare commits

...

5 Commits

Author SHA1 Message Date
5446ebc280 fix actions 2024-07-25 14:58:01 +03:00
3faa8d8a27 fix actions 2024-07-25 14:37:58 +03:00
96274c721a update actions 2024-07-25 14:29:03 +03:00
e9c8701407 fix 2024-07-25 14:07:28 +03:00
badb96d054 try fix build 2024-07-25 14:03:15 +03:00
3 changed files with 46 additions and 11 deletions

View File

@ -17,7 +17,7 @@ jobs:
qt: [6.4.2, 6.7.2]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
@ -37,8 +37,9 @@ jobs:
LIMEREPORT_USE_ZINT: ${{ matrix.zint }}
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-sdist-${{ matrix.qt }}-${{ matrix.zint }}
path: dist/*.tar.gz
build_wheels:
@ -51,7 +52,7 @@ jobs:
os: [ubuntu-20.04, windows-2019]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
@ -98,8 +99,9 @@ jobs:
python cibuildwheel/before_build.py
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-whl-${{ matrix.qt }}-${{ matrix.zint }}-${{ matrix.os }}
path: ./wheelhouse/*.whl
release:
@ -112,19 +114,16 @@ jobs:
contents: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download artifact
uses: actions/download-artifact@v3
- name: Download artifacts
uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- name: Github Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(github.ref, '.dev') }}
files: dist/*
files: dist/**/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

View File

@ -3,6 +3,7 @@ requires = [
"cmake>=3.18",
"setuptools>=42",
"wheel",
"packaging",
"shiboken6==6.4.2",
"PySide6==6.4.2",
"shiboken6_generator==6.4.2",

View File

@ -27,18 +27,24 @@
# see https://www.gnu.org/licenses/.
#
import importlib
import os
import re
import shutil
import subprocess
import sys
from pathlib import Path
import platform
import tempfile
import PySide6
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
from wheel.bdist_wheel import bdist_wheel
from packaging import version
import shiboken6
USE_ZINT_ENV_KEY = 'LIMEREPORT_USE_ZINT'
@ -109,6 +115,35 @@ class CMakeExtension(Extension):
self.write_top_level_init = write_top_level_init
class BuildExt(build_ext):
def run(self):
pyside_version = PySide6.__version__
if version.parse(pyside_version) >= version.parse("6.7.0"):
self.clone_and_copy_pyside_docs(pyside_version)
super().run()
def clone_and_copy_pyside_docs(self, pyside_version):
repo_url = "https://code.qt.io/pyside/pyside-setup.git"
branch = f"v{pyside_version}"
pyside_path = Path(importlib.util.find_spec("PySide6").origin).parent
target_dir = pyside_path / "doc"
target_dir.mkdir(exist_ok=True)
with tempfile.TemporaryDirectory() as tmpdirname:
print(f"Cloning PySide repository (branch {branch}) to {tmpdirname}...")
try:
subprocess.run(["git", "clone", "-b", branch, "--depth", "1", repo_url, tmpdirname], check=True)
except subprocess.CalledProcessError:
print(f"Warning: Branch {branch} not found. Falling back to main branch.")
subprocess.run(["git", "clone", "--depth", "1", repo_url, tmpdirname], check=True)
source_dir = Path(tmpdirname) / "sources" / "pyside6" / "PySide6" / "doc"
print(f"Copying doc files from {source_dir} to {target_dir}")
for item in source_dir.glob('*'):
if item.is_file():
shutil.copy2(item, target_dir)
print("Doc files copied successfully")
def build_extension(self, ext: CMakeExtension) -> None:
# Must be in this form due to bug in .resolve() only fixed in Python 3.10+
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name)