diff options
author | Christian Heimes <christian@python.org> | 2022-07-14 11:58:10 +0200 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2022-07-14 12:16:14 +0200 |
commit | 041aa121234936f4f7c225e92c43d622769c12e3 (patch) | |
tree | d87a894dcdf72b4f057f5349342698814caad7b2 | |
parent | 6c7a8ed9b7d3cf871ae5ff72e76e4d2e2297c74d (diff) | |
download | defusedxml-git-041aa121234936f4f7c225e92c43d622769c12e3.tar.gz |
Add pypi workflow
-rw-r--r-- | .github/workflows/main.yml | 5 | ||||
-rw-r--r-- | .github/workflows/pypi.yml | 64 | ||||
-rw-r--r-- | defusedxml/expatreader.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
5 files changed, 71 insertions, 4 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1791bb8..f575328 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,9 +24,10 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11-dev" steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/checkout@v3" + - uses: "actions/setup-python@v4" with: python-version: "${{ matrix.python-version }}" - name: "Update pip" diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..296e64b --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,64 @@ +--- +name: Build and upload to PyPI + +permissions: + contents: read + +on: + workflow_dispatch: + inputs: + tag: + description: tag to build + required: true + type: string + testpypi: + description: upload to Test PyPI + type: boolean + default: false + pypi: + description: upload to PyPI + type: boolean + default: false + push: + branches: + - master + - main + - v*.x + pull_request: + branches: + - master + - main + - v*.x + +jobs: + pypi: + name: Build and upload to PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.tag || github.ref }} + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: "Update pip" + run: python -m pip install --upgrade pip setuptools wheel + - name: "Install 'build' and 'twine'" + run: python -m pip install --upgrade build twine + - name: "Run 'build'" + run: "python -m build" + - name: "Run twine check" + run: "python -m twine check dist/*" + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + if: github.event.inputs.testpypi == true + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + if: github.event.inputs.pypi == true diff --git a/defusedxml/expatreader.py b/defusedxml/expatreader.py index 9d36dc3..6b17559 100644 --- a/defusedxml/expatreader.py +++ b/defusedxml/expatreader.py @@ -20,7 +20,7 @@ class DefusedExpatParser(_ExpatParser): def __init__( self, namespaceHandling=0, - bufsize=2 ** 16 - 20, + bufsize=2**16 - 20, forbid_dtd=False, forbid_entities=True, forbid_external=True, @@ -45,6 +45,7 @@ setup( license="PSFL", description="XML bomb protection for Python stdlib modules", long_description="\n".join(long_description), + long_description_content_type="text/x-rst", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -57,6 +58,7 @@ setup( "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Text Processing :: Markup :: XML", ], python_requires=">=3.6", @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310,black,pep8py3,doc +envlist = py36,py37,py38,py39,py310,py311,black,pep8py3,doc skip_missing_interpreters = true [testenv] |