Skip to content

Commit

Permalink
Merge pull request #396 from eblot/dev/ebl/pypi
Browse files Browse the repository at this point in the history
Add PyPI publishing workflow
  • Loading branch information
eblot authored Nov 23, 2024
2 parents 74cff4d + 353c723 commit c228f72
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -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 }}
9 changes: 7 additions & 2 deletions .github/workflows/pythonchecksyntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pyftdi/doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Copyright (c) 2010-2021 Emmanuel Blot <emmanuel.blot@free.fr>
# Copyright (c) 2010-2024 Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# pylint: skip-file

import os
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c228f72

Please sign in to comment.