[GH-ISSUE #24] __init__.py syntax error #19

Closed
opened 2026-02-27 04:57:08 +03:00 by kerem · 6 comments
Owner

Originally created by @galenhammond on GitHub (Jun 14, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/24

Originally assigned to: @Googolplexed0 on GitHub.

Just a heads up, in the breaking change from 2d97b8b78d creates an f-string with throws a syntax error and breaks the install. I forked/fixed this locally for my testing, but wanted to bring it up here as well.

Originally created by @galenhammond on GitHub (Jun 14, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/24 Originally assigned to: @Googolplexed0 on GitHub. Just a heads up, in the breaking change from 2d97b8b78dcdb1d8197c0e7a2e942639d87447d6 creates an f-string with throws a syntax error and breaks the install. I forked/fixed this locally for my testing, but wanted to bring it up here as well.
kerem 2026-02-27 04:57:08 +03:00
Author
Owner

@Googolplexed0 commented on GitHub (Jun 15, 2025):

@galenhammond I just force-reinstalled to check this, as the f-string should not be touched until the OAuth class is initialized during runtime in zotify.py, I am not seeing a syntax error on installation or when running. Could you provide more details on the error when running off the main branch?

<!-- gh-comment-id:2973395580 --> @Googolplexed0 commented on GitHub (Jun 15, 2025): @galenhammond I just force-reinstalled to check this, as the f-string should not be touched until the OAuth class is initialized during runtime in `zotify.py`, I am not seeing a syntax error on installation or when running. Could you provide more details on the error when running off the main branch?
Author
Owner

@galenhammond commented on GitHub (Jun 15, 2025):

I don't have the error in front of me unfortunately, but it occurred during the following command

pipx install git+https://github.com/Googolplexed0/zotify.git

with the stack trace referring to that specific line. It may have been an issue with my python version potentially as I realized pyenv was still using 3.9 instead of 3.10, but iirc it was still present after setting the correct version

<!-- gh-comment-id:2973396910 --> @galenhammond commented on GitHub (Jun 15, 2025): I don't have the error in front of me unfortunately, but it occurred during the following command `pipx install git+https://github.com/Googolplexed0/zotify.git` with the stack trace referring to that specific line. It may have been an issue with my python version potentially as I realized pyenv was still using 3.9 instead of 3.10, but iirc it was still present after setting the correct version
Author
Owner

@Googolplexed0 commented on GitHub (Jun 15, 2025):

No rush, just send me the stack trace when you have it. Unfortunately, I cannot debug something like this unless I can replicate it.

<!-- gh-comment-id:2973398635 --> @Googolplexed0 commented on GitHub (Jun 15, 2025): No rush, just send me the stack trace when you have it. Unfortunately, I cannot debug something like this unless I can replicate it.
Author
Owner

@xhabih commented on GitHub (Jun 17, 2025):

Debian 12 / Python 3.11.2
I get this:

pipx install git+https://github.com/Googolplexed0/zotify.git
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      No `packages` or `py_modules` configuration, performing automatic discovery.
      `flat-layout` detected -- analysing .
      discovered packages -- ['zotify']
      Traceback (most recent call last):
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 185, in read_attr
          value = getattr(StaticModule(module_name, spec), attr_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 57, in __init__
          module = ast.parse(pathlib.Path(spec.origin).read_bytes())  # type: ignore[arg-type] # Let it raise an error on None
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/ast.py", line 50, in parse
          return compile(source, filename, mode, flags,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<unknown>", line 267
          self.redirect_uri = f"http://{redirect_address if redirect_address else "127.0.0.1"}:{self.port}/login"
                                                                                   ^^^^^
      SyntaxError: f-string: expecting '}'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 115, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 160, in setup
          dist.parse_config_files()
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 756, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 72, in apply_configuration
          config = read_configuration(filepath, True, ignore_option_errors, dist)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 144, in read_configuration
          return expand_configuration(asdict, root_dir, ignore_option_errors, dist)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 169, in expand_configuration
          return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 217, in expand
          self._expand_all_dynamic(dist, package_dir)
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 262, in _expand_all_dynamic
          version=self._obtain_version(dist, package_dir),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 313, in _obtain_version
          self._obtain(dist, "version", package_dir)  # pyright: ignore[reportArgumentType]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 300, in _obtain
          return self._expand_directive(
                 ^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 294, in _expand_directive
          return _expand.read_attr(directive["attr"], package_dir, root_dir)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 190, in read_attr
          module = _load_spec(spec, module_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 211, in _load_spec
          spec.loader.exec_module(module)
        File "<frozen importlib._bootstrap_external>", line 936, in exec_module
        File "<frozen importlib._bootstrap_external>", line 1074, in get_code
        File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
        File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
        File "/tmp/pip-req-build-k1n5sjuy/zotify/__init__.py", line 267
          self.redirect_uri = f"http://{redirect_address if redirect_address else "127.0.0.1"}:{self.port}/login"
                                                                                   ^^^^^
      SyntaxError: f-string: expecting '}'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Cannot determine package name from spec 'git+https://github.com/Googolplexed0/zotify.git'. Check package spec for
errors.

<!-- gh-comment-id:2979925047 --> @xhabih commented on GitHub (Jun 17, 2025): Debian 12 / Python 3.11.2 I get this: ``` pipx install git+https://github.com/Googolplexed0/zotify.git error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [80 lines of output] No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing . discovered packages -- ['zotify'] Traceback (most recent call last): File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 185, in read_attr value = getattr(StaticModule(module_name, spec), attr_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 57, in __init__ module = ast.parse(pathlib.Path(spec.origin).read_bytes()) # type: ignore[arg-type] # Let it raise an error on None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/ast.py", line 50, in parse return compile(source, filename, mode, flags, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<unknown>", line 267 self.redirect_uri = f"http://{redirect_address if redirect_address else "127.0.0.1"}:{self.port}/login" ^^^^^ SyntaxError: f-string: expecting '}' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module> main() File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xabih/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 1, in <module> File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 115, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 160, in setup dist.parse_config_files() File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 756, in parse_config_files pyprojecttoml.apply_configuration(self, filename, ignore_option_errors) File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 72, in apply_configuration config = read_configuration(filepath, True, ignore_option_errors, dist) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 144, in read_configuration return expand_configuration(asdict, root_dir, ignore_option_errors, dist) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 169, in expand_configuration return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 217, in expand self._expand_all_dynamic(dist, package_dir) File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 262, in _expand_all_dynamic version=self._obtain_version(dist, package_dir), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 313, in _obtain_version self._obtain(dist, "version", package_dir) # pyright: ignore[reportArgumentType] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 300, in _obtain return self._expand_directive( ^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 294, in _expand_directive return _expand.read_attr(directive["attr"], package_dir, root_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 190, in read_attr module = _load_spec(spec, module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-tq4qn3ki/overlay/lib/python3.11/site-packages/setuptools/config/expand.py", line 211, in _load_spec spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 936, in exec_module File "<frozen importlib._bootstrap_external>", line 1074, in get_code File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/tmp/pip-req-build-k1n5sjuy/zotify/__init__.py", line 267 self.redirect_uri = f"http://{redirect_address if redirect_address else "127.0.0.1"}:{self.port}/login" ^^^^^ SyntaxError: f-string: expecting '}' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. Cannot determine package name from spec 'git+https://github.com/Googolplexed0/zotify.git'. Check package spec for errors. ```
Author
Owner

@Googolplexed0 commented on GitHub (Jun 17, 2025):

Should be fixed with 2406249, give it another shot.

<!-- gh-comment-id:2980210145 --> @Googolplexed0 commented on GitHub (Jun 17, 2025): Should be fixed with 2406249, give it another shot.
Author
Owner

@xhabih commented on GitHub (Jun 17, 2025):

Should be fixed with 2406249, give it another shot.

Installed, thank you.

<!-- gh-comment-id:2980684232 --> @xhabih commented on GitHub (Jun 17, 2025): > Should be fixed with [2406249](https://github.com/Googolplexed0/zotify/commit/24062494ed3d24bf31ac408321949e86bcf32496), give it another shot. Installed, thank you.
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
starred/zotify#19
No description provided.