Skip to content

Commit 8568137

Browse files
Merge pull request #4 from thewebscraping/develop
Develop
2 parents 6ac9a87 + 5978b23 commit 8568137

38 files changed

+647
-91
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = tests/*

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{html,css,scss,json,yml,xml}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[Makefile]
23+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
strategy:
14-
max-parallel: 4
14+
fail-fast: false
15+
max-parallel: 3
1516
matrix:
16-
python-version: ['3.9', '3.10', '3.11']
17+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1718
steps:
1819
- uses: actions/checkout@v4
1920
- name: Set up Python ${{ matrix.python-version }}
@@ -23,11 +24,15 @@ jobs:
2324

2425
- name: Install Dependencies
2526
run: |
26-
python -m pip install --upgrade pip
27-
pip install -r requirements.txt
27+
make init
2828
29-
- name: Run pre-commit
30-
uses: pre-commit/[email protected]
29+
- name: Lint
30+
run: |
31+
make lint
32+
33+
- name: Tests
34+
run: |
35+
make pytest
3136
3237
deploy:
3338
needs: build

CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
Release History
22
===============
33

4+
1.0.3 (2024-12-11)
5+
-------------------
6+
**Improvements:**
7+
8+
- Add unit tests.
9+
- Improve document.
10+
11+
**Bugfixes:**
12+
13+
- Fix timeout.
14+
- Fix missing port redirection.
15+
16+
17+
1.0.3 (2024-12-05)
18+
-------------------
19+
**Improvements**
20+
21+
- improve document.
22+
23+
**Bugfixes**
24+
25+
- Fix multipart encoders, cross share auth.
26+
27+
1.0.2 (2024-12-05)
28+
-------------------
29+
**Improvements**
30+
- Download specific TLS library versions.
31+
- Add a document.
32+
433
1.0.1 (2024-12-04)
534
-------------------
6-
* First release
35+
- First release

Makefile

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
.PHONY: docs
22
init:
3-
python -m pip install -r requirements.txt
3+
python -m pip install --upgrade pip
4+
python -m pip install -r requirements-dev.txt
5+
6+
test:
7+
tox -p
8+
rm -rf *.egg-info
49

510
test-readme:
611
python setup.py check --restructuredtext --strict && ([ $$? -eq 0 ] && echo "README.rst and CHANGELOG.md ok") || echo "Invalid markup in README.md or CHANGELOG.md!"
@@ -10,11 +15,25 @@ lint:
1015
python -m isort tls_requests
1116
python -m flake8 tls_requests
1217

18+
pytest:
19+
python -m pytest tests
20+
21+
coverage:
22+
python -m pytest --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=tls_requests tests
23+
24+
docs:
25+
mkdocs serve
26+
27+
publish-test-pypi:
28+
python -m pip install -r requirements-dev.txt
29+
python -m pip install 'twine>=6.0.1'
30+
python setup.py sdist bdist_wheel
31+
twine upload --repository testpypi dist/*
32+
rm -rf build dist .egg wrapper_tls_requests.egg-info
33+
1334
publish-pypi:
35+
python -m pip install -r requirements-dev.txt
1436
python -m pip install 'twine>=6.0.1'
1537
python setup.py sdist bdist_wheel
1638
twine upload dist/*
1739
rm -rf build dist .egg wrapper_tls_requests.egg-info
18-
19-
docs:
20-
mkdocs serve

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# TLS REQUESTS
2-
**A powerful and lightweight Python library for making secure and reliable HTTP/TLS Fingerprint requests.**
1+
# 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.
33

44
* * *
55

docs/advanced/hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ client.hooks = {
100100
Best Practices
101101
--------------
102102

103-
1. **Access Content**: Use `.read()` or `await read()` in asynchronous contexts to access `response.content` before returning it.
103+
1. **Access Content**: Use `.read()` or `await .aread()` in asynchronous contexts to access `response.content` before returning it.
104104
2. **Always Use Lists:** Hooks must be registered as **lists of callables**, even if you are adding only one function.
105105
3. **Combine Hooks:** You can register multiple hooks for the same event type to handle various concerns, such as logging and error handling.
106106
4. **Order Matters:** Hooks are executed in the order they are registered.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[build-system]
22
requires = ['setuptools>=40.8.0']
33
build-backend = 'setuptools.build_meta'
4+
5+
[tool.pytest.ini_options]
6+
asyncio_mode = "auto"

requirements-dev.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-r requirements.txt
2+
3+
# Documentation
4+
mkdocs==1.6.1
5+
mkautodoc==0.2.0
6+
mkdocs-material==9.5.39
7+
8+
# Packaging
9+
setuptools~=75.3.0
10+
twine~=6.0.1
11+
12+
# Tests & Linting
13+
pre-commit==3.7.0
14+
black==24.3.0
15+
coverage[toml]==7.6.1
16+
pre-commit==3.7.0
17+
isort==5.13.2
18+
flake8==7.1.1
19+
mypy==1.11.2
20+
pytest==8.3.3
21+
pytest-asyncio==0.24.0
22+
pytest-cov==6.0.0
23+
pytest_httpserver==1.1.0
24+
Werkzeug==3.1.3
25+
tox==4.23.2

requirements.txt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,4 @@
22
chardet~=5.2.0
33
requests~=2.32.3
44
tqdm~=4.67.1
5-
6-
# Documentation
7-
mkdocs==1.6.1
8-
mkautodoc==0.2.0
9-
mkdocs-material==9.5.39
10-
11-
# Packaging
12-
setuptools~=75.3.0
13-
twine~=6.0.1
14-
15-
# Tests & Linting
16-
pre-commit==3.7.0
17-
black==24.3.0
18-
flake8==7.0.0
19-
coverage[toml]==7.6.1
20-
pre-commit==3.7.0
21-
isort==5.13.2
22-
mypy==1.11.2
23-
pytest==8.3.3
5+
idna~=3.10

0 commit comments

Comments
 (0)