pallets/flask

Problems with using flask as dependency for other libraries

pomponchik opened this issue · 2 comments

Hello!

I started writing a library whose tasks include starting and stopping the flask server. I have added flask to the list of dependencies of this library.

When installing my library on macOS, I see the following:

Installed /Users/runner/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/zipp-3.16.2-py3.9.egg
Searching for MarkupSafe>=2.1.1
Reading https://pypi.org/simple/MarkupSafe/
Downloading https://files.pythonhosted.org/packages/6d/7c/59a3248f411813f8ccba92a55feaac4bf360d29e2ff05ee7d8e1ef2d7dbf/MarkupSafe-2.1.3.tar.gz#sha256=af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad
Best match: MarkupSafe 2.1.3
Processing MarkupSafe-2.1.3.tar.gz
Writing /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/easy_install-rho3rw1f/MarkupSafe-2.1.3/setup.cfg
Running MarkupSafe-2.1.3/setup.py -q bdist_egg --dist-dir /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/easy_install-rho3rw1f/MarkupSafe-2.1.3/egg-dist-tmp-hjznlbbi
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
zip_safe flag not set; analyzing archive contents...
markupsafe.__pycache__._speedups.cpython-39: module references __file__
No eggs found in /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/easy_install-rho3rw1f/MarkupSafe-2.1.3/egg-dist-tmp-hjznlbbi (setup script problem?)
error: The 'MarkupSafe>=2.1.1' distribution was not found and is required by Werkzeug
Error: Process completed with exit code 1.

This situation is reproduced in my GitHub Actions, you can familiarize yourself with the situation in more detail. The installation of my library is terminated when the following command is executed:

python setup.py install

I also tried older versions of flask, including 1.X.X, the situation was reproduced there as well. On some operating systems with some versions of Python everything works, on some it doesn't.

Environment:

  • Python version: 3.9
  • Flask version: latest and more
  • OS: macOS latest

Setup.py install is discouraged since years,does the issue replicate with pip install?

You are using old versions of either pip or setuptools. Use pip install -U pip setuptools to get the most recent versions. I suggest avoid setuptools for new projects, and using modern project metadata in pyproject.toml, with a modern build backend such as Hatch or Flit. See the Flask repo itself as an example of this.