Skip to content

Commit

Permalink
Merge branch 'main' into nuitka
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans authored Nov 27, 2024
2 parents 5477088 + dd4a0cb commit 1d2c618
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- run: uv run --extra non-termux --no-dev --group nuitka --frozen --python 3.12 python -m nuitka --standalone --python-flag='-m' --assume-yes-for-downloads --lto=yes proxy_scraper_checker
- run: uv run --no-dev --group nuitka --frozen --python 3.12 python -m nuitka --standalone --python-flag='-m' --assume-yes-for-downloads --lto=yes proxy_scraper_checker
- run: mv config.toml proxy_scraper_checker.dist/
- if: ${{ github.event_name != 'pull_request' }}
uses: actions/attest-build-provenance@v1
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- --fix=lf
- id: trailing-whitespace
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
rev: v3.4.0
hooks:
- id: prettier
- repo: https://github.com/charliermarsh/ruff-pre-commit
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
--mount=type=cache,target=/root/.cache/uv,sharing=locked \
--mount=source=pyproject.toml,target=pyproject.toml \
--mount=source=uv.lock,target=uv.lock \
uv sync --extra non-termux --no-dev --no-install-project --frozen
uv sync --no-dev --no-install-project --frozen


FROM python-base-stage AS python-run-stage
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ To use `proxy-scraper-checker` in Termux, knowledge of the Unix command-line int
- Edit `~/proxy-scraper-checker/config.toml` to your preference using a text editor (vim/nano).
- To run `proxy-scraper-checker` use the following command:
```bash
cd ~/proxy-scraper-checker && sh start-termux.sh
cd ~/proxy-scraper-checker && sh start.sh
```

## Something else?
Expand Down
4 changes: 2 additions & 2 deletions install-termux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ download_path="${TMPDIR}/${project_name}.zip"

[ -d "${install_path}" ] && rm -rf --interactive=once "${install_path}"
pkg upgrade --yes -o Dpkg::Options::='--force-confdef'
pkg install --yes python python-pip
pkg install --yes binutils libuv python python-pip
curl -fsSLo "${download_path}" "https://github.com/monosans/${project_name}/archive/refs/heads/main.zip"
unzip -d "${base_path}" "${download_path}"
rm -f "${download_path}"
mv "${install_path}-main" "${install_path}"
printf "%s installed successfully.\nRun 'cd %s && sh start-termux.sh'.\n" "${project_name}" "${install_path}"
printf "%s installed successfully.\nRun 'cd %s && sh start.sh'.\n" "${project_name}" "${install_path}"
3 changes: 2 additions & 1 deletion proxy_scraper_checker/geodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async def _save_geodb(
async for chunk in response.content.iter_any():
await geodb.write(chunk)
progress.advance(task_id=task, advance=len(chunk))
progress.update(task_id=task, successful_count="\N{CHECK MARK}")


async def download_geodb(*, progress: Progress, session: ClientSession) -> None:
Expand All @@ -83,7 +84,7 @@ async def download_geodb(*, progress: Progress, session: ClientSession) -> None:
total=response.content_length,
module="Downloader",
protocol="GeoDB",
successful_count="",
successful_count="\N{HORIZONTAL ELLIPSIS}",
),
)

Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = [{ name = "monosans", email = "hsyqixco@protonmail.com" }]
requires-python = ">=3.9,<4"
classifiers = ["Private :: Do Not Upload"]
dependencies = [
"aiodns>=1.1,<4",
"aiofiles",
"aiohttp>=3.8.6,<4",
"aiohttp-socks>=0.7,<0.10",
Expand All @@ -22,11 +23,8 @@ dependencies = [
"platformdirs<5",
"rich>=12.3,<14",
"tomli<3; python_version<'3.11'",
"winloop<0.1.7; implementation_name=='cpython' and (sys_platform=='cygwin' or sys_platform=='win32')",
]
optional-dependencies.non-termux = [
"aiodns>=1.1,<4",
"uvloop>=0.14,<0.22; implementation_name=='cpython' and (sys_platform=='darwin' or sys_platform=='linux')",
"winloop<0.1.7; implementation_name=='cpython' and (sys_platform=='cygwin' or sys_platform=='win32')",
]
urls.repository = "https://github.com/monosans/proxy-scraper-checker"

Expand All @@ -38,4 +36,4 @@ dev = [
"types-aiofiles==24.1.0.20240626",
"typing-extensions==4.12.2",
]
nuitka = ["nuitka==2.5.3"]
nuitka = ["nuitka==2.5.4"]
7 changes: 0 additions & 7 deletions start-termux.sh

This file was deleted.

2 changes: 1 addition & 1 deletion start.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
py -m venv --upgrade-deps .venv
.venv\Scripts\python.exe -m pip install -U --disable-pip-version-check --editable .[non-termux]
.venv\Scripts\python.exe -m pip install -U --disable-pip-version-check --editable .
.venv\Scripts\python.exe -m proxy_scraper_checker
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -eu

python3 -m venv --upgrade-deps .venv
.venv/bin/python3 -m pip install -U --disable-pip-version-check --editable .[non-termux]
.venv/bin/python3 -m pip install -U --disable-pip-version-check --editable .
.venv/bin/python3 -m proxy_scraper_checker
Loading

0 comments on commit 1d2c618

Please sign in to comment.