Skip to content

Conversation

@ThomasWaldmann
Copy link
Contributor

@ThomasWaldmann ThomasWaldmann commented Apr 10, 2024

xstatic 2.0.0

Fixes #12. Fixes #4. Fixes #7. Fixes #9.

See also #15 for migration hints.

@ThomasWaldmann
Copy link
Contributor Author

ThomasWaldmann commented Apr 16, 2025

Looks like for Python 3.11+, xstatic 2.0.0 can't support legacy xstatic resource packages - when trying to install 2 legacy ones, the 2nd one will fail to install.

Processing /home/runner/work/xstatic/xstatic
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml): started
  Building wheel for XStatic (pyproject.toml): finished with status 'done'
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4025 sha256=e155c34adc71f696a4a67cbab1a5258e2f0adf0612a70f8230a57c031b94fa87
  Stored in directory: /tmp/pip-ephem-wheel-cache-q4fvzvy6/wheels/be/16/4a/cf89540d8d264a4b12a056fc185fcc9d85d4b66d5fd002f6a9
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0

Notice:  A new release of pip is available: 24.3.1 -> 25.0.1
Notice:  To update, run: pip install --upgrade pip
Collecting git+https://github.com/xstatic-py/xstatic-bootstrap.git@master
  Cloning https://github.com/xstatic-py/xstatic-bootstrap.git (to revision master) to /tmp/pip-req-build-f6a2itgs
  Running command git clone --filter=blob:none --quiet https://github.com/xstatic-py/xstatic-bootstrap.git /tmp/pip-req-build-f6a2itgs
  Resolved https://github.com/xstatic-py/xstatic-bootstrap.git to commit 9dc1b736b31b2a3648c9f3a3acf1ed6af0eb9d96
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: XStatic-Bootstrap
  Building wheel for XStatic-Bootstrap (pyproject.toml): started
  Building wheel for XStatic-Bootstrap (pyproject.toml): finished with status 'done'
  Created wheel for XStatic-Bootstrap: filename=xstatic_bootstrap-4.5.3.1-py3-none-any.whl size=741581 sha256=1279ff35500742f1ec5b8f72057a5f46f2c9f372db5cded16b14b5be384ade19
  Stored in directory: /tmp/pip-ephem-wheel-cache-ssh2nev8/wheels/a7/d2/52/5a69cc5cb719d4aefc135210c0948d7efab8a544a7bf27be22
Successfully built XStatic-Bootstrap
Installing collected packages: XStatic-Bootstrap
Successfully installed XStatic-Bootstrap-4.5.3.1

Notice:  A new release of pip is available: 24.3.1 -> 25.0.1
Notice:  To update, run: pip install --upgrade pip
Collecting git+https://github.com/xstatic-py/xstatic-font-awesome.git@master
  Cloning https://github.com/xstatic-py/xstatic-font-awesome.git (to revision master) to /tmp/pip-req-build-osh14i11
  Running command git clone --filter=blob:none --quiet https://github.com/xstatic-py/xstatic-font-awesome.git /tmp/pip-req-build-osh14i11
  Resolved https://github.com/xstatic-py/xstatic-font-awesome.git to commit bc6727c32a680ae767057b36d88422f32313cf78
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/home/runner/work/xstatic/xstatic/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/home/runner/work/xstatic/xstatic/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/xstatic/xstatic/venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-7wcsi07u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7wcsi07u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-7wcsi07u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7wcsi07u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
      ImportError: cannot import name 'font_awesome' from 'xstatic.pkg' (unknown location)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.

Notice:  A new release of pip is available: 24.3.1 -> 25.0.1
Notice:  To update, run: pip install --upgrade 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.
Error: Process completed with exit code 1.

@xstatic-py xstatic-py deleted a comment from ReimarBauer Apr 16, 2025
@ThomasWaldmann ThomasWaldmann marked this pull request as ready for review April 16, 2025 15:47
@ThomasWaldmann
Copy link
Contributor Author

@roland-ruedenauer
Copy link

Looks like for Python 3.11+, xstatic 2.0.0 can't support legacy xstatic resource packages - when trying to install 2 legacy ones, the 2nd one will fail to install.

This only happens with pip installation from source tree. Legacy XStatic wheels from pypi can still be installed. But the known issue with use of pkg_resources might still cause trouble.

note: this is broken, because pyproject.toml does not
support pkg_resources style namespace-packages any more!
pkg_resources style was deprecated since long and pyproject.toml
has removed support for namespace-packages completely.
@ThomasWaldmann
Copy link
Contributor Author

@roland-ruedenauer I tried in a separate, fresh venv and my impression is that it only works sometimes:

tw@MacBook-Pro aaa % python3 -m venv env
tw@MacBook-Pro aaa % . env/bin/activate
(env) tw@MacBook-Pro aaa % ls
env				xstatic-2.0.0-py3-none-any.whl	xstatic-2.0.0.tar.gz
(env) tw@MacBook-Pro aaa % pip install xstatic-2.0.0.tar.gz 
Processing ./xstatic-2.0.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml) ... done
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4010 sha256=33283596eaf9689d27b4b29c0614baf6c01f33063eeba0bc69495627994d6540
  Stored in directory: /Users/tw/Library/Caches/pip/wheels/37/46/40/2d241b3d3e9e6848737439dbe50ff3212937fac601a0ff7b85
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0
(env) tw@MacBook-Pro aaa % pip install xstatic-jquery
Collecting xstatic-jquery
  Using cached xstatic_jquery-3.5.1.1-py3-none-any.whl
Installing collected packages: xstatic-jquery
Successfully installed xstatic-jquery-3.5.1.1
(env) tw@MacBook-Pro aaa % pip install xstatic-font-awesome
Collecting xstatic-font-awesome
  Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl.metadata (851 bytes)
Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl (6.5 MB)
Installing collected packages: xstatic-font-awesome
Successfully installed xstatic-font-awesome-6.2.1.1
(env) tw@MacBook-Pro aaa % pip install xstatic-bootstrap   
Collecting xstatic-bootstrap
  Using cached XStatic-Bootstrap-4.5.3.1.tar.gz (727 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-kqzwe3za/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-kqzwe3za/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-kqzwe3za/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-kqzwe3za/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
      ImportError: cannot import name 'bootstrap' from 'xstatic.pkg' (unknown location)
      [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.

@roland-ruedenauer
Copy link

Using cached XStatic-Bootstrap-4.5.3.1.tar.gz

Looks as if you did not clean the pip cache.

@roland-ruedenauer
Copy link

What about making XStatic py.typed? Use f-strings in main.py?

@ReimarBauer
Copy link

ReimarBauer commented Apr 17, 2025

Just trying

reimarbauer@MacBook-Pro-von-Reimar xstatic % python3 -m venv env
reimarbauer@MacBook-Pro-von-Reimar xstatic % . env/bin/activate
(env) reimarbauer@MacBook-Pro-von-Reimar xstatic % ls
AUTHORS.rst	MANIFEST.in	docs		pyproject.toml
LICENSE.txt	README.rst	env		src
(env) reimarbauer@MacBook-Pro-von-Reimar xstatic % pip install .
Processing /Users/reimarbauer/PycharmProjects/xstatic
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml) ... done
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4010 sha256=58980aa4a49b18a9c459e2c6fbb56f336511db7ed0bad1728fbbfcc9d432338c
  Stored in directory: /private/var/folders/4c/f6cfpyvn4_xb9ln54y6vnh5w0000gn/T/pip-ephem-wheel-cache-79deqhjp/wheels/d6/b9/e1/f9780a1d8bc9c3944d1fa6ba008f4fadbef5780dde74a9523e
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(env) reimarbauer@MacBook-Pro-von-Reimar xstatic % pip install xstatic-font-awesome
Collecting xstatic-font-awesome
  Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl.metadata (851 bytes)
Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl (6.5 MB)
Installing collected packages: xstatic-font-awesome
Successfully installed xstatic-font-awesome-6.2.1.1

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(env) reimarbauer@MacBook-Pro-von-Reimar xstatic % git branch
  master
* modernize
(env) reimarbauer@MacBook-Pro-von-Reimar xstatic % pip list
Package              Version
-------------------- -------
pip                  25.0
XStatic              2.0.0
XStatic-Font-Awesome 6.2.1.1

On pypi we have currently only the old XStatic-Font-Awesome. I had no trouble to install it together with the modernized XStatic. From #15 this should not work, or? I could also use the old API https://xstatic.readthedocs.io/en/latest/using.html#example-code-to-setup-local-file-serving

@ThomasWaldmann
Copy link
Contributor Author

@ReimarBauer The trouble with legacy packages often only showed when trying to install multiple of them.

@ThomasWaldmann
Copy link
Contributor Author

@roland-ruedenauer It's not related to the cache:

  • I completely removed the pip cache.
  • Built a fresh empty env.
  • Problem still reproduces:
(env) tw@MacBook-Pro aaa % pip install xstatic-2.0.0.tar.gz
Processing ./xstatic-2.0.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml) ... done
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4010 sha256=3613067b0d971b30092310d08fc3c18d50f0669fe9f1ea98d418c0b5e67de0c5
  Stored in directory: /Users/tw/Library/Caches/pip/wheels/37/46/40/2d241b3d3e9e6848737439dbe50ff3212937fac601a0ff7b85
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0
(env) tw@MacBook-Pro aaa % pip install xstatic-jquery      
Collecting xstatic-jquery
  Downloading XStatic-jQuery-3.5.1.1.tar.gz (310 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: xstatic-jquery
  Building wheel for xstatic-jquery (pyproject.toml) ... done
  Created wheel for xstatic-jquery: filename=xstatic_jquery-3.5.1.1-py3-none-any.whl size=313265 sha256=aebc2691ef634bda2f54f786fafa5db197a6f85521b6cb122ef5a8213f55a06b
  Stored in directory: /Users/tw/Library/Caches/pip/wheels/ce/cb/ee/b37d6bff51fedbd8aa8538856c33b141e0da70734c0d1853f8
Successfully built xstatic-jquery
Installing collected packages: xstatic-jquery
Successfully installed xstatic-jquery-3.5.1.1
(env) tw@MacBook-Pro aaa % pip install xstatic-font-awesome
Collecting xstatic-font-awesome
  Downloading XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl.metadata (851 bytes)
Downloading XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl (6.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 8.6 MB/s eta 0:00:00
Installing collected packages: xstatic-font-awesome
Successfully installed xstatic-font-awesome-6.2.1.1
(env) tw@MacBook-Pro aaa % pip install xstatic-bootstrap   
Collecting xstatic-bootstrap
  Downloading XStatic-Bootstrap-4.5.3.1.tar.gz (727 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 727.2/727.2 kB 5.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/tw/w/aaa/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-hfholh5u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-hfholh5u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-hfholh5u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/61/qtqwzmxd7t1fb19zck5k3q0h0000gn/T/pip-build-env-hfholh5u/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
      ImportError: cannot import name 'bootstrap' from 'xstatic.pkg' (unknown location)
      [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.

@ReimarBauer
Copy link

I have not upgrade pip, will do another one with the upgrade

(xsenv) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-2.0.0.tar.gz
Processing ./xstatic-2.0.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml) ... done
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4010 sha256=983e7f5a725abdb5a15f200cfcf9fe74979a99fb3e0afed22479ee059edacac5
  Stored in directory: /Users/reimarbauer/Library/Caches/pip/wheels/3f/9e/9c/4275af18eba835b2cfc31a00cb2bec22155d73a8cddeaa67a5
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(xsenv) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-jquery
Collecting xstatic-jquery
  Using cached xstatic_jquery-3.5.1.1-py3-none-any.whl
Installing collected packages: xstatic-jquery
Successfully installed xstatic-jquery-3.5.1.1

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(xsenv) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-font-awesome
Collecting xstatic-font-awesome
  Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl.metadata (851 bytes)
Using cached XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl (6.5 MB)
Installing collected packages: xstatic-font-awesome
Successfully installed xstatic-font-awesome-6.2.1.1

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(xsenv) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-bootstrap
Collecting xstatic-bootstrap
  Using cached xstatic_bootstrap-4.5.3.1-py3-none-any.whl
Installing collected packages: xstatic-bootstrap
Successfully installed xstatic-bootstrap-4.5.3.1

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip

@roland-ruedenauer
Copy link

@ThomasWaldmann It's like I said before: you run into the problem with installing legacy XStatic packages from source distributions. Using wheels should be no problem. This time you picked a package that has no wheel deployed on pypi.

Downloading XStatic-Bootstrap-4.5.3.1.tar.gz

@ReimarBauer
Copy link

I did a mistake. I was not on the most recent version. sorry for that.

git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 5 (delta 2), reused 5 (delta 2), pack-reused 0 (from 0)
Entpacke Objekte: 100% (5/5), 1.07 KiB | 365.00 KiB/s, fertig.
Von github.com:xstatic-py/xstatic
   6f48fbb..277e43e  modernize  -> origin/modernize
Aktualisiere 6f48fbb..277e43e
Fast-forward
 src/xstatic/main.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

@ReimarBauer
Copy link

ReimarBauer commented Apr 17, 2025

With the recent changes, I get same trouble too.


(bbb) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-2.0.0.tar.gz

Processing ./xstatic-2.0.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: XStatic
  Building wheel for XStatic (pyproject.toml) ... done
  Created wheel for XStatic: filename=xstatic-2.0.0-py3-none-any.whl size=4010 sha256=0748484b688a6b54a63013de43894f8bf9b72ffb0d69e1d39774659fc7a3bad0
  Stored in directory: /Users/reimarbauer/Library/Caches/pip/wheels/3f/9e/9c/4275af18eba835b2cfc31a00cb2bec22155d73a8cddeaa67a5
Successfully built XStatic
Installing collected packages: XStatic
Successfully installed XStatic-2.0.0

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(bbb) reimarbauer@MacBook-Pro-von-Reimar dist % pip install --upgrade pip
Requirement already satisfied: pip in /Users/reimarbauer/tmp/bbb/lib/python3.13/site-packages (25.0)
Collecting pip
  Downloading pip-25.0.1-py3-none-any.whl.metadata (3.7 kB)
Downloading pip-25.0.1-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 1.3 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 25.0
    Uninstalling pip-25.0:
      Successfully uninstalled pip-25.0
Successfully installed pip-25.0.1
(bbb) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-jquery
Collecting xstatic-jquery
  Downloading XStatic-jQuery-3.5.1.1.tar.gz (310 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: xstatic-jquery
  Building wheel for xstatic-jquery (pyproject.toml) ... done
  Created wheel for xstatic-jquery: filename=xstatic_jquery-3.5.1.1-py3-none-any.whl size=313265 sha256=41bd7d21b73d21f21e9496aee505699ef591aef7193b8156c6aca9e95608e01d
  Stored in directory: /Users/reimarbauer/Library/Caches/pip/wheels/ce/cb/ee/b37d6bff51fedbd8aa8538856c33b141e0da70734c0d1853f8
Successfully built xstatic-jquery
Installing collected packages: xstatic-jquery
Successfully installed xstatic-jquery-3.5.1.1
(bbb) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-font-awesome
Collecting xstatic-font-awesome
  Downloading XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl.metadata (851 bytes)
Downloading XStatic_Font_Awesome-6.2.1.1-py3-none-any.whl (6.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 1.2 MB/s eta 0:00:00
Installing collected packages: xstatic-font-awesome
Successfully installed xstatic-font-awesome-6.2.1.1
(bbb) reimarbauer@MacBook-Pro-von-Reimar dist % pip install xstatic-bootstrap
Collecting xstatic-bootstrap
  Downloading XStatic-Bootstrap-4.5.3.1.tar.gz (727 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 727.2/727.2 kB 1.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/Users/reimarbauer/tmp/bbb/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/reimarbauer/tmp/bbb/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/reimarbauer/tmp/bbb/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/4c/f6cfpyvn4_xb9ln54y6vnh5w0000gn/T/pip-build-env-6ty9eavv/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/4c/f6cfpyvn4_xb9ln54y6vnh5w0000gn/T/pip-build-env-6ty9eavv/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/4c/f6cfpyvn4_xb9ln54y6vnh5w0000gn/T/pip-build-env-6ty9eavv/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/4c/f6cfpyvn4_xb9ln54y6vnh5w0000gn/T/pip-build-env-6ty9eavv/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
      ImportError: cannot import name 'bootstrap' from 'xstatic.pkg' (unknown location)
      [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.

@roland-ruedenauer
Copy link

roland-ruedenauer commented Apr 17, 2025

XStatic-Bootstrap 4.5.3.1 also has no wheel deployed on pypi

https://pypi.org/project/XStatic-Bootstrap/#files

@ReimarBauer
Copy link

XStatic-Boostrap 4.5.3.1 also has no wheel deployed on pypi

https://pypi.org/project/XStatic-Bootstrap/#files

likly conclusion deploy wheels first

@roland-ruedenauer
Copy link

Because of the problematic with use of pkg_resources you will probably soon have to update the legacy XStatic packages anyways.

@roland-ruedenauer
Copy link

@ThomasWaldmann Is there anything left to do preventing a merge into master?

@ThomasWaldmann
Copy link
Contributor Author

@roland-ruedenauer Guess it can be merged into master, but before doing a pypi release, I would like more feedback about how we proceed (in #15) to avoid that project using xstatic packages run into troubles.

@ThomasWaldmann ThomasWaldmann merged commit 70c1664 into master Apr 30, 2025
6 checks passed
@ThomasWaldmann ThomasWaldmann deleted the modernize branch April 30, 2025 07:09
@roland-ruedenauer
Copy link

From my pov: relelasing wheels to pypi for old packages (where possible) and your explicit hints should be sufficient.

@UlrichB22
Copy link

Perhaps it would help to create a pre-release version in pipy for testing.

@ThomasWaldmann
Copy link
Contributor Author

@UlrichB22 Could be done, but is quite some work as we would need all the required packages there. pip can also pull code directly from a github branch, so that might also work well enough for pre-release testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: pkg_resources is deprecated as an API. create pyproject.toml script package the LICENSE.txt file tests

5 participants