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

Fix brackets display #112

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "refactor: Using isort to sort imports alphabetically"
This reverts commit 9f037ba.
jianan1104 committed Nov 16, 2022
commit 3dfefebe8779bea0771480e0b6a954ce47e875f6
2 changes: 1 addition & 1 deletion src/integration_tests/regression_test.py
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

from __future__ import annotations

import math
from collections.abc import Callable
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are some changes about only the import order, which are not related to the essential point of this pull request. Could you revert these changes to prevent breaking the blame history?

(Btw, I think I need to introduce some static checker (e.g., isort) to constrain the style around imports.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

import math
from typing import Any

from latexify import frontend
3 changes: 2 additions & 1 deletion src/latexify/ast_utils_test.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@

import pytest

from latexify import ast_utils, test_utils
from latexify import ast_utils
from latexify import test_utils


@test_utils.require_at_most(7)
6 changes: 5 additions & 1 deletion src/latexify/codegen/function_codegen.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,11 @@
import dataclasses
from typing import Any

from latexify import analyzers, constants, exceptions, math_symbols
from latexify import analyzers
from latexify import constants
from latexify import math_symbols
from latexify import exceptions


# Precedences of operators for BoolOp, BinOp, UnaryOp, and Compare nodes.
# Note that this value affects only the appearance of surrounding parentheses for each
3 changes: 2 additions & 1 deletion src/latexify/codegen/function_codegen_test.py
Original file line number Diff line number Diff line change
@@ -3,10 +3,11 @@
from __future__ import annotations

import ast
from latexify import exceptions
from latexify import test_utils

import pytest

from latexify import exceptions, test_utils
from latexify.codegen import FunctionCodegen, function_codegen


7 changes: 5 additions & 2 deletions src/latexify/frontend.py
Original file line number Diff line number Diff line change
@@ -2,11 +2,14 @@

from __future__ import annotations

import warnings
from collections.abc import Callable
from typing import Any
import warnings

from latexify import codegen, exceptions, parser, transformers
from latexify import codegen
from latexify import exceptions
from latexify import parser
from latexify import transformers


def get_latex(
2 changes: 1 addition & 1 deletion src/latexify/parser.py
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@

from __future__ import annotations

from collections.abc import Callable
import ast
import inspect
import textwrap
from collections.abc import Callable
from typing import Any

import dill
3 changes: 2 additions & 1 deletion src/latexify/parser_test.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@

import pytest

from latexify import exceptions, parser, test_utils
from latexify import exceptions, parser
from latexify import test_utils


def test_parse_function_with_posonlyargs() -> None:
2 changes: 1 addition & 1 deletion src/latexify/test_utils.py
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@
from __future__ import annotations

import ast
from collections.abc import Callable
import functools
import sys
from collections.abc import Callable
from typing import cast


4 changes: 3 additions & 1 deletion src/latexify/transformers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Package latexify.transformers."""

from latexify.transformers import assignment_reducer, identifier_replacer
from latexify.transformers import assignment_reducer
from latexify.transformers import identifier_replacer


AssignmentReducer = assignment_reducer.AssignmentReducer
IdentifierReplacer = identifier_replacer.IdentifierReplacer
2 changes: 1 addition & 1 deletion src/latexify/transformers/assignment_reducer_test.py
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
from __future__ import annotations

import ast

from latexify import ast_utils, parser, test_utils

from latexify.transformers.assignment_reducer import AssignmentReducer