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

Change tosrc Layout#4798

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

Draft
Bibo-Joshi wants to merge2 commits intomaster
base:master
Choose a base branch
Loading
fromsrc-layout
Draft
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
10 changes: 9 additions & 1 deletion.github/CONTRIBUTING.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,15 @@ Setting things up
$ pip install -r requirements-dev-all.txt


5. Install pre-commit hooks:
5. Install the package in development mode:

.. code-block:: bash

$ pip install -e .

This is necessary because python-telegram-bot uses a src-based layout where the package code is located in the ``src/`` directory.

6. Install pre-commit hooks:

.. code-block:: bash

Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/docs-admonitions.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ name: Test Admonitions Generation
on:
pull_request:
paths:
- telegram/**
-src/telegram/**
- docs/**
- .github/workflows/docs-admonitions.yml
push:
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/test_official.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ name: Bot API Tests
on:
pull_request:
paths:
-telegram/**
-src/telegram/**
-tests/**
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/type_completeness.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ name: Check Type Completeness
on:
pull_request:
paths:
- telegram/**
-src/telegram/**
- pyproject.toml
- .github/workflows/type_completeness.yml
push:
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/unit_tests.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ name: Unit Tests
on:
pull_request:
paths:
- telegram/**
-src/telegram/**
- tests/**
- .github/workflows/unit_tests.yml
- pyproject.toml
Expand Down
5 changes: 5 additions & 0 deletionschanges/unreleased/4798.g7G3jRf2ns4ath9LRFEcit.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
internal = "Change to `src` Layout"
[[pull_requests]]
uid = "4798"
author_uid = "Bibo-Joshi"
closes_threads = ["4797"]
19 changes: 11 additions & 8 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -99,11 +99,13 @@ webhooks = [
[tool.hatch.version]
# dynamically evaluates the `__version__` variable in that file
source = "code"
path = "telegram/_version.py"
search-paths = ["telegram"]
path = "src/telegram/_version.py"
search-paths = ["src"]

[tool.hatch.build]
packages = ["telegram"]
packages = ["src/telegram"]
package-data = {"telegram" = ["py.typed"]}
src-layout = true

# CHANGO
[tool.chango]
Expand DownExpand Up@@ -136,9 +138,9 @@ select = ["E", "F", "I", "PL", "UP", "RUF", "PTH", "C4", "B", "PIE", "SIM", "RET
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["B018"]
"tests/**.py" = ["RUF012", "ASYNC230", "DTZ", "ARG", "T201", "ASYNC109", "D", "S", "TRY"]
"telegram/**.py" = ["TRY003"]
"telegram/ext/_applicationbuilder.py" = ["TRY004"]
"telegram/ext/filters.py" = ["D102"]
"src/telegram/**.py" = ["TRY003"]
"src/telegram/ext/_applicationbuilder.py" = ["TRY004"]
"src/telegram/ext/filters.py" = ["D102"]
"docs/**.py" = ["INP001", "ARG", "D", "TRY003", "S"]
"examples/**.py" = ["ARG", "D", "S105", "TRY003"]

Expand DownExpand Up@@ -166,6 +168,7 @@ exclude-protected = ["_unfrozen"]
# PYTEST:
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
addopts = "--no-success-flaky-report -rX"
filterwarnings = [
"error",
Expand DownExpand Up@@ -230,12 +233,12 @@ ignore_missing_imports = true
# COVERAGE:
[tool.coverage.run]
branch = true
source = ["telegram"]
source = ["src/telegram"]
parallel = true
concurrency = ["thread", "multiprocessing"]
omit = [
"tests/",
"telegram/__main__.py"
"src/telegram/__main__.py"
]

[tool.coverage.report]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletionstests/README.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,12 @@ PTB uses `pytest`_ for testing. To run the tests, you need to
have pytest installed along with a few other dependencies. You can find the list of dependencies
in the ``pyproject.toml`` file in the root of the repository.

Since PTB uses a src-based layout, make sure you have installed the package in development mode before running the tests:

.. code-block:: bash

$ pip install -e .

Running tests
=============

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp