diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..79e0714a --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,47 @@ +name: Publish to PyPI + +on: + release: + types: + - published + workflow_dispatch: + inputs: + twine_verbose: + description: 'Enable Twine verbose mode' + required: true + type: boolean + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pyftdi + permissions: + id-token: write + strategy: + matrix: + python-version: ['3.13'] + steps: + + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + + - name: Build package + run: | + python setup.py bdist_wheel + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: ${{ inputs.twine_verbose }} diff --git a/.github/workflows/pythonchecksyntax.yml b/.github/workflows/pythonchecksyntax.yml index 7dff3c30..853415d8 100644 --- a/.github/workflows/pythonchecksyntax.yml +++ b/.github/workflows/pythonchecksyntax.yml @@ -16,26 +16,31 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install -r test-requirements.txt + - name: Check style run: | python setup.py check_style + - name: Linter run: | pylint --disable=fixme --disable=duplicate-code \ - pyftdi pyftdi/bin pyftdi/serialext \ - pyftdi/tests pyftdi/serialext/tests pyftdi/tests/backend + $(git ls-files '*.py') + - name: Install package run: | python setup.py install + - name: Run tests run: | python pyftdi/tests/toolsimport.py diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 6309f6cf..874cd7da 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -15,19 +15,23 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install setuptools wheel sphinx sphinx_rtd_theme sphinx_autodoc_typehints + - name: Build package run: | python setup.py bdist python setup.py sdist bdist_wheel + - name: Build documentation run: | mkdir doc diff --git a/pyftdi/doc/conf.py b/pyftdi/doc/conf.py index 4fd5655a..191cbd9f 100644 --- a/pyftdi/doc/conf.py +++ b/pyftdi/doc/conf.py @@ -1,8 +1,10 @@ -# Copyright (c) 2010-2021 Emmanuel Blot +# Copyright (c) 2010-2024 Emmanuel Blot # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause +# pylint: skip-file + import os import re import sys diff --git a/setup.py b/setup.py index 8da347a2..c9be82f9 100755 --- a/setup.py +++ b/setup.py @@ -171,6 +171,7 @@ def main(): maintainer_email=find_meta('email'), keywords=KEYWORDS, long_description=read_desc('pyftdi/doc/index.rst'), + long_description_content_type='text/x-rst', packages=PACKAGES, scripts=['pyftdi/bin/i2cscan.py', 'pyftdi/bin/ftdi_urls.py',