From cacca27ce8f1201134c7239b98e33067d46a82f6 Mon Sep 17 00:00:00 2001 From: andreishark Date: Sun, 13 Jul 2025 13:53:22 +0300 Subject: [PATCH] Added stubs to publish --- .github/workflows/python-publish.yml | 26 +++++++++++++++----------- setup.py | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6597a9b..d4d802b 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,11 +26,23 @@ jobs: with: python-version: "3.x" + - name: Install build and stubgen dependencies + run: | + python -m pip install --upgrade pip + pip install wheel mypy setuptools # Add mypy and setuptools (if not already there) + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Generate Type Stubs + run: | + pip install -e . + + mkdir -p dobotWrapperPy/stubs + + stubgen -p dobotWrapperPy -o dobotWrapperPy/types + # stubgen -p dobotWrapperPy -o dobotWrapperPy/ + - name: Build release distributions run: | - # NOTE: put your own distribution build steps here. - python -m pip install -r requirements.txt - python -m pip install wheel python setup.py sdist bdist_wheel - name: Upload distributions @@ -44,19 +56,11 @@ jobs: needs: - release-build permissions: - # IMPORTANT: this permission is mandatory for trusted publishing id-token: write - # Dedicated environments with protections for publishing are strongly recommended. - # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules environment: name: pypi - # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: url: https://pypi.org/project/dobotWrapperPy/ - # - # ALTERNATIVE: if your GitHub Release name is the PyPI project version string - # ALTERNATIVE: exactly, uncomment the following line instead: - # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} steps: - name: Retrieve release distributions diff --git a/setup.py b/setup.py index 1a5442a..a4d1c22 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="dobotWrapperPy", packages=["dobotWrapperPy", "dobotWrapperPy.enums"], - package_data={"dobotWrapperPy": ["py.typed"], "dobotWrapperPy.enums": ["py.typed"]}, + package_data={"dobotWrapperPy": ["py.typed", "*.pyi", "types/*.pyi"]}, include_package_data=True, version="1.1.1", description="Python library for Dobot Magician For Minitechnicus Courses",