Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update test workflow to python3.13 and poetry1.8.4 #175

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/py-to-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9"]
poetry-version: ["1.3.1"]
python-version: ["3.13"]
poetry-version: ["1.8.4"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-test-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
poetry-version: ["1.2.2", "1.3.1"]
python-version: ["3.9", "3.10", "3.12", "3.13"]
poetry-version: ["1.7.1", "1.8.4"]

steps:
- uses: actions/checkout@v3
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim as base
FROM python:3.13-slim AS base

ENV \
# Keeps Python from generating .pyc files in the container
Expand All @@ -15,12 +15,17 @@ ENV \
RUN \
pip install -U poetry

FROM base as builder
FROM base AS builder

WORKDIR /app
COPY poetry.lock pyproject.toml ./

RUN poetry config virtualenvs.create false && \
RUN apt-get update && \
apt-get install -y gcc libc-dev libffi-dev && \
poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi --no-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
poetry install --no-interaction --no-ansi --no-dev

bluet marked this conversation as resolved.
Show resolved Hide resolved
COPY proxybroker proxybroker
Expand Down
2 changes: 1 addition & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION=v2.0.0-alpha6
VERSION=v2.0.0-alpha7

docker build --pull -t bluet/proxybroker2 .
docker scan bluet/proxybroker2:latest
Expand Down
1,100 changes: 648 additions & 452 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions proxybroker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,12 @@ def serve(self, host='127.0.0.1', port=8888, limit=100, **kwargs):
loop=self._loop,
**kwargs,
)
self._server.start()

task = asyncio.ensure_future(self.find(limit=limit, **kwargs))
self._all_tasks.append(task)
async def run_server():
await self._server.start()
self._loop.create_task(self.find(limit=limit, **kwargs))

self._loop.run_until_complete(run_server())

async def _load(self, data, check=True):
"""Looking for proxies in the passed data.
Expand Down
18 changes: 8 additions & 10 deletions proxybroker/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,14 @@ def __init__(
self._resolver = Resolver(loop=self._loop)
self._http_allowed_codes = http_allowed_codes or []

def start(self):

srv = asyncio.start_server(
self._accept,
host=self.host,
port=self.port,
backlog=self._backlog,
loop=self._loop,
async def start(self):
srv = await asyncio.start_server(
self._handle,
self.host,
self.port,
backlog=self._backlog
)
self._server = self._loop.run_until_complete(srv)
self._server = srv

log.info(
'Listening established on {0}'.format(self._server.sockets[0].getsockname())
Expand Down Expand Up @@ -424,4 +422,4 @@ def _inject_headers(self, data, scheme, headers):
custom_lines.append(rest_lines)
data = b'\r\n'.join(custom_lines)

return data
return data
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ classifiers = [
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
bluet marked this conversation as resolved.
Show resolved Hide resolved
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
Expand All @@ -29,7 +31,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
bluet marked this conversation as resolved.
Show resolved Hide resolved
aiohttp = "3.10.2"
aiodns = "3.1.1"
attrs = "^22.1.0"
Expand Down
Loading