forked from psf/requests-html
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: ignore junit build * feat: add requirements quick install target and test targets * chore: trigger Pipfile upgrade via pipenv lock * feat: update source to use playwright instead of pyppeteer * fix(ci): change main branch to match upstream * refactor(ci): put ci in proper folder * fix(ci): ensure testing deps are installed in ci * wip: disabled reddit.com pagination test as github CI is blocking it currently
- Loading branch information
Showing
10 changed files
with
1,183 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: [master, dev] | ||
pull_request: | ||
branches: [master, dev] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
make requirements | ||
playwright install | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=requests-html --cov-report=xml --cov-report=html tests -v | ||
- name: Upload pytest results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-results-${{ matrix.python-version }} | ||
path: junit/test-results-${{ matrix.python-version }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Upload xml coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-coverage-xml-${{ matrix.python-version }} | ||
path: coverage.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Upload html coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-coverage-html-${{ matrix.python-version }} | ||
path: htmlcov/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
.PHONY: setup | ||
setup: | ||
@echo sets up the development environment | ||
python3 -m venv venv | ||
@echo activate venv with 'source venv/bin/activate' | ||
|
||
.PHONY: requirements | ||
requirements: | ||
pip install black isort click requests_file pytest pytest-asyncio pytest-cov | ||
pip install -e . | ||
|
||
documentation: | ||
cd docs && make html | ||
cd docs/build/html && git add -A && git commit -m 'updates' | ||
cd docs/build/html && git push origin gh-pages | ||
|
||
test: | ||
python -m pytest tests -v | ||
|
||
test-reports: | ||
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=requests-html --cov-report=xml --cov-report=html tests -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,16 @@ | |
from setuptools import setup, Command | ||
|
||
# Package meta-data. | ||
NAME = 'requests-html' | ||
DESCRIPTION = 'HTML Parsing for Humans.' | ||
URL = 'https://github.com/psf/requests-html' | ||
EMAIL = '[email protected]' | ||
AUTHOR = 'Kenneth Reitz' | ||
VERSION = '0.10.0' | ||
NAME = 'requests-htmlc' | ||
DESCRIPTION = 'Playwright Powered HTML Parsing for Humans.' | ||
URL = 'https://github.com/cboin/requests-html' | ||
EMAIL = '[email protected]' | ||
AUTHOR = 'cboin' | ||
VERSION = '0.11.0' | ||
|
||
# What packages are required for this module to be executed? | ||
REQUIRED = [ | ||
'requests', 'pyquery', 'fake-useragent', 'parse', 'beautifulsoup4', 'w3lib', 'pyppeteer>=0.0.14' | ||
'requests', 'pyquery', 'fake-useragent', 'parse', 'beautifulsoup4', 'w3lib', 'playwright', 'lxml_html_clean' | ||
] | ||
|
||
# The rest you shouldn't have to touch too much :) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters