Skip to content

Commit

Permalink
Pyrofork: pyproject.toml migration
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <[email protected]>
Co-authored-by: Alisson Lauffer <[email protected]>
Co-authored-by: wulan17 <[email protected]>
  • Loading branch information
3 people committed Dec 7, 2023
1 parent 5a0c597 commit a5ae23c
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 103 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Include
include README.md COPYING COPYING.lesser NOTICE requirements.txt
include README.md COPYING COPYING.lesser NOTICE
recursive-include compiler *.py *.tl *.tsv *.txt
recursive-include tests *.py

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ venv:
$(RM) $(VENV)
python3 -m venv $(VENV)
$(PYTHON) -m pip install -U pip wheel setuptools
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt
$(PYTHON) -m pip install -U -e .
@echo "Created venv with $$($(PYTHON) --version)"

clean-docs:
Expand Down
6 changes: 0 additions & 6 deletions dev-requirements.txt

This file was deleted.

21 changes: 21 additions & 0 deletions hatch_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys

from hatchling.builders.hooks.plugin.interface import BuildHookInterface

# Add the current directory to the path, so we can import the compiler.
sys.path.insert(0, ".")


class CustomHook(BuildHookInterface):
"""A custom build hook for pyrofork."""

def initialize(self, version, build_data):
"""Initialize the hook."""
if self.target_name not in ["wheel", "install"]:
return

from compiler.api.compiler import start as compile_api
from compiler.errors.compiler import start as compile_errors

compile_api()
compile_errors()
86 changes: 86 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[project]
name = "pyrofork"
dynamic = ["version"]
description = "Fork of pyrogram. Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots"
authors = [{ name = "wulan17", email = "[email protected]" }]
dependencies = ["pyaes==1.6.1", "pysocks==1.7.1", "pymediainfo-pyrofork>=6.0.1,<7.0.0"]
readme = "README.md"
license = "LGPL-3.0-or-later"
requires-python = "~=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet",
"Topic :: Communications",
"Topic :: Communications :: Chat",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
keywords = ["telegram chat messenger mtproto api client library python"]

[tool.hatch.version]
path = "pyrogram/__init__.py"

# Used to call hatch_build.py
[tool.hatch.build.hooks.custom]

[project.urls]
Tracker = "https://github.com/Mayuri-Chan/PyroFork/issues"
Community = "https://t.me/MayuriChan_Chat"
Source = "https://github.com/Mayuri-Chan/PyroFork"
Documentation = "https://pyrofork.mayuri.my.id"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"pytest>=7.4.3",
"pytest-asyncio>=0.21.1",
"pytest-cov>=4.1.0",
"twine>=4.0.2",
]

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

[tool.hatch.build.targets.sdist]
exclude = [
".github/",
"docs/",
"tests/",
".editorconfig",
".gitignore",
".pre-commit-config.yaml",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"requirements.lock",
"requirements-dev.lock",
]

[tool.hatch.build.targets.wheel]
ignore-vcs = true
exclude = [
"compiler",
"docs",
"tests",
"venv",
"hatch_build.py"
]
package = ["pyrogram"]
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

88 changes: 0 additions & 88 deletions setup.py

This file was deleted.

4 changes: 0 additions & 4 deletions tox.ini

This file was deleted.

0 comments on commit a5ae23c

Please sign in to comment.