Skip to content

Commit

Permalink
setup.cfg/extras_require configuration (#1452)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
abhinavsingh authored Aug 12, 2024
1 parent 6602be3 commit 74c42f6
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-${{
Expand Down
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

...
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions requirements-metrics.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-release.txt

This file was deleted.

36 changes: 0 additions & 36 deletions requirements-testing.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements-tunnel.txt

This file was deleted.

55 changes: 53 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 74c42f6

Please sign in to comment.