mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 03:54:51 +00:00
Pyrofork: pyproject.toml migration
Signed-off-by: wulan17 <wulan17@nusantararom.org> Co-authored-by: Alisson Lauffer <alissonvitortc@gmail.com> Co-authored-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
83976b6a72
commit
b88fa8a673
11 changed files with 129 additions and 116 deletions
10
.github/workflows/python-publish.yml
vendored
10
.github/workflows/python-publish.yml
vendored
|
|
@ -30,12 +30,12 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build twine
|
||||
pip install -e '.[dev]'
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
run: hatch build
|
||||
- name: Publish package
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||
HATCH_INDEX_USER: __token__
|
||||
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: |
|
||||
twine upload dist/*
|
||||
hatch publish
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ make clean
|
|||
make clean-docs
|
||||
make venv
|
||||
make api
|
||||
"$VENV"/bin/pip install -r docs/requirements.txt
|
||||
"$VENV"/bin/pip install -e '.[docs]'
|
||||
cd compiler/docs && "$VENV"/bin/python compiler.py
|
||||
cd ../..
|
||||
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
-r requirements.txt
|
||||
|
||||
pytest
|
||||
pytest-asyncio
|
||||
pytest-cov
|
||||
twine
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
sphinx
|
||||
sphinx_rtd_theme==2.0.0
|
||||
sphinx-rtd-dark-mode
|
||||
sphinx_copybutton
|
||||
sphinx-autobuild
|
||||
tgcrypto
|
||||
tornado>=6.3.3 # not directly required, pinned by Snyk to avoid a vulnerability
|
||||
21
hatch_build.py
Normal file
21
hatch_build.py
Normal file
|
|
@ -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()
|
||||
100
pyproject.toml
Normal file
100
pyproject.toml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
[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 = "mayuri@mayuri.my.id" }]
|
||||
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"
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"hatch>=1.7.0",
|
||||
"pytest>=7.4.3",
|
||||
"pytest-asyncio>=0.21.1",
|
||||
"pytest-cov>=4.1.0",
|
||||
"twine>=4.0.2"
|
||||
]
|
||||
|
||||
docs = [
|
||||
"sphinx",
|
||||
"sphinx_rtd_theme==2.0.0",
|
||||
"sphinx-rtd-dark-mode",
|
||||
"sphinx_copybutton",
|
||||
"sphinx-autobuild",
|
||||
"tornado>=6.3.3"
|
||||
]
|
||||
|
||||
speedup = [
|
||||
"tgcrypto>=1.2.5",
|
||||
"uvloop>=0.18.0"
|
||||
]
|
||||
|
||||
[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"]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
pyaes==1.6.1
|
||||
pymediainfo-pyrofork>=6.0.1,<7.0.0
|
||||
pysocks==1.7.1
|
||||
88
setup.py
88
setup.py
|
|
@ -1,88 +0,0 @@
|
|||
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
|
||||
#
|
||||
# This file is part of Pyrogram.
|
||||
#
|
||||
# Pyrogram is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Pyrogram is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import re
|
||||
from sys import argv
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
from compiler.api import compiler as api_compiler
|
||||
from compiler.errors import compiler as errors_compiler
|
||||
|
||||
with open("requirements.txt", encoding="utf-8") as r:
|
||||
requires = [i.strip() for i in r]
|
||||
|
||||
with open("pyrogram/__init__.py", encoding="utf-8") as f:
|
||||
version = re.findall(r"__version__ = \"(.+)\"", f.read())[0]
|
||||
|
||||
with open("README.md", encoding="utf-8") as f:
|
||||
readme = f.read()
|
||||
|
||||
if len(argv) > 1 and argv[1] in ["bdist_wheel", "install", "develop"]:
|
||||
api_compiler.start()
|
||||
errors_compiler.start()
|
||||
|
||||
setup(
|
||||
name="PyroFork",
|
||||
version=version,
|
||||
description="Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots",
|
||||
long_description=readme,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/Mayuri-Chan/pyrofork",
|
||||
download_url="https://github.com/Mayuri-Chan/pyrofork/releases/latest",
|
||||
author="wulan17",
|
||||
author_email="mayuri@mayuri.my.id",
|
||||
license="LGPLv3",
|
||||
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",
|
||||
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",
|
||||
},
|
||||
python_requires="~=3.7",
|
||||
package_data={
|
||||
"pyrogram": ["py.typed"],
|
||||
},
|
||||
packages=find_packages(exclude=["compiler*", "tests*"]),
|
||||
zip_safe=False,
|
||||
install_requires=requires
|
||||
)
|
||||
4
tox.ini
4
tox.ini
|
|
@ -1,4 +0,0 @@
|
|||
[testenv]
|
||||
deps = -rdev-requirements.txt
|
||||
commands = coverage run -m pytest {posargs}
|
||||
skip_install = true
|
||||
Loading…
Reference in a new issue