Skip to content

Commit c228f72

Browse files
authored
Merge pull request #396 from eblot/dev/ebl/pypi
Add PyPI publishing workflow
2 parents 74cff4d + 353c723 commit c228f72

File tree

5 files changed

+62
-3
lines changed

5 files changed

+62
-3
lines changed

.github/workflows/pypi.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
inputs:
9+
twine_verbose:
10+
description: 'Enable Twine verbose mode'
11+
required: true
12+
type: boolean
13+
14+
jobs:
15+
pypi-publish:
16+
name: upload release to PyPI
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: pypi
20+
url: https://pypi.org/p/pyftdi
21+
permissions:
22+
id-token: write
23+
strategy:
24+
matrix:
25+
python-version: ['3.13']
26+
steps:
27+
28+
- uses: actions/checkout@v4
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install setuptools wheel
39+
40+
- name: Build package
41+
run: |
42+
python setup.py bdist_wheel
43+
44+
- name: Publish package distributions to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
verbose: ${{ inputs.twine_verbose }}

.github/workflows/pythonchecksyntax.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,31 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
1920
- name: Set up Python ${{ matrix.python-version }}
2021
uses: actions/setup-python@v5
2122
with:
2223
python-version: ${{ matrix.python-version }}
24+
2325
- name: Install dependencies
2426
run: |
2527
python -m pip install --upgrade pip
2628
pip install -r requirements.txt
2729
pip install -r test-requirements.txt
30+
2831
- name: Check style
2932
run: |
3033
python setup.py check_style
34+
3135
- name: Linter
3236
run: |
3337
pylint --disable=fixme --disable=duplicate-code \
34-
pyftdi pyftdi/bin pyftdi/serialext \
35-
pyftdi/tests pyftdi/serialext/tests pyftdi/tests/backend
38+
$(git ls-files '*.py')
39+
3640
- name: Install package
3741
run: |
3842
python setup.py install
43+
3944
- name: Run tests
4045
run: |
4146
python pyftdi/tests/toolsimport.py

.github/workflows/pythonpackage.yml

+4
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
1819
- name: Set up Python ${{ matrix.python-version }}
1920
uses: actions/setup-python@v5
2021
with:
2122
python-version: ${{ matrix.python-version }}
23+
2224
- name: Install dependencies
2325
run: |
2426
python -m pip install --upgrade pip
2527
pip install -r requirements.txt
2628
pip install setuptools wheel sphinx sphinx_rtd_theme sphinx_autodoc_typehints
29+
2730
- name: Build package
2831
run: |
2932
python setup.py bdist
3033
python setup.py sdist bdist_wheel
34+
3135
- name: Build documentation
3236
run: |
3337
mkdir doc

pyftdi/doc/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright (c) 2010-2021 Emmanuel Blot <emmanuel.blot@free.fr>
1+
# Copyright (c) 2010-2024 Emmanuel Blot <emmanuel.blot@free.fr>
22
# All rights reserved.
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6+
# pylint: skip-file
7+
68
import os
79
import re
810
import sys

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def main():
171171
maintainer_email=find_meta('email'),
172172
keywords=KEYWORDS,
173173
long_description=read_desc('pyftdi/doc/index.rst'),
174+
long_description_content_type='text/x-rst',
174175
packages=PACKAGES,
175176
scripts=['pyftdi/bin/i2cscan.py',
176177
'pyftdi/bin/ftdi_urls.py',

0 commit comments

Comments
 (0)