mirror of
https://github.com/python-LimeReport/python-LimeReport.git
synced 2025-09-07 18:12:20 +03:00
Compare commits
5 Commits
6707b1dd78
...
5446ebc280
Author | SHA1 | Date | |
---|---|---|---|
5446ebc280 | |||
3faa8d8a27 | |||
96274c721a | |||
e9c8701407 | |||
badb96d054 |
21
.github/workflows/wheels.yml
vendored
21
.github/workflows/wheels.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
qt: [6.4.2, 6.7.2]
|
qt: [6.4.2, 6.7.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
@ -37,8 +37,9 @@ jobs:
|
|||||||
LIMEREPORT_USE_ZINT: ${{ matrix.zint }}
|
LIMEREPORT_USE_ZINT: ${{ matrix.zint }}
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
name: artifact-sdist-${{ matrix.qt }}-${{ matrix.zint }}
|
||||||
path: dist/*.tar.gz
|
path: dist/*.tar.gz
|
||||||
|
|
||||||
build_wheels:
|
build_wheels:
|
||||||
@ -51,7 +52,7 @@ jobs:
|
|||||||
os: [ubuntu-20.04, windows-2019]
|
os: [ubuntu-20.04, windows-2019]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
@ -98,8 +99,9 @@ jobs:
|
|||||||
python cibuildwheel/before_build.py
|
python cibuildwheel/before_build.py
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
name: artifact-whl-${{ matrix.qt }}-${{ matrix.zint }}-${{ matrix.os }}
|
||||||
path: ./wheelhouse/*.whl
|
path: ./wheelhouse/*.whl
|
||||||
|
|
||||||
release:
|
release:
|
||||||
@ -112,19 +114,16 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
# unpacks default artifact into dist/
|
|
||||||
# if `name: artifact` is omitted, the action will create extra parent dir
|
|
||||||
name: artifact
|
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Github Release
|
- name: Github Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
prerelease: ${{ contains(github.ref, '.dev') }}
|
prerelease: ${{ contains(github.ref, '.dev') }}
|
||||||
files: dist/*
|
files: dist/**/*
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
@ -3,6 +3,7 @@ requires = [
|
|||||||
"cmake>=3.18",
|
"cmake>=3.18",
|
||||||
"setuptools>=42",
|
"setuptools>=42",
|
||||||
"wheel",
|
"wheel",
|
||||||
|
"packaging",
|
||||||
"shiboken6==6.4.2",
|
"shiboken6==6.4.2",
|
||||||
"PySide6==6.4.2",
|
"PySide6==6.4.2",
|
||||||
"shiboken6_generator==6.4.2",
|
"shiboken6_generator==6.4.2",
|
||||||
|
35
setup.py
35
setup.py
@ -27,18 +27,24 @@
|
|||||||
# see https://www.gnu.org/licenses/.
|
# see https://www.gnu.org/licenses/.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import importlib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import platform
|
import platform
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
import PySide6
|
||||||
from setuptools import Extension, setup
|
from setuptools import Extension, setup
|
||||||
from setuptools.command.build_ext import build_ext
|
from setuptools.command.build_ext import build_ext
|
||||||
|
|
||||||
from wheel.bdist_wheel import bdist_wheel
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
|
|
||||||
|
from packaging import version
|
||||||
|
|
||||||
import shiboken6
|
import shiboken6
|
||||||
|
|
||||||
USE_ZINT_ENV_KEY = 'LIMEREPORT_USE_ZINT'
|
USE_ZINT_ENV_KEY = 'LIMEREPORT_USE_ZINT'
|
||||||
@ -109,6 +115,35 @@ class CMakeExtension(Extension):
|
|||||||
self.write_top_level_init = write_top_level_init
|
self.write_top_level_init = write_top_level_init
|
||||||
|
|
||||||
class BuildExt(build_ext):
|
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:
|
def build_extension(self, ext: CMakeExtension) -> None:
|
||||||
# Must be in this form due to bug in .resolve() only fixed in Python 3.10+
|
# 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)
|
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user