Skip to content

Commit 2d04aeb

Browse files
Solve alleged twine warnings on pypi publishing (#1778)
* Solve twine warning (venv) PS C:\...\pvlib-python> py -m twine check dist/* Checking dist\pvlib-0.9.6.dev25+g763dd0a.d20230618-py3-none-any.whl: PASSED with warnings WARNING `long_description_content_type` missing. defaulting to `text/x-rst`. Checking dist\pvlib-0.9.6.dev25+g763dd0a.d20230618.tar.gz: PASSED with warnings WARNING `long_description_content_type` missing. defaulting to `text/x-rst`. * Add metadata verification to publish.yml * Add twine to build tools * code review Co-Authored-By: Kevin Anderson <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]>
1 parent d084baa commit 2d04aeb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install build
31+
python -m pip install twine
3132
3233
- name: Build packages
3334
run: python -m build
3435

36+
- name: Check metadata verification
37+
run: python -m twine check --strict dist/*
38+
3539
# only publish distribution to PyPI for tagged commits
3640
- name: Publish distribution to PyPI
3741
if: startsWith(github.ref, 'refs/tags/v')
3842
uses: pypa/gh-action-pypi-publish@release/v1
3943
with:
4044
user: __token__
41-
password: ${{ secrets.pypi_password }}
45+
password: ${{ secrets.pypi_password }}

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
2828
Source code: https://github.com/pvlib/pvlib-python
2929
"""
30+
LONG_DESCRIPTION_CONTENT_TYPE = "text/x-rst"
3031

3132
DISTNAME = 'pvlib'
3233
LICENSE = 'BSD 3-Clause'
@@ -119,6 +120,7 @@
119120
ext_modules=extensions,
120121
description=DESCRIPTION,
121122
long_description=LONG_DESCRIPTION,
123+
long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE,
122124
author=AUTHOR,
123125
maintainer_email=MAINTAINER_EMAIL,
124126
license=LICENSE,

0 commit comments

Comments
 (0)