Skip to content

Commit 8dd6467

Browse files
Merge pull request #10 from thewebscraping/bugs/bus-error-ubuntu-22.04-Jammy-Jellyfish
bugs: bus error ubuntu 22.04 (Jammy Jellyfish)
2 parents 944db0b + 12daf9d commit 8dd6467

File tree

12 files changed

+338
-91
lines changed

12 files changed

+338
-91
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Bug report
2+
description: File a bug report for the TLS Requests
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
7+
- type: markdown
8+
attributes:
9+
value: |
10+
- Write an issue title above.
11+
- Search [open](https://github.com/thewebscraping/tls-requests/issues?q=is%3Aopen) and [closed](https://github.com/thewebscraping/tls-requests/issues?q=is%3Aclosed) issues to ensure it has not already been reported.
12+
13+
- type: input
14+
attributes:
15+
label: TLS Requests version
16+
description: >
17+
Specify the TLS Requests version
18+
placeholder: v1.0.8
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Issue description
25+
description: |
26+
Describe your issue briefly. What doesn't work, and how do you expect it to work instead?
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
attributes:
32+
label: Steps to reproduce / Code Sample
33+
description: |
34+
List of steps or sample code that reproduces the issue.
35+
validations:
36+
required: true

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature Request
2+
description: Propose a feature for the TLS Requests
3+
title: "[Feature Request]: "
4+
labels: ["enhancement"]
5+
body:
6+
7+
- type: markdown
8+
attributes:
9+
value: |
10+
- Write a proposal title above.
11+
- Search [open](https://github.com/thewebscraping/tls-requests/issues?q=is%3Aopen) and [closed](https://github.com/thewebscraping/tls-requests/issues?q=is%3Aclosed) proposals to ensure the feature has not already been suggested.
12+
13+
- type: textarea
14+
attributes:
15+
label: Describe the feature / enhancement and how it would improve things
16+
description: |
17+
- Dont overcomplicate
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
attributes:
23+
label: Describe how your proposal will work, with code and/or pseudo-code
24+
validations:
25+
required: true

.github/workflows/ci.yml

+41-28
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,64 @@ on:
88
branches: ['master', 'main', 'dev', 'develop']
99

1010
jobs:
11-
build:
11+
build-on-ubuntu:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
1515
max-parallel: 3
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
17+
python-version: ['3.9', '3.10', '3.11']
1818
steps:
1919
- uses: actions/checkout@v4
2020
- name: Set up Python ${{ matrix.python-version }}
2121
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

25-
- name: Install Dependencies
25+
- name: Install Dependencies, Lint and Tests
2626
run: |
27-
make init
27+
make init-actions
2828
29-
- name: Lint
29+
build-on-mac:
30+
runs-on: macos-latest
31+
strategy:
32+
fail-fast: false
33+
max-parallel: 1
34+
matrix:
35+
python-version: ['3.9']
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Install Dependencies, Lint and Tests
3044
run: |
31-
make lint
45+
make init-actions
3246
33-
- name: Tests
47+
- name: Pytest
3448
run: |
3549
make pytest
3650
37-
deploy:
38-
needs: build
39-
runs-on: ubuntu-latest
40-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
51+
build-on-windows:
52+
runs-on: windows-latest
53+
strategy:
54+
fail-fast: false
55+
max-parallel: 1
56+
matrix:
57+
python-version: ['3.9']
4158
steps:
42-
- uses: actions/checkout@v4
43-
- name: Configure Git Credentials
44-
run: |
45-
git config user.name github-actions[bot]
46-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
47-
- uses: actions/setup-python@v5
48-
with:
49-
python-version: '3.10'
50-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
51-
- uses: actions/cache@v4
52-
with:
53-
key: mkdocs-material-${{ env.cache_id }}
54-
path: .cache
55-
restore-keys: |
56-
mkdocs-material-
57-
- run: pip install -r requirements-dev.txt
58-
- run: mkdocs gh-deploy --force
59+
- uses: actions/checkout@v4
60+
- name: Set up Python ${{ matrix.python-version }}
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: ${{ matrix.python-version }}
64+
65+
- name: Install Dependencies, Lint
66+
run: |
67+
make init-actions
68+
69+
- name: Pytest
70+
run: |
71+
make pytest

.github/workflows/publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Upload Python Package to PyPI when a Release is Created
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
testpypi-publish:
9+
name: Publish release to TestPyPI
10+
runs-on: ubuntu-latest
11+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/wrapper-tls-requests
15+
permissions:
16+
id-token: write # IMPORTANT: mandatory for sigstore
17+
steps:
18+
- name: Publish package to TestPyPI
19+
uses: pypa/gh-action-pypi-publish@release/v1
20+
with:
21+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
22+
repository-url: https://test.pypi.org/legacy/
23+
24+
pypi-publish:
25+
name: Publish release to PyPI
26+
needs: testpypi-publish
27+
runs-on: ubuntu-latest
28+
environment:
29+
name: pypi
30+
url: https://pypi.org/p/wrapper-tls-requests
31+
permissions:
32+
id-token: write # IMPORTANT: mandatory for sigstore
33+
steps:
34+
- name: Publish package to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
password: ${{ secrets.PYPI_API_TOKEN }}

Makefile

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.PHONY: docs
2-
init:
2+
init-actions:
33
python -m pip install --upgrade pip
44
python -m pip install -r requirements-dev.txt
5+
python -m black tls_requests
6+
python -m isort tls_requests
7+
python -m flake8 tls_requests
58

69
test:
710
tox -p
@@ -10,11 +13,6 @@ test:
1013
test-readme:
1114
python setup.py check --restructuredtext --strict && ([ $$? -eq 0 ] && echo "README.rst and CHANGELOG.md ok") || echo "Invalid markup in README.md or CHANGELOG.md!"
1215

13-
lint:
14-
python -m black tls_requests
15-
python -m isort tls_requests
16-
python -m flake8 tls_requests
17-
1816
pytest:
1917
python -m pytest tests
2018

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TLS Requests
2-
TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS fingerprinting, anti-bot bypassing, and high performance.
2+
TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS fingerprinting, anti-bot page bypass, and high performance.
33

44
* * *
55

tls_requests/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
__url__ = "https://github.com/thewebscraping/tls-requests"
44
__author__ = "Tu Pham"
55
__author_email__ = "[email protected]"
6-
__version__ = "1.0.7"
6+
__version__ = "1.0.8"
77
__license__ = "MIT"

tls_requests/client.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ def _send(
339339
history = history if isinstance(history, list) else []
340340
start = start or time.perf_counter()
341341
config = self.prepare_config(request)
342-
response = Response.from_tls_response(self.session.request(config.to_dict()), is_byte_response=config.isByteResponse)
342+
response = Response.from_tls_response(
343+
self.session.request(config.to_dict()),
344+
is_byte_response=config.isByteResponse,
345+
)
343346
response.request = request
344347
response.default_encoding = self.encoding
345348
response.elapsed = datetime.timedelta(seconds=time.perf_counter() - start)

0 commit comments

Comments
 (0)