Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement PEP 735 Dependency Groups#4800

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
harshil21 wants to merge7 commits intomaster
base:master
Choose a base branch
Loading
frompep-735
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion.github/CONTRIBUTING.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ Setting things up

.. code-block:: bash

$ pip install-r requirements-dev-all.txt
$ pip install.[all] --groupall


5. Install pre-commit hooks:
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/chango.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,7 +54,7 @@ jobs:
run: |
cd ./target-repo
git add changes/unreleased/*
pip install . -r docs/requirements-docs.txt
pip install . --group docs
VERSION_TAG=$(python -c "from telegram import __version__; print(f'{__version__}')")
chango release --uid $VERSION_TAG

Expand Down
4 changes: 2 additions & 2 deletions.github/workflows/docs-admonitions.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,10 +32,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install-r requirements-dev-all.txt
python -W ignore -m pip install.[all] --groupall
- name: Test autogeneration of admonitions
run: pytest -v --tb=short tests/docs/admonition_inserter.py
2 changes: 1 addition & 1 deletion.github/workflows/docs-linkcheck.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install-r requirements-dev-all.txt
python -W ignore -m pip install.[all] --groupall
- name: Check Links
run: sphinx-build docs/source docs/build/html --keep-going -j auto -b linkcheck
- name: Upload linkcheck output
Expand Down
3 changes: 1 addition & 2 deletions.github/workflows/test_official.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,7 @@ jobs:
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install .[all]
python -W ignore -m pip install -r requirements-unit-tests.txt
python -W ignore -m pip install .[all] --group tests
- name: Compare to official api
run: |
pytest -v tests/test_official/test_official.py --junit-xml=.test_report_official.xml
Expand Down
6 changes: 1 addition & 5 deletions.github/workflows/unit_tests.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@ on:
-tests/**
-.github/workflows/unit_tests.yml
-pyproject.toml
-requirements-unit-tests.txt
push:
branches:
-master
Expand DownExpand Up@@ -34,14 +33,11 @@ jobs:
with:
python-version:${{ matrix.python-version }}
cache:'pip'
cache-dependency-path:'**/requirements*.txt'
-name:Install dependencies
run:|
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -U pytest-cov
python -W ignore -m pip install .
python -W ignore -m pip install -r requirements-unit-tests.txt
python -W ignore -m pip install pytest-xdist
python -W ignore -m pip install . --group tests
-name:Test with pytest
# We run 4 different suites here
Expand Down
7 changes: 6 additions & 1 deletion.readthedocs.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,18 @@ python:
install:
- method: pip
path: .
- requirements: requirements-dev-all.txt
extra_requirements:
- all # install all optional dependencies

build:
os: ubuntu-22.04
tools:
python: "3" # latest stable cpython version
jobs:
install:
- pip install -U pip
- pip install .[all] --group 'all' # install all the dependency groups
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

[all] is probably duplicate here, right? It's already listed in line 22


post_build:
# Based on https://github.com/readthedocs/readthedocs.org/issues/3242#issuecomment-1410321534
# This provides a HTML zip file for download, with the same structure as the hosted website
Expand Down
7 changes: 7 additions & 0 deletionschanges/unreleased/4800.2Z9Q8uvzdU2TqMJ9biBLam.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
dependencies ="Implement PEP 735 Dependency Groups"
documentation ="Implement PEP 735 Dependency Groups"
internal ="Implement PEP 735 Dependency Groups"
Comment on lines +1 to +3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
dependencies ="Implement PEP 735 Dependency Groups"
documentation ="Implement PEP 735 Dependency Groups"
internal ="Implement PEP 735 Dependency Groups"
dependencies ="Implement PEP 735 Dependency Groups for Development Dependencies"

[[pull_requests]]
uid ="4800"
author_uid ="harshil21"
closes_threads = ["4795"]
10 changes: 0 additions & 10 deletionsdocs/requirements-docs.txt
View file
Open in desktop

This file was deleted.

164 changes: 111 additions & 53 deletionspyproject.toml
View file
Open in desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What are all the unrelated formatting changes about? I prefer not to have them in this PR. If you use some toml formatter that you think is worth introducing, then let's do that in a standalone PR :)

Original file line numberDiff line numberDiff line change
Expand Up@@ -11,16 +11,8 @@ readme = "README.rst"
requires-python =">=3.9"
license ="LGPL-3.0-only"
license-files = ["LICENSE","LICENSE.dual","LICENSE.lesser"]
authors = [
{name ="Leandro Toledo",email ="devs@python-telegram-bot.org" }
]
keywords = [
"python",
"telegram",
"bot",
"api",
"wrapper",
]
authors = [{name ="Leandro Toledo",email ="devs@python-telegram-bot.org" }]
keywords = ["python","telegram","bot","api","wrapper"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All@@ -37,9 +29,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"httpx ~= 0.27",
]
dependencies = ["httpx ~= 0.27"]

[project.urls]
"Homepage" ="https://python-telegram-bot.org"
Expand All@@ -61,39 +51,52 @@ dependencies = [
# When adding new groups, make sure to update `ext` and `all` accordingly

# Optional dependencies for production
all = [
"python-telegram-bot[ext,http2,passport,socks]",
]
all = ["python-telegram-bot[ext,http2,passport,socks]"]
callback-data = [
# Cachetools doesn't have a strict stability policy. Let's be cautious for now.
"cachetools>=5.3.3,<5.6.0",
]
ext = [
"python-telegram-bot[callback-data,job-queue,rate-limiter,webhooks]",
]
http2 = [
"httpx[http2]",
]
ext = ["python-telegram-bot[callback-data,job-queue,rate-limiter,webhooks]"]
http2 = ["httpx[http2]"]
job-queue = [
# APS doesn't have a strict stability policy. Let's be cautious for now.
"APScheduler>=3.10.4,<3.12.0",
]
passport = [
"cryptography!=3.4,!=3.4.1,!=3.4.2,!=3.4.3,>=39.0.1",
# cffi is a dependency of cryptography and added support for python 3.13 in 1.17.0rc1
"cffi >= 1.17.0rc1; python_version > '3.12'"
]
rate-limiter = [
"aiolimiter>=1.1,<1.3",
]
socks = [
"httpx[socks]",
"cffi >= 1.17.0rc1; python_version > '3.12'",
]
rate-limiter = ["aiolimiter>=1.1,<1.3"]
socks = ["httpx[socks]"]
webhooks = [
# tornado is rather stable, but let's not allow the next major release without prior testing
"tornado~=6.4",
]

[dependency-groups]
tests = [
"build",
"pytest==8.3.5",
"pytest-asyncio==0.21.2",
"pytest-xdist==3.6.1",
"flaky>=3.8.1",
"beautifulsoup4",
"tzdata",
]
Comment on lines +78 to +86
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add the comments from the req file? At least the one about tzdate is useful IMO

docs = [
"chango~=0.4.0; python_version >= '3.12'",
"sphinx==8.2.3; python_version >= '3.11'",
"furo==2024.8.6",
"furo-sphinx-search @ git+https://github.com/harshil21/furo-sphinx-search@v0.2.0.1",
"sphinx-paramlinks==0.6.0",
"sphinxcontrib-mermaid==1.0.0",
"sphinx-copybutton==0.5.2",
"sphinx-inline-tabs==2023.4.21",
# Temporary. See #4387
"sphinx-build-compatibility @ git+https://github.com/readthedocs/sphinx-build-compatibility.git@58aabc5f207c6c2421f23d3578adc0b14af57047",
]
all = ["pre-commit", {include-group ="tests" }, {include-group ="docs" }]

# HATCH
[tool.hatch.version]
Expand All@@ -108,14 +111,14 @@ packages = ["telegram"]
# CHANGO
[tool.chango]
sys_path ="changes"
chango_instance = {name="chango_instance",module ="config" }
chango_instance = {name="chango_instance",module ="config" }

# BLACK:
[tool.black]
line-length =99

# ISORT:
[tool.isort]# black config
[tool.isort]# black config
profile ="black"
line_length =99

Expand All@@ -127,15 +130,66 @@ show-fixes = true
[tool.ruff.lint]
typing-extensions =false
ignore = ["PLR2004","PLR0911","PLR0912","PLR0913","PLR0915","PERF203"]
select = ["E","F","I","PL","UP","RUF","PTH","C4","B","PIE","SIM","RET","RSE",
"G","ISC","PT","ASYNC","TCH","SLOT","PERF","PYI","FLY","AIR","RUF022",
"RUF023","Q","INP","W","YTT","DTZ","ARG","T20","FURB","DOC","TRY",
"D100","D101","D102","D103","D300","D418","D419","S"]
select = [
"E",
"F",
"I",
"PL",
"UP",
"RUF",
"PTH",
"C4",
"B",
"PIE",
"SIM",
"RET",
"RSE",
"G",
"ISC",
"PT",
"ASYNC",
"TCH",
"SLOT",
"PERF",
"PYI",
"FLY",
"AIR",
"RUF022",
"RUF023",
"Q",
"INP",
"W",
"YTT",
"DTZ",
"ARG",
"T20",
"FURB",
"DOC",
"TRY",
"D100",
"D101",
"D102",
"D103",
"D300",
"D418",
"D419",
"S",
]
# Add "A (flake8-builtins)" after we drop pylint

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["B018"]
"tests/**.py" = ["RUF012","ASYNC230","DTZ","ARG","T201","ASYNC109","D","S","TRY"]
"tests/**.py" = [
"RUF012",
"ASYNC230",
"DTZ",
"ARG",
"T201",
"ASYNC109",
"D",
"S",
"TRY",
]
"telegram/**.py" = ["TRY003"]
"telegram/ext/_applicationbuilder.py" = ["TRY004"]
"telegram/ext/filters.py" = ["D102"]
Expand All@@ -148,11 +202,22 @@ convention = "google"
# PYLINT:
[tool.pylint."messagescontrol"]
enable = ["useless-suppression"]
disable = ["duplicate-code","too-many-arguments","too-many-public-methods",
"too-few-public-methods","broad-exception-caught","too-many-instance-attributes",
"fixme","missing-function-docstring","missing-class-docstring","too-many-locals",
"too-many-lines","too-many-branches","too-many-statements","cyclic-import",
"too-many-positional-arguments",
disable = [
"duplicate-code",
"too-many-arguments",
"too-many-public-methods",
"too-few-public-methods",
"broad-exception-caught",
"too-many-instance-attributes",
"fixme",
"missing-function-docstring",
"missing-class-docstring",
"too-many-locals",
"too-many-lines",
"too-many-branches",
"too-many-statements",
"cyclic-import",
"too-many-positional-arguments",
]

[tool.pylint.main]
Expand All@@ -178,7 +243,7 @@ filterwarnings = [
# ignore::telegram.utils.deprecate.TelegramDeprecationWarning
]
markers = [
"dev",# If you want to test a specific test, use this
"dev",# If you want to test a specific test, use this
"no_req",
"req",
]
Expand All@@ -204,7 +269,7 @@ module = [
"telegram._callbackquery",
"telegram._file",
"telegram._message",
"telegram._files.file"
"telegram._files.file",
]
strict_optional =false

Expand All@@ -223,7 +288,7 @@ module = [
"uvicorn.*",
"asgiref.*",
"django.*",
"apscheduler.*",# not part of `customwebhookbot_*.py` examples
"apscheduler.*",# not part of `customwebhookbot_*.py` examples
]
ignore_missing_imports =true

Expand All@@ -233,14 +298,7 @@ branch = true
source = ["telegram"]
parallel =true
concurrency = ["thread","multiprocessing"]
omit = [
"tests/",
"telegram/__main__.py"
]
omit = ["tests/","telegram/__main__.py"]

[tool.coverage.report]
exclude_also = [
"@overload",
"@abstractmethod",
"if TYPE_CHECKING:"
]
exclude_also = ["@overload","@abstractmethod","if TYPE_CHECKING:"]
5 changes: 0 additions & 5 deletionsrequirements-dev-all.txt
View file
Open in desktop

This file was deleted.

Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp