diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 86ce844e..71602256 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -7,6 +7,125 @@ on: workflow_dispatch: jobs: + build_stubs_windows: + name: Build FMX Stubs for Windows + runs-on: ${{ matrix.os }} + strategy: + matrix: + python: ['3.11'] + include: + - os: [windows-latest] + arch: ["AMD64"] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Build and Install FMX + run: | + python -m pip install setuptools --upgrade + python -m pip install wheel --upgrade + python setup.py install + + - name: Install mypy + run: | + python -m pip install git+https://github.com/lmbelo/mypy.git + + - name: Build Stubs + run: | + python -m mypy.stubgen -m delphifmx -o .\delphifmx --include-docstrings + ren .\delphifmx\delphifmx.pyi __init__.pyi + + - name: Cache Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: .\delphifmx\__init__.pyi + key: ${{ runner.os }}-stubs + + build_stubs_linux: + name: Build FMX Stubs for Linux + runs-on: ${{ matrix.os }} + strategy: + matrix: + python: ['3.11'] + include: + - os: [ubuntu-latest] + arch: ["x86_64"] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + + - name: Build and Install FMX + run: | + python -m pip install setuptools --upgrade + python -m pip install wheel --upgrade + python setup.py install + + - name: Install mypy + run: | + python -m pip install git+https://github.com/lmbelo/mypy.git + + - name: Build Stubs + run: | + python -m mypy.stubgen -m delphifmx -o ./delphifmx --include-docstrings + mv ./delphifmx/delphifmx.pyi ./delphifmx/__init__.pyi + + - name: Cache Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: ./delphifmx/__init__.pyi + key: ${{ runner.os }}-stubs + + build_stubs_macos: + name: Build FMX Stubs MacOS + runs-on: ${{ matrix.os }} + strategy: + matrix: + python: ['3.11'] + include: + - os: [ubuntu-latest] + arch: ["x86_64"] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + + - name: Build and Install FMX + run: | + python -m pip install setuptools --upgrade + python -m pip install wheel --upgrade + python setup.py install + + - name: Install mypy + run: | + python -m pip install git+https://github.com/lmbelo/mypy.git + + - name: Build Stubs + run: | + python -m mypy.stubgen -m delphifmx -o ./delphifmx --include-docstrings + mv delphifmx/delphifmx.pyi delphifmx/__init__.pyi + + - name: Cache Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: ./delphifmx/__init__.pyi + key: Macos-stubs + enableCrossOsArchive: true + #This build makes delphifmx available for Android build_universal_wheel: name: Build universal wheel @@ -42,6 +161,7 @@ jobs: build_wheels_win_32: name: Build Windows x86 wheels for Python ${{ matrix.python }} + needs: [build_stubs_windows] runs-on: ${{ matrix.os }} strategy: matrix: @@ -54,7 +174,14 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + + - name: Restore Cached Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: .\delphifmx\__init__.pyi + key: ${{ runner.os }}-stubs + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 with: @@ -75,6 +202,7 @@ jobs: build_wheels_win_64: name: Build Windows x64 wheels for Python ${{ matrix.python }} + needs: [build_stubs_windows] runs-on: ${{ matrix.os }} strategy: matrix: @@ -87,6 +215,13 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Restore Cached Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: .\delphifmx\__init__.pyi + key: ${{ runner.os }}-stubs - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 @@ -108,6 +243,7 @@ jobs: build_wheels_manylinux: name: Build ManyLinux x86_64 wheels for Python ${{ matrix.python }} + needs: [build_stubs_linux] runs-on: ${{ matrix.os }} strategy: matrix: @@ -120,6 +256,13 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Restore Cached Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: ./delphifmx/__init__.pyi + key: ${{ runner.os }}-stubs - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 @@ -140,6 +283,7 @@ jobs: build_wheels_macos: name: Build x86_64 macOS wheels for Python ${{ matrix.python }} + needs: [build_stubs_macos] runs-on: ${{ matrix.os }} strategy: matrix: @@ -152,6 +296,14 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Restore Cached Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: ./delphifmx/__init__.pyi + key: Macos-stubs + enableCrossOsArchive: true - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 @@ -172,6 +324,7 @@ jobs: build_wheels_macos_arm: name: Build arm64 macOS wheels for Python ${{ matrix.python }} + needs: [build_stubs_macos] runs-on: ${{ matrix.os }} strategy: matrix: @@ -185,6 +338,14 @@ jobs: with: fetch-depth: 0 + - name: Restore Cached Stubs + id: cache-stubs + uses: actions/cache@v3 + with: + path: ./delphifmx/__init__.pyi + key: Macos-stubs + enableCrossOsArchive: true + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 with: diff --git a/MANIFEST.in b/MANIFEST.in index b7f7fdaf..34890c0b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ recursive-include delphifmx *.pyd recursive-include delphifmx *.so recursive-include delphifmx *.dylib +recursive-include delphifmx *.pyi recursive-include delphifmx docs.xml \ No newline at end of file diff --git a/lib/Android/libDelphiFMX.so b/lib/Android/libDelphiFMX.so index 9c56f715..c8b79042 100644 Binary files a/lib/Android/libDelphiFMX.so and b/lib/Android/libDelphiFMX.so differ diff --git a/lib/Android64/libDelphiFMX.so b/lib/Android64/libDelphiFMX.so index 038c5403..d949e190 100644 Binary files a/lib/Android64/libDelphiFMX.so and b/lib/Android64/libDelphiFMX.so differ diff --git a/lib/Linux64/libDelphiFMX.so b/lib/Linux64/libDelphiFMX.so index 4eb78059..59909ed3 100644 Binary files a/lib/Linux64/libDelphiFMX.so and b/lib/Linux64/libDelphiFMX.so differ diff --git a/lib/OSX64/libDelphiFMX.dylib b/lib/OSX64/libDelphiFMX.dylib index 9db29a27..d87bce72 100644 Binary files a/lib/OSX64/libDelphiFMX.dylib and b/lib/OSX64/libDelphiFMX.dylib differ diff --git a/lib/OSXARM64/libDelphiFMX.dylib b/lib/OSXARM64/libDelphiFMX.dylib index dfc814b2..aa96b113 100644 Binary files a/lib/OSXARM64/libDelphiFMX.dylib and b/lib/OSXARM64/libDelphiFMX.dylib differ diff --git a/lib/Win32/DelphiFMX.pyd b/lib/Win32/DelphiFMX.pyd index 8bcd8685..3b449be9 100644 Binary files a/lib/Win32/DelphiFMX.pyd and b/lib/Win32/DelphiFMX.pyd differ diff --git a/lib/Win64/DelphiFMX.pyd b/lib/Win64/DelphiFMX.pyd index 67257bbe..f78a8ba6 100644 Binary files a/lib/Win64/DelphiFMX.pyd and b/lib/Win64/DelphiFMX.pyd differ diff --git a/samples/README.md b/samples/README.md index 6bb78cc5..998cc2b0 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1,6 +1,11 @@ +## StringGrid > stringgrid.py +![Python GUI App - StringGrid > stringgrid.py](https://github.com/shaunroselt/DelphiFMX4Python/assets/5418178/ceecb0ef-5cb9-4134-b751-650b708cd32f) + + ## PasswordGenerator.py ![Python GUI App - PasswordGenerator.py](https://github.com/shaunroselt/DelphiFMX4Python/assets/5418178/8ac2aa72-44f2-4cf3-9f1f-60929cf41c60) + ## ControlsDesktop > controlsdemo.py ![Python GUI App - ControlsDesktop > controlsdemo.py](https://github.com/shaunroselt/DelphiFMX4Python/assets/5418178/70348e6c-e9d0-4314-8204-d0a7fef2eb58) diff --git a/samples/StringGrid/stringgrid.py b/samples/StringGrid/stringgrid.py index cbadbaae..aa359689 100644 --- a/samples/StringGrid/stringgrid.py +++ b/samples/StringGrid/stringgrid.py @@ -4,6 +4,8 @@ class StringGridSample(Form): def __init__(self, owner): + self.caption = "String Grid Sample" + self.string_grid = StringGrid(self) self.currency_column1 = CurrencyColumn(self.string_grid) self.glyph_column1 = GlyphColumn(self.string_grid) @@ -185,4 +187,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/setup.cfg b/setup.cfg index b5a6c1dc..c8ce77a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,4 +58,4 @@ cmdclass = bdist_wheel = build.BDistWheel [options.package_data] -* = *.pyd, *.so, *.dylib, *.xml \ No newline at end of file +* = *.pyd, *.so, *.dylib, *.pyi, *.xml \ No newline at end of file