Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .github/workflows/format_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
uv run -m pip install pytest pytest-asyncio
uv lock --upgrade

- name: Compile requirements
run: |
uv pip compile requirements.in -o requirements.txt
uv pip compile requirements-dev.in -o requirements-dev.txt
uv pip compile requirements-docs.in -o requirements-docs.txt
git add requirements.txt requirements-dev.txt requirements-docs.txt

- name: Run ruff to lint and format code
run: |
uv tool run ruff check . --exit-zero
Expand Down
36 changes: 9 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
[project]
name = "electrogram"
dynamic = ["version"]
dynamic = ["version", "dependencies", "optional-dependencies"]
description = "Telegram MTProto API framework in Python, designed for fluid user and bot interactions."
authors = [{ name = "5hojib", email = "yesiamshojib@gmail.com" }]
license = { text = "MIT License" }
dependencies = [
"pysocks>=1.7.1",
"aiosqlite>=0.22.1",
"pymediainfo>=7.0.1",
"pymongo>=4.16.0",
"ElectroCrypto>=2.0.2",
"anyio>=4.12.1",
]
requires-python = ">=3.10"

classifiers = [
Expand All @@ -28,32 +20,22 @@ path = "pyrogram/__init__.py"

[tool.hatch.build.hooks.custom]

[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
dev = ["requirements-dev.txt"]
docs = ["requirements-docs.txt"]

[project.urls]
homepage = "https://github.com/AeonOrg/Electrogram"
community = "https://t.me/ProjectAeon"
repository = "https://github.com/AeonOrg/Electrogram"

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"

[project.optional-dependencies]
dev = [
"hatch>=1.16.3",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.0.0",
"twine>=6.2.0"
]

docs = [
"sphinx<10.0.0",
"sphinx-immaterial>=0.13.9",
"sphinx_copybutton>=0.5.2",
"sphinx-autobuild",
"tornado>=6.5.4"
]

[tool.hatch.metadata]
allow-direct-references = true

Expand Down
7 changes: 7 additions & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-r requirements.in
hatch
pytest
pytest-asyncio
pytest-cov
twine
docutils==0.21.2
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability, it would be helpful to add a comment explaining why docutils is pinned to this specific version. This will provide context for future developers who might need to update dependencies.

# Pinned to resolve a dependency conflict
docutils==0.21.2

198 changes: 198 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-dev.in -o requirements-dev.txt --python-version 3.10
aiosqlite==0.22.1
# via -r requirements.in
anyio==4.12.1
# via
# -r requirements.in
# httpx
backports-asyncio-runner==1.2.0
# via pytest-asyncio
backports-tarfile==1.2.0
# via jaraco-context
backports-zstd==1.3.0
# via hatch
certifi==2026.2.25
# via
# httpcore
# httpx
# requests
cffi==2.0.0
# via cryptography
charset-normalizer==3.4.5
# via requests
click==8.3.1
# via
# hatch
# userpath
coverage==7.13.4
# via pytest-cov
cryptography==46.0.5
# via secretstorage
distlib==0.4.0
# via virtualenv
dnspython==2.8.0
# via pymongo
docutils==0.21.2
# via
# -r requirements-dev.in
# readme-renderer
electrocrypto==2.0.2
# via -r requirements.in
exceptiongroup==1.3.1
# via
# anyio
# pytest
filelock==3.25.1
# via
# python-discovery
# virtualenv
h11==0.16.0
# via httpcore
hatch==1.16.5
# via -r requirements-dev.in
hatchling==1.29.0
# via hatch
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via hatch
hyperlink==21.0.0
# via hatch
id==1.6.1
# via twine
idna==3.11
# via
# anyio
# httpx
# hyperlink
# requests
importlib-metadata==8.7.1
# via keyring
iniconfig==2.3.0
# via pytest
jaraco-classes==3.4.0
# via keyring
jaraco-context==6.1.1
# via keyring
jaraco-functools==4.4.0
# via keyring
jeepney==0.9.0
# via
# keyring
# secretstorage
keyring==25.7.0
# via
# hatch
# twine
markdown-it-py==4.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.8.0
# via
# jaraco-classes
# jaraco-functools
nh3==0.3.3
# via readme-renderer
packaging==26.0
# via
# hatch
# hatchling
# pytest
# twine
pathspec==1.0.4
# via hatchling
pexpect==4.9.0
# via hatch
platformdirs==4.9.4
# via
# hatch
# python-discovery
# virtualenv
pluggy==1.6.0
# via
# hatchling
# pytest
# pytest-cov
ptyprocess==0.7.0
# via pexpect
pycparser==3.0
# via cffi
pygments==2.19.2
# via
# pytest
# readme-renderer
# rich
pymediainfo==7.0.1
# via -r requirements.in
pymongo==4.16.0
# via -r requirements.in
pyproject-hooks==1.2.0
# via hatch
pysocks==1.7.1
# via -r requirements.in
pytest==9.0.2
# via
# -r requirements-dev.in
# pytest-asyncio
# pytest-cov
pytest-asyncio==1.3.0
# via -r requirements-dev.in
pytest-cov==7.0.0
# via -r requirements-dev.in
python-discovery==1.1.3
# via
# hatch
# virtualenv
readme-renderer==44.0
# via twine
requests==2.32.5
# via
# requests-toolbelt
# twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==14.3.3
# via
# hatch
# twine
secretstorage==3.5.0
# via keyring
shellingham==1.5.4
# via hatch
tomli==2.4.0
# via
# coverage
# hatchling
# pytest
tomli-w==1.2.0
# via hatch
tomlkit==0.14.0
# via hatch
trove-classifiers==2026.1.14.14
# via hatchling
twine==6.2.0
# via -r requirements-dev.in
typing-extensions==4.15.0
# via
# anyio
# cryptography
# exceptiongroup
# pytest-asyncio
# virtualenv
urllib3==2.6.3
# via
# id
# requests
# twine
userpath==1.9.2
# via hatch
uv==0.10.9
# via hatch
virtualenv==21.2.0
# via hatch
zipp==3.23.0
# via importlib-metadata
6 changes: 6 additions & 0 deletions requirements-docs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-r requirements.in
sphinx
sphinx-immaterial
sphinx_copybutton
sphinx-autobuild
tornado
Loading
Loading