Implement PEP 735 Dependency Groups (#4800)

This commit is contained in:
Harshil
2025-05-24 03:48:52 -04:00
committed by GitHub
parent 8289a4fda6
commit 98e94a187f
12 changed files with 47 additions and 51 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ Setting things up
.. code-block:: bash
$ pip install -r requirements-dev-all.txt
$ pip install .[all] --group all
5. Install pre-commit hooks:
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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] --group all
- name: Test autogeneration of admonitions
run: pytest -v --tb=short tests/docs/admonition_inserter.py
+1 -1
View File
@@ -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] --group all
- name: Check Links
run: sphinx-build docs/source docs/build/html --keep-going -j auto -b linkcheck
- name: Upload linkcheck output
+1 -2
View File
@@ -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
+1 -5
View File
@@ -6,7 +6,6 @@ on:
- tests/**
- .github/workflows/unit_tests.yml
- pyproject.toml
- requirements-unit-tests.txt
push:
branches:
- master
@@ -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
+4 -1
View File
@@ -18,13 +18,16 @@ python:
install:
- method: pip
path: .
- requirements: requirements-dev-all.txt
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
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
@@ -0,0 +1,5 @@
dependencies = "Implement PEP 735 Dependency Groups for Development Dependencies"
[[pull_requests]]
uid = "4800"
author_uid = "harshil21"
closes_threads = ["4795"]
-10
View File
@@ -1,10 +0,0 @@
chango~=0.4.0
sphinx==8.2.3
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
+31
View File
@@ -94,6 +94,37 @@ webhooks = [
"tornado~=6.4",
]
[dependency-groups]
tests = [
# required for building the wheels for releases
"build",
# For the test suite
"pytest==8.3.5",
# needed because pytest doesn't come with native support for coroutines as tests
"pytest-asyncio==0.21.2",
# xdist runs tests in parallel
"pytest-xdist==3.6.1",
# Used for flaky tests (flaky decorator)
"flaky>=3.8.1",
# used in test_official for parsing tg docs
"beautifulsoup4",
# For testing with timezones. Might not be needed on all systems, but to ensure that unit tests
# run correctly on all systems, we include it here.
"tzdata",
]
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]
-5
View File
@@ -1,5 +0,0 @@
-e .[all]
# needed for pre-commit hooks in the git commit command
pre-commit
-r requirements-unit-tests.txt
-r docs/requirements-docs.txt
-23
View File
@@ -1,23 +0,0 @@
-e .
# required for building the wheels for releases
build
# For the test suite
pytest==8.3.5
# needed because pytest doesn't come with native support for coroutines as tests
pytest-asyncio==0.21.2
# xdist runs tests in parallel
pytest-xdist==3.6.1
# Used for flaky tests (flaky decorator)
flaky>=3.8.1
# used in test_official for parsing tg docs
beautifulsoup4
# For testing with timezones. Might not be needed on all systems, but to ensure that unit tests
# run correctly on all systems, we include it here.
tzdata