Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #41

Open
wants to merge 42 commits into
base: dev
Choose a base branch
from
Open

Test #41

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
353f5e3
update
5hojib Nov 24, 2024
ea247c2
update compiler.py
5hojib Nov 24, 2024
f5a1c8d
rye to uv
5hojib Nov 24, 2024
73b1d6b
InkyPinkyPonky [no ci]
5hojib Nov 24, 2024
4f66472
update format_and_test.yml
5hojib Nov 24, 2024
8973200
update format_and_test.yml
5hojib Nov 24, 2024
7f33bf6
update format_and_test.yml
5hojib Nov 24, 2024
1362548
update format_and_test.yml
5hojib Nov 24, 2024
1dc3280
update
5hojib Nov 25, 2024
40369f2
InkyPinkyPonky [no ci]
5hojib Nov 25, 2024
d6152e3
update format_and_test.yml
5hojib Nov 25, 2024
917faab
update format_and_test.yml
5hojib Nov 25, 2024
5bcc76e
update format_and_test.yml
5hojib Nov 25, 2024
83253c5
update
5hojib Nov 25, 2024
dc04ca5
InkyPinkyPonky [no ci]
5hojib Nov 25, 2024
c7d85ad
update pyproject.toml
5hojib Nov 25, 2024
6f35ee0
InkyPinkyPonky [no ci]
5hojib Nov 25, 2024
051c4f8
update pyproject.toml
5hojib Nov 25, 2024
7fa6941
update pyproject.toml
5hojib Nov 25, 2024
55b4a93
update
5hojib Nov 25, 2024
8a2136c
update bound-methods.rst
5hojib Nov 25, 2024
0be2603
update layer 195, and some refector
5hojib Nov 30, 2024
3f17acd
InkyPinkyPonky [no ci]
5hojib Nov 30, 2024
6f09012
update
5hojib Nov 30, 2024
d4d2deb
InkyPinkyPonky [no ci]
5hojib Nov 30, 2024
4a84c6c
update
5hojib Nov 30, 2024
9caf228
InkyPinkyPonky [no ci]
5hojib Nov 30, 2024
33fa188
update file_storage.py
5hojib Nov 30, 2024
770050e
InkyPinkyPonky [no ci]
5hojib Nov 30, 2024
cdb4b17
update get_messages.py
5hojib Nov 30, 2024
01faae7
update pyproject.toml
5hojib Dec 1, 2024
fc3f446
update pyproject.toml
5hojib Dec 2, 2024
c421f0c
update pyproject.toml
5hojib Dec 2, 2024
1a694a2
InkyPinkyPonky [no ci]
5hojib Dec 2, 2024
37dcd74
update
5hojib Dec 12, 2024
c67b235
InkyPinkyPonky [no ci]
5hojib Dec 12, 2024
131246c
update rsa.py
5hojib Dec 12, 2024
7840267
InkyPinkyPonky [no ci]
5hojib Dec 12, 2024
0848d91
update
5hojib Dec 28, 2024
9bdd59b
update main_api.tl
5hojib Dec 28, 2024
646e9e8
update main_api.tl
5hojib Dec 30, 2024
522d6b2
update main_api.tl
5hojib Jan 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .github/workflows/docs_gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:

jobs:
build:

runs-on: ubuntu-22.04

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/error_scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:

jobs:
build:
permissions:
id-token: write
name: scrape-errors
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/format_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Format and Test Code with Rye
name: Format and test code with uv

on:
push:
Expand All @@ -20,20 +20,24 @@ jobs:
with:
python-version: "3.13"

- name: Install the latest version of rye
uses: eifinger/setup-rye@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
version: "latest"

- name: Install dependencies
run: |
rye pin 3.12
rye sync
uv python install 3.13
uv run -m ensurepip --upgrade
uv run -m pip install --upgrade pip
uv tool install pytest
uv run -m pip install pytest
uv lock --upgrade

- name: Run ruff to lint and format code
run: |
rye run ruff check . --exit-zero
rye fmt
uv tool run ruff check . --exit-zero
uv tool run ruff format .
git add -u

- name: Commit and push changes
Expand All @@ -49,8 +53,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GX_TOKEN }}

- name: Generate API
run: rye run api

- name: Run tests
run: rye run python -m pytest
run: uv run -m pytest
10 changes: 5 additions & 5 deletions .github/workflows/tag_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ jobs:
release_name: Release ${{ env.VERSION }}
body_path: ./release_notes.txt

- name: Build
- name: Build and publish
if: env.RELEASE_EXISTS == 'false'
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
hatch build

- name: Publish
if: env.RELEASE_EXISTS == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
hatch publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ This repository is a personal clone of Pyrogram, created specifically for my pro
Please understand that any issues, modifications, or deviations from the original project are solely my responsibility. Do not hold me accountable for any problems or discrepancies that may arise from using this repository.

Thank you for your understanding.


## Recent activity [![Time period](https://images.repography.com/58464391/AeonOrg/Electrogram/recent-activity/gf9SHLZa6sqXRpReIT2U07ZtsB7JysNRXMyhy4b2tgE/9c16LtrRR82Ubh9Kw6CMclKpbhDemGuBCxkZUuGJjts_badge.svg)](https://repography.com)
[![Timeline graph](https://images.repography.com/58464391/AeonOrg/Electrogram/recent-activity/gf9SHLZa6sqXRpReIT2U07ZtsB7JysNRXMyhy4b2tgE/9c16LtrRR82Ubh9Kw6CMclKpbhDemGuBCxkZUuGJjts_timeline.svg)](https://github.com/AeonOrg/Electrogram/commits)
30 changes: 16 additions & 14 deletions compiler/api/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
SECTION_RE = re.compile(r"---(\w+)---")
LAYER_RE = re.compile(r"//\sLAYER\s(\d+)")
COMBINATOR_RE = re.compile(
r"^([\w.]+)#([0-9a-f]+)\s(?:.*)=\s([\w<>.]+);$", re.MULTILINE
r"^([\w.]+)#([0-9a-f]+)\s(?:.*)=\s([\w<>.]+);$",
re.MULTILINE,
)
ARGS_RE = re.compile(r"[^{](\w+):([\w?!.<>#]+)")
FLAGS_RE = re.compile(r"flags(\d?)\.(\d+)\?")
Expand Down Expand Up @@ -183,7 +184,7 @@ def get_references(t: str, kind: str):
return ("\n ".join(items), len(items)) if items else (None, 0)


def start() -> None:
def start() -> None: # noqa: C901
shutil.rmtree(DESTINATION_PATH / "types", ignore_errors=True)
shutil.rmtree(DESTINATION_PATH / "functions", ignore_errors=True)
shutil.rmtree(DESTINATION_PATH / "base", ignore_errors=True)
Expand Down Expand Up @@ -327,7 +328,7 @@ def start() -> None:
qualname=qualtype,
types=", ".join([f'"raw.types.{c}"' for c in constructors]),
doc_name=snake(type).replace("_", "-"),
)
),
)

for c in combinators:
Expand All @@ -341,7 +342,7 @@ def start() -> None:

fields = (
"\n ".join(
[f"self.{i[0]} = {i[0]} # {i[1]}" for i in sorted_args]
[f"self.{i[0]} = {i[0]} # {i[1]}" for i in sorted_args],
)
if sorted_args
else "pass"
Expand All @@ -364,7 +365,7 @@ def start() -> None:
arg_docs = arg_docs["params"].get(arg_name, "N/A") if arg_docs else "N/A"

docstring_args.append(
f'{arg_name} ({get_docstring_arg_type(arg_type)}{", *optional*" if is_optional else ""}):\n {arg_docs}\n'
f'{arg_name} ({get_docstring_arg_type(arg_type)}{", *optional*" if is_optional else ""}):\n {arg_docs}\n',
)

if c.section == "types":
Expand Down Expand Up @@ -393,7 +394,7 @@ def start() -> None:

if c.section == "functions":
docstring += "\n Returns:\n " + get_docstring_arg_type(
c.qualtype
c.qualtype,
)
else:
references, count = get_references(c.qualname, "constructors")
Expand All @@ -417,22 +418,22 @@ def start() -> None:
continue

if flag.group(3) == "true" or flag.group(3).startswith(
"Vector"
"Vector",
):
write_flags.append(
f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} else 0"
f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} else 0",
)
else:
write_flags.append(
f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0"
f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0",
)

write_flags = "\n ".join(
[
f"{arg_name} = 0",
"\n ".join(write_flags),
f"b.write(Int({arg_name}))\n ",
]
],
)

write_types += write_flags
Expand Down Expand Up @@ -555,7 +556,7 @@ def start() -> None:

if not namespace:
f.write(
f"from . import {', '.join(filter(bool, namespaces_to_types))}"
f"from . import {', '.join(filter(bool, namespaces_to_types))}",
)

all.extend(filter(bool, namespaces_to_types))
Expand Down Expand Up @@ -583,7 +584,7 @@ def start() -> None:

if not namespace:
f.write(
f"from . import {', '.join(filter(bool, namespaces_to_constructors))}\n"
f"from . import {', '.join(filter(bool, namespaces_to_constructors))}\n",
)

all.extend(filter(bool, namespaces_to_constructors))
Expand All @@ -595,7 +596,8 @@ def start() -> None:

for namespace, types in namespaces_to_functions.items():
with open(
DESTINATION_PATH / "functions" / namespace / "__init__.py", "w"
DESTINATION_PATH / "functions" / namespace / "__init__.py",
"w",
) as f:
f.write(f"{WARNING}\n\n")

Expand All @@ -613,7 +615,7 @@ def start() -> None:

if not namespace:
f.write(
f"from . import {', '.join(filter(bool, namespaces_to_functions))}"
f"from . import {', '.join(filter(bool, namespaces_to_functions))}",
)

all.extend(filter(bool, namespaces_to_functions))
Expand Down
Loading
Loading