Skip to content
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

Using Poetry with Python ^3.10 #5157

Closed
ethanscorey opened this issue Feb 6, 2022 · 10 comments
Closed

Using Poetry with Python ^3.10 #5157

ethanscorey opened this issue Feb 6, 2022 · 10 comments
Labels
kind/bug Something isn't working as expected

Comments

@ethanscorey
Copy link

  • [x ] I am on the latest Poetry version.
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x ] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 20.04.3 LTS (Focal Fossa) (via Windows Subsystem for Linux)
  • Poetry version: Poetry version 1.1.12
  • Python version: Python 3.10.2
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

I wanted to use poetry for a new Python project, but upgrading my Python interpreter to 3.10.2 seems to have caused a minor bug. Now, whenever I run any command with Poetry, I get the following output:

~$ poetry -V
/home/ethan/miniconda3/envs/foo/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Poetry version 1.1.12

Besides that warning, everything seems to work fine, but it's annoying to see that warning in the output every time I run a command. If I add the -vvv option to get debug output, I don't see any traceback. Any idea what's going on/how to fix?

@ethanscorey ethanscorey added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 6, 2022
@eyllanesc
Copy link
Contributor

It seems this PR #5155 is the solution

@finswimmer
Copy link
Member

Hello @ethanscorey,

it is not clear where this warning comes from. How did you install poetry?

fin swimmer

@finswimmer finswimmer added the status/waiting-on-response Waiting on response from author label Feb 9, 2022
@ethanscorey
Copy link
Author

I used the osx / linux / bashonwindows install instructions from the officials docs (https://python-poetry.org/docs/):
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

For what it's worth, I just tried installing poetry on a Windows machine using the powershell install instructions, and I did not get the same warning message, even though I was using the same versions of poetry and Python (1.1.12 and 3.10.2, respectively).

I'm realizing I should have mentioned in my original report that I installed Python 3.10 using miniconda, although I didn't think miniconda was the issue since I don't get the warning if I use Python 3.9 as my conda environment's interpreter.

@kronion
Copy link

kronion commented Feb 10, 2022

I'm seeing the same issue using poetry and miniconda with python 3.8. I'm able to reproduce in a new conda env containing only the installed python. Poetry was installed using get-poetry.py.

❯  conda --version
conda 4.11.0

❯  poetry --version
Poetry version 1.1.12

❯  conda create -n poetry-test
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /miniconda3/envs/poetry-test



Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate poetry-test
#
# To deactivate an active environment, use
#
#     $ conda deactivate


❯  conda activate poetry-test

❯  poetry --version
Poetry version 1.1.12

❯  conda install python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /miniconda3/envs/poetry-test

  added / updated specs:
    - python=3.8


The following NEW packages will be INSTALLED:

  ca-certificates    conda-forge/osx-64::ca-certificates-2021.10.8-h033912b_0
  libcxx             conda-forge/osx-64::libcxx-12.0.1-habf9029_1
  libffi             conda-forge/osx-64::libffi-3.4.2-h0d85af4_5
  libzlib            conda-forge/osx-64::libzlib-1.2.11-h9173be1_1013
  ncurses            conda-forge/osx-64::ncurses-6.3-he49afe7_0
  openssl            conda-forge/osx-64::openssl-3.0.0-h0d85af4_2
  pip                conda-forge/noarch::pip-22.0.3-pyhd8ed1ab_0
  python             conda-forge/osx-64::python-3.8.12-h43ca1e7_3_cpython
  python_abi         conda-forge/osx-64::python_abi-3.8-2_cp38
  readline           conda-forge/osx-64::readline-8.1-h05e3726_0
  setuptools         conda-forge/osx-64::setuptools-60.8.1-py38h50d1736_0
  sqlite             conda-forge/osx-64::sqlite-3.37.0-h23a322b_0
  tk                 conda-forge/osx-64::tk-8.6.11-h5dbffcc_1
  wheel              conda-forge/noarch::wheel-0.37.1-pyhd8ed1ab_0
  xz                 conda-forge/osx-64::xz-5.2.5-haf1e3a3_1
  zlib               conda-forge/osx-64::zlib-1.2.11-h9173be1_1013


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

❯  poetry --version
/miniconda3/envs/poetry-test/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Poetry version 1.1.12

@ethanscorey
Copy link
Author

This has continued to bug me, so I've been doing some more poking around. The SetuptoolsDeprecationWarning is triggered by a call to setuptools.install. I did some grep-ing to see if I could find that call somewhere in the Poetry source, but I came up dry.

@finswimmer or someone else more familiar with the Poetry codebase, do you know of some reason there would be a call to setuptools.install every time the Poetry command-line app gets run?

@sondrelg
Copy link

sondrelg commented Mar 13, 2022

Looks like this is still an issue present in the master branch (6485bc2).

I printed a few frames, and this seems to indicate there is call to setuptools in env.py

<frame at 0x7fbb67b646d0, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/setuptools/_distutils/cmd.py', line 62, code __init__>
<frame at 0x7fbb67b72220, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/setuptools/__init__.py', line 174, code __init__>
<frame at 0x7fbb67b5ecf0, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/setuptools/_distutils/dist.py', line 859, code get_command_obj>
<frame at 0x11098de40, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/utils/env.py', line 1396, code get_paths>
<frame at 0x11071a5c0, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/utils/env.py', line 1198, code paths>
<frame at 0x110a2c380, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/utils/env.py', line 1167, code purelib>
<frame at 0x1104423e0, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/utils/env.py', line 1182, code is_path_relative_to_lib>
<frame at 0x7fbb66ff03a0, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/repositories/installed_repository.py', line 118, code create_package_from_distribution>
<frame at 0x7fbb66ffa750, file '/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/poetry/repositories/installed_repository.py', line 252, code load>
/Users/sondrelg/.virtualenvs/project/lib/python3.10/site-packages/setuptools/command/install.py:38: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(

Cleaned up version:

setuptools/_distutils/cmd.py', line 62, code __init__  # <-- this is where the warning is output
setuptools/__init__.py', line 174, code __init__
setuptools/_distutils/dist.py', line 859, code get_command_obj
poetry/utils/env.py', line 1396, code get_paths
poetry/utils/env.py', line 1198, code paths
poetry/utils/env.py', line 1167, code purelib
poetry/utils/env.py', line 1182, code is_path_relative_to_lib
poetry/repositories/installed_repository.py', line 118, code create_package_from_distribution
poetry/repositories/installed_repository.py', line 252, code load

@finswimmer
Copy link
Member

I can only guess what happens and my guess is that this message is triggered by a dependency used by poetry. The reason why I cannot reproduce it might be that my installation have a more recent version of this dependency.

Please reinstall poetry via the recommended install-poetry.py script. Than the latest version of the dependencies will be installed.

@sondrelg
Copy link

Installing via the install-poetry.py script did solve the issue for me 👍 Also uninstalled afterwards, and can confirm the pip installation reintroduced the issue.

@fredcy
Copy link

fredcy commented Apr 12, 2022

I was getting this warning from Poetry 1.1.9. Doing poetry self update updated to version 1.1.13 and resolved the problem.

@mkniewallner mkniewallner removed status/triage This issue needs to be triaged status/waiting-on-response Waiting on response from author labels Jun 11, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

7 participants