Skip to content

Commit

Permalink
Officially support Python 3.13 and update build environment (#271)
Browse files Browse the repository at this point in the history
* Officially support Python 3.13 and update build environment

* Fix related test issues with latest lxml
  • Loading branch information
facelessuser authored Aug 13, 2024
1 parent 25631bd commit 1a67e46
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 24 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
max-parallel: 4
matrix:
platform: [ubuntu-latest, windows-latest]
tox-env: [py38, py39, py310, py311, py312, nolxml, nohtml5lib]
tox-env: [py38, py39, py310, py311, py312, py313, nolxml, nohtml5lib]
include:
- tox-env: py38
python-version: 3.8
Expand All @@ -34,34 +34,31 @@ jobs:
- tox-env: py312
python-version: '3.12'
continue-on-error: false
- tox-env: py313
python-version: '3.13'
continue-on-error: false
- tox-env: nolxml
python-version: '3.11'
continue-on-error: false
- tox-env: nohtml5lib
python-version: '3.10'
python-version: '3.11'
continue-on-error: false
# exclude:
# - platform: windows-latest
# tox-env: py311
exclude:
- platform: windows-latest
tox-env: py313

env:
TOXENV: ${{ matrix.tox-env }}

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: "!endsWith(matrix.python-version, '-dev')"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up development Python ${{ matrix.python-version }}
if: endsWith(matrix.python-version, '-dev')
uses: deadsnakes/action@v2.1.1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools build tox coverage
Expand All @@ -71,7 +68,7 @@ jobs:
continue-on-error: ${{ matrix.continue-on-error }}
- name: Upload Results
if: success()
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -90,9 +87,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- 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 }}
- name: Install dependencies
Expand All @@ -114,9 +111,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- 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 }}
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -40,8 +40,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Package
Expand Down
1 change: 1 addition & 0 deletions docs/src/markdown/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2.6

- **NEW**: Add official support for Python 3.13.
- **NEW**: Add support for `&` as scoping root per the CSS Nesting Module, Level 1. When `&` is used outside the
context of nesting, it is treated as the scoping root (equivalent to `:scope`).
- **FIX**: Improve error message when an unrecognized pseudo-class is used.
Expand Down
1 change: 1 addition & 0 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def update(self, metadata):
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules',
'Typing :: Typed'
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@ commands =
filterwarnings =
ignore:\nCSS selector pattern:UserWarning
"""

[tool.pytest.ini_options]
filterwarnings = [
"ignore:The 'strip_cdata':DeprecationWarning"
]
9 changes: 7 additions & 2 deletions tests/test_extra/test_soup_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ def test_contains_warn(self):
['2'],
flags=util.HTML
)
found = False
target = "The pseudo class ':contains' is deprecated, ':-soup-contains' should be used moving forward."
for warn in w:
if target in str(warn.message):
found = True
break
# Verify some things
self.assertTrue(len(w) == 1)
self.assertTrue(issubclass(w[-1].category, FutureWarning))
self.assertTrue(found)

0 comments on commit 1a67e46

Please sign in to comment.