-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] unexpected DeprecationWarning of pkg_resources from script (dev).tmpl
#3981
Comments
Hi @kenhkl, I believe that with a sufficiently updated version of This is likely to be happening because You can also force |
Thanks @abravalheri, really looking forward to a new version of pip.
|
Have you tried to use |
@abravalheri Sorry, I did not present my point clearly. So, if one wants such testrun to be editable installed, then a new version of pip is needed.
|
Hi @kenhkl, unfortunately I don't know how the There are other ways to convince
Otherwise, I would recommend silencing the warning (e.g. via the |
Thanks @abravalheri, I now have enough knowledge to deal with the unexpected warnings so far. |
I am using the latest
but our script
$ cat /home/user2/py310/bin/az
#!/home/user2/py310/bin/python
# EASY-INSTALL-DEV-SCRIPT: 'azure-cli==2.51.0','az'
__requires__ = 'azure-cli==2.51.0'
__import__('pkg_resources').require('azure-cli==2.51.0')
__file__ = '/home/user2/azure-cli/src/azure-cli/az'
with open(__file__) as f:
exec(compile(f.read(), __file__, 'exec')) |
Hi @jiasli , I believe that pip 23.1 was supposed to use isolated builds by default (the new APIs that setuptools already implements), but they decided to postpone a little bit (understandably). Please have a look on my previous comment for alternatives. |
Thanks a lot @abravalheri for sharing this information. We will then wait for the new version of |
This actually worked for me, thanks! |
Pls help ~/dirsearch $ pip -v install --use-pep517 -e Usage: -e option requires 1 argument |
you're missing a |
setuptools version
setuptools===68.0.0
Python version
Python 3.8
OS
Linux
Additional environment information
No response
Description
Since setuptools group has offically claimed that 'pkg_resources' package was deprecated at here, the use of pkg_resources by the users are reasonable to report a DeprecationWarning, however the use by setuptools itself should not report such warning as I think.
When I install by
pip install -e
with-e
option, the installed script is generated by setuptools/script (dev).tmpl where the following statement exists:Therefore, I get an unexpected warning when I run the installed script:
A possible solution is to remove
in setuptools/script (dev).tmpl (and probably setuptools/script.tmpl).
Expected behavior
When running a script installed by
pip install -e
, I expect no DeprecationWarning triggered by__import__('pkg_resources').require
from setuptools/script (dev).tmpl.How to Reproduce
test_pkg_resources
, with two files:where,
setup.py
is:and
testrun
is:-e
:Output
The text was updated successfully, but these errors were encountered: