diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 547559e..8171d66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: include: - - python-version: "3.8" + - python-version: "3.12" # Keep in sync with .readthedocs.yml env: TOXENV: docs - python-version: "3.12" @@ -27,12 +27,15 @@ jobs: - python-version: "3.12" env: TOXENV: typing + - python-version: "3.12" + env: + TOXENV: twinecheck steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 83fc520..497f5f9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python 3.12 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.12 @@ -27,9 +27,8 @@ jobs: - name: Publish to PyPI if: steps.check-release-tag.outputs.release_tag == 'true' run: | - pip install --upgrade pip - pip install --upgrade setuptools wheel twine - python setup.py sdist bdist_wheel + pip install --upgrade build twine + python -m build export TWINE_USERNAME=__token__ export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} twine upload dist/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 12acd0c..72d5e63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf7ebb0..82153a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/PyCQA/bandit - rev: 1.7.7 + rev: 1.7.8 hooks: - id: bandit args: [-r, -c, .bandit.yml] @@ -9,7 +9,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/psf/black.git - rev: 24.1.1 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/pycqa/isort diff --git a/setup.py b/setup.py index 9825882..1e1019d 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,15 @@ from setuptools import find_packages, setup +with open("README.rst", encoding="utf-8") as f: + long_description = f.read() + setup( name="w3lib", version="2.1.2", license="BSD", description="Library of web-related functions", + long_description=long_description, + long_description_content_type="text/x-rst", author="Scrapy project", author_email="info@scrapy.org", url="https://github.com/scrapy/w3lib", diff --git a/tox.ini b/tox.ini index e97b62f..71a555e 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py38, py39, py310, py311, py312, pypy3, docs, pylint, typing, pre-commit +envlist = py38, py39, py310, py311, py312, pypy3, docs, pylint, typing, pre-commit, twinecheck [testenv] deps = @@ -21,14 +21,14 @@ basepython = python3 deps = # mypy would error if pytest (or its sub) not found pytest - mypy==1.0.0 + mypy==1.10.0 commands = mypy --strict {posargs: w3lib tests} [testenv:pylint] deps = {[testenv]deps} - pylint==3.0.0 + pylint==3.2.2 commands = pylint conftest.py docs setup.py tests w3lib @@ -42,3 +42,12 @@ commands = deps = pre-commit commands = pre-commit run --all-files --show-diff-on-failure skip_install = true + +[testenv:twinecheck] +basepython = python3 +deps = + twine==5.1.0 + build==1.2.1 +commands = + python -m build --sdist + twine check dist/*