`setup.cfg/extras_require` configuration (#1452)

* Remove usage of requirements file in favor of `setup.cfg/extras_require` configuration

* Fallback to setuptools-scm>=6 because >=7.0.5 dont support python 3.6, see https://github.com/abhinavsingh/proxy.py/pull/1345/files

* Remove unicode symbols from setup.cfg which causes parsing issues on python3.6, ref https://github.com/abhinavsingh/proxy.py/actions/runs/10346098737/job/28634186621\?pr\=1452
This commit is contained in:
Abhinav Singh 2024-08-12 11:57:57 +05:30 committed by GitHub
parent 6602be3da8
commit 74c42f6e57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 64 additions and 76 deletions

View File

@ -495,7 +495,7 @@ jobs:
${{ runner.os }}-pip-${{
steps.calc-cache-key-py.outputs.py-hash-key
}}-${{
hashFiles('tox.ini', 'requirements**.txt')
hashFiles('tox.ini', 'setup.cfg')
}}
restore-keys: |
${{ runner.os }}-pip-${{

View File

@ -60,12 +60,8 @@ repos:
dashboard/(
src/core/plugins/inspect_traffic\.json|
static/bootstrap-4\.3\.1\.min\.(cs|j)s
)|
requirements-release\.txt
)
$
- id: requirements-txt-fixer
exclude: >-
^(docs/requirements|requirements(|-(release|testing|tunnel)))\.txt$
# Non-modifying checks:
- id: name-tests-test
args:
@ -159,11 +155,11 @@ repos:
- paramiko == 2.11.0
- types-paramiko == 2.7.3
- types-requests==2.27.30
# From requirements-tunnel.txt
# [tunnel]
- cryptography==36.0.2; python_version <= '3.6'
- types-setuptools == 57.4.2
- pyyaml==5.3.1
# From requirements-metrics.txt
# [metrics]
- prometheus_client==0.20.0
args:
# FIXME: get rid of missing imports ignore

View File

@ -34,9 +34,7 @@ python:
# system_packages: false
install:
- method: pip
path: .
- requirements: requirements-tunnel.txt
path: .[tunnel,metrics]
- requirements: docs/requirements.txt
- requirements: requirements-metrics.txt
...

View File

@ -101,11 +101,7 @@ lib-clean:
lib-dep:
pip install --upgrade pip && \
pip install \
-r requirements-testing.txt \
-r requirements-release.txt \
-r requirements-tunnel.txt \
-r requirements-metrics.txt && \
pip install -e .[testing,release,tunnel,metrics] && \
pip install "setuptools>=42"
lib-pre-commit:

View File

@ -1473,9 +1473,7 @@ Above:
**This is a WIP and may not work as documented**
Requires `paramiko` to work.
See [requirements-tunnel.txt](https://github.com/abhinavsingh/proxy.py/blob/develop/requirements-tunnel.txt)
Requires `paramiko` to work. Install dependencies using `pip install "proxy.py[tunnel]"`
## Proxy Remote Requests Locally

View File

@ -4,7 +4,7 @@ requires = [
"setuptools",
# Plugins
"setuptools-scm[toml]>=7.0.5",
"setuptools-scm[toml]>=6,!=7.0.0,!=7.0.1,!=7.0.2",
]
build-backend = "setuptools.build_meta"

View File

@ -1,2 +0,0 @@
prometheus_client==0.17.1; python_version < '3.8'
prometheus_client==0.20.0; python_version >= '3.8'

View File

@ -1,2 +0,0 @@
setuptools-scm == 6.3.2
twine==3.8.0

View File

@ -1,36 +0,0 @@
wheel==0.37.1
python-coveralls==2.9.3
coverage==6.2; python_version < '3.11'
coverage==7.4.4; python_version >= '3.11'
flake8==4.0.1
# pytest for Python<3.11
pytest==7.0.1; python_version < '3.11'
pytest-cov==3.0.0; python_version < '3.11'
pytest-xdist==2.5.0; python_version < '3.11'
pytest-mock==3.6.1; python_version < '3.11'
pytest-asyncio==0.16.0; python_version < '3.11'
# pytest for Python>=3.11
pytest==8.1.1; python_version >= '3.11'
pytest-cov==5.0.0; python_version >= '3.11'
pytest-xdist==3.5.0; python_version >= '3.11'
pytest-mock==3.14.0; python_version >= '3.11'
pytest-asyncio==0.21.1; python_version >= '3.11'
autopep8==1.6.0
mypy==0.971
py-spy==0.3.12
tox==3.28.0; python_version < '3.11'
tox==4.14.2; python_version >= '3.11'
mccabe==0.6.1
pylint==2.13.7; python_version < '3.11'
pylint==3.1.0; python_version >= '3.11'
rope==1.1.1
# Required by test_http2.py
httpx==0.22.0; python_version < '3.11'
httpx==0.27.0; python_version >= '3.11'
h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
pre-commit==2.16.0
# Types
types-requests==2.28.11.5
types-setuptools==64.0.1

View File

@ -1,6 +0,0 @@
paramiko==2.11.0; python_version < '3.11'
paramiko==3.4.0; python_version >= '3.11'
types-paramiko==2.11.3; python_version < '3.11'
types-paramiko==3.4.0.20240311; python_version >= '3.11'
cryptography==36.0.2; python_version <= '3.6'
cryptography==39.0.1; python_version > '3.6'

View File

@ -14,7 +14,7 @@ project_urls =
GitHub: issues = https://github.com/abhinavsingh/proxy.py/issues
GitHub: repo = https://github.com/abhinavsingh/proxy.py
download_url = https://github.com/abhinavsingh/proxy.py/archive/master.zip
description = ⚡ Fast • 🪶 Lightweight • 0⃣ Dependency • 🔌 Pluggable • 😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Mans VPN • ⏪ Reverse & ⏩ Forward • 👮🏿 Proxy Server framework • 🌐 Web Server framework • ➵ ➶ ➷ ➠ PubSub framework • 👷 Work acceptor & executor framework.
description = \u26a1 Fast \u2022 \U0001fab6 Lightweight \u2022 \U0001f51f Dependency \u2022 \U0001f50c Pluggable \u2022 \U0001f608 TLS interception \u2022 \U0001f512 DNS-over-HTTPS \u2022 \U0001f525 Poor Mans VPN \u2022 \u23ea Reverse & \u23e9 Forward \u2022 \U0001f46e\U0001f3ff Proxy Server framework \u2022 \U0001f310 Web Server framework \u2022 \u27b5 \u27b6 \u27b7 \u27a0 PubSub framework \u2022 \U0001f477 Work acceptor & executor framework.
long_description = file: README.md
long_description_content_type = text/markdown
author = Abhinav Singh
@ -106,9 +106,60 @@ packages = find:
include_package_data = True
zip_safe = False
# These are required in actual runtime:
install_requires =
[options.extras_require]
metrics =
prometheus_client==0.17.1; python_version < '3.8'
prometheus_client==0.20.0; python_version >= '3.8'
release =
setuptools-scm==6.3.2
twine==3.8.0
tunnel =
paramiko==2.11.0; python_version < '3.11'
paramiko==3.4.0; python_version >= '3.11'
types-paramiko==2.11.3; python_version < '3.11'
types-paramiko==3.4.0.20240311; python_version >= '3.11'
cryptography==36.0.2; python_version <= '3.6'
cryptography==39.0.1; python_version > '3.6'
testing =
wheel==0.37.1
python-coveralls==2.9.3
coverage==6.2; python_version < '3.11'
coverage==7.4.4; python_version >= '3.11'
flake8==4.0.1
# pytest for Python<3.11
pytest==7.0.1; python_version < '3.11'
pytest-cov==3.0.0; python_version < '3.11'
pytest-xdist==2.5.0; python_version < '3.11'
pytest-mock==3.6.1; python_version < '3.11'
pytest-asyncio==0.16.0; python_version < '3.11'
# pytest for Python>=3.11
pytest==8.1.1; python_version >= '3.11'
pytest-cov==5.0.0; python_version >= '3.11'
pytest-xdist==3.5.0; python_version >= '3.11'
pytest-mock==3.14.0; python_version >= '3.11'
pytest-asyncio==0.21.1; python_version >= '3.11'
autopep8==1.6.0
mypy==0.971
py-spy==0.3.12
tox==3.28.0; python_version < '3.11'
tox==4.14.2; python_version >= '3.11'
mccabe==0.6.1
pylint==2.13.7; python_version < '3.11'
pylint==3.1.0; python_version >= '3.11'
rope==1.1.1
# Required by test_http2.py
httpx==0.22.0; python_version < '3.11'
httpx==0.27.0; python_version >= '3.11'
h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
pre-commit==2.16.0
# Types
types-requests==2.28.11.5
types-setuptools==64.0.1
[options.entry_points]
console_scripts =
proxy = proxy:entry_point

11
tox.ini
View File

@ -5,9 +5,7 @@ minversion = 3.21.0
[testenv]
deps =
-rrequirements-testing.txt
-rrequirements-tunnel.txt
-rrequirements-metrics.txt
.[testing,tunnel,metrics]
# NOTE: The command is invoked by the script name and not via
# NOTE: `{envpython} -m pytest` because it'd add CWD into $PYTHONPATH
# NOTE: testing the project from the Git checkout
@ -26,8 +24,7 @@ allowlist_externals =
basepython = python3
commands_pre =
{envpython} -m pip install \
-r{toxinidir}/requirements-tunnel.txt \
-r{toxinidir}/requirements-metrics.txt
{toxinidir}[tunnel,metrics]
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
@ -265,9 +262,7 @@ deps =
pylint >= 2.5.3
pylint-pytest < 1.1.0
-r docs/requirements.in
-r requirements-tunnel.txt
-r requirements-metrics.txt
-r requirements-testing.txt
-r benchmark/requirements.txt
.[tunnel,metrics,testing]
isolated_build = true
skip_install = true