carpedm20 / emoji

emoji terminal output for Python
Other
1.87k stars 273 forks source link

[BUG] Deprecation warning legacy setup.py install method #264

Closed rvandernoort closed 1 year ago

rvandernoort commented 1 year ago

Hello I just installed this library and I get the following deprecation warning:

$ pip install emoji
...
Installing collected packages: emoji
  DEPRECATION: emoji is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for emoji ... done
Successfully installed emoji-2.5.0

I think a minimal pyproject.toml setup should suffice to remove this warning.

cvzi commented 1 year ago

I think this will be solved by #258 which will publish a wheel .whl-file. Then pip can use the .whl-file instead of trying to build one first.

I'll look into a minimal pyproject.toml

cvzi commented 1 year ago

I can't reproduce the error on my machine. Could you check if such a pyproject.toml helps:

[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

I think you can clone the repo, add the pyproject.toml and then do

python -m pip install .

to test an install from current directory

rvandernoort commented 1 year ago

Yes that seems to get the warning removed and I think #258 would need to have this pyproject.toml included as well. my pip=23.0.1

(venv-1) python -m pip install .                
Processing /home/rover/tmp/emoji
  Preparing metadata (setup.py) ... done
Installing collected packages: emoji
  DEPRECATION: emoji is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for emoji ... done
Successfully installed emoji-2.5.1

# with pyproject.toml
(venv-2)  python -m pip install .
Processing /home/rover/tmp/emoji
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: emoji
  Building wheel for emoji (pyproject.toml) ... done
  Created wheel for emoji: filename=emoji-2.5.1-py2.py3-none-any.whl size=351210 sha256=e875f66a526f369e0526ca08dd0547ee8166c673a00bc0c4e8436bb5d18874e5
  Stored in directory: /tmp/pip-ephem-wheel-cache-m6qj_1gv/wheels/27/9e/5c/d3751bb743122e49e1381411da12090d9bdbb38e917332b0bb
Successfully built emoji
Installing collected packages: emoji
Successfully installed emoji-2.5.1
cvzi commented 1 year ago

If you have the time, could you check if it is really fixed with the newest version 2.8.0?

pip install emoji==2.8.0

rvandernoort commented 1 year ago

Seem like its fixed indeed!

pip install emoji==2.8.0
Collecting emoji==2.8.0
  Downloading emoji-2.8.0-py2.py3-none-any.whl (358 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 358.9/358.9 kB 2.6 MB/s eta 0:00:00
Installing collected packages: emoji
Successfully installed emoji-2.8.0
cvzi commented 1 year ago

Thanks!