Remove broken /usr/bin/format script #196

Closed
opened 2024-10-16 21:50:43 +00:00 by DaveDuck321 · 6 comments
DaveDuck321 commented 2024-10-16 21:50:43 +00:00 (Migrated from gitlab2.manjaro.org)

I don't have permission to fork, please apply the following patch:

diff --git a/pyproject.toml b/pyproject.toml
index a1c7eaa..0de885f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -26,7 +26,6 @@ npyscreen = "^4.10.5"
 
 [tool.poetry.scripts]
 pacman-mirrors = "pacman_mirrors.pacman_mirrors:start"
-format = "black:main ."
 
 [tool.poetry.group.lint.dependencies]
 coverage = "^7.3.1"

poetry format is broken anyway with the same syntax error.
This project shouldn't be shipping /usr/bin/format regardless (even if it worked).

Story:

$ format
  File "/usr/bin/format", line 8
    sys.exit(main.())
                  ^
SyntaxError: invalid syntax
$ # Huh? That's odd

$ cat /usr/bin/format
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from black import main
if __name__ == "__main__":
    sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
    sys.exit(main.())

$ pacman -Qo /usr/bin/format
/usr/bin/format is owned by pacman-mirrors 4.27-1

$ # Great
I don't have permission to fork, please apply the following patch: ``` diff --git a/pyproject.toml b/pyproject.toml index a1c7eaa..0de885f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,6 @@ npyscreen = "^4.10.5" [tool.poetry.scripts] pacman-mirrors = "pacman_mirrors.pacman_mirrors:start" -format = "black:main ." [tool.poetry.group.lint.dependencies] coverage = "^7.3.1" ``` `poetry format` is broken anyway with the same syntax error. This project shouldn't be shipping `/usr/bin/format` regardless (even if it worked). # Story: ``` $ format File "/usr/bin/format", line 8 sys.exit(main.()) ^ SyntaxError: invalid syntax $ # Huh? That's odd $ cat /usr/bin/format #!/usr/bin/python # -*- coding: utf-8 -*- import re import sys from black import main if __name__ == "__main__": sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0]) sys.exit(main.()) $ pacman -Qo /usr/bin/format /usr/bin/format is owned by pacman-mirrors 4.27-1 $ # Great ```
DaveDuck321 commented 2024-10-16 21:53:52 +00:00 (Migrated from gitlab2.manjaro.org)

@fhdk not sure if you already got a ping but please could you help me here.

@fhdk not sure if you already got a ping but please could you help me here.
DaveDuck321 commented 2024-10-16 21:54:28 +00:00 (Migrated from gitlab2.manjaro.org)

changed the description

changed the description
yochananmarqos1 commented 2024-10-16 21:54:34 +00:00 (Migrated from gitlab2.manjaro.org)

assigned to @fhdk

assigned to @fhdk
fhdk commented 2024-10-17 05:59:07 +00:00 (Migrated from gitlab2.manjaro.org)

This is a flaw I discovered on another project as well.

It seems to be triggered by the python build process and the only way to remove it is to comment in the pyproject.toml file.

This is a flaw I discovered on another project as well. It seems to be triggered by the python build process and the only way to remove it is to comment in the pyproject.toml file.
fhdk commented 2024-10-17 06:01:52 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in merge request !351

mentioned in merge request !351
fhdk commented 2024-10-17 06:29:07 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit 8c0bb938e0

mentioned in commit 8c0bb938e0f628486d3422a6a2ee6eef79b465a8
fhdk (Migrated from gitlab2.manjaro.org) closed this issue 2024-10-31 07:41:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/pacman-mirrors#196
No description provided.