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

build fails to install Poetry #570

Closed
yurivict opened this issue Jan 29, 2023 · 12 comments
Closed

build fails to install Poetry #570

yurivict opened this issue Jan 29, 2023 · 12 comments

Comments

@yurivict
Copy link

Once poetry is installed it fails to find some other components:

$ poetry
Traceback (most recent call last):
  File "/usr/local/bin/poetry", line 5, in <module>
    from poetry.console.application import main
ModuleNotFoundError: No module named 'poetry.console'

Only one executable 'poetry' is installed, and no any additional Python modules.
All poetry's dependencies are satisfied.

The poetry upstream says that the installation is broken.

build-0.9.0
poetry-1.3.2
Python-3.9
FreeBSD 13.1

Installed from the FreeBSD port https://cgit.freebsd.org/ports/tree/devel/poetry

@layday
Copy link
Member

layday commented Jan 29, 2023

Please try the FreeBSD bug tracker, forum, Discord or IRC channel; they'll be better positioned to help.

@layday layday closed this as completed Jan 29, 2023
@yurivict
Copy link
Author

build builds a wrong wheel. How can the FreeBSD forums help with this?

@layday
Copy link
Member

layday commented Jan 29, 2023

So if I unpack the Poetry 1.3.2 sdist and run python -m build -w, the wheel won't contain the console submodule?

@layday
Copy link
Member

layday commented Jan 29, 2023

~/c/p/b/test-poetry (main|✔) $ curl -O https://files.pythonhosted.org/packages/6b/ed/57f55c650cb61310ac15df2b694d41dfb45c33480c3394410a911b847971/poetry-1.3.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  851k  100  851k    0     0  1499k      0 --:--:-- --:--:-- --:--:-- 1545k
~/c/p/b/test-poetry (main|✔) $ tar xzf poetry-1.3.2.tar.gz
~/c/p/b/test-poetry (main|✔) $ cd poetry-1.3.2/
~/c/p/b/t/poetry-1.3.2 (main|✔) $ python -m build -w
* Creating venv isolated environment...
* Installing packages in isolated environment... (poetry-core>=1.1.0)
* Getting build dependencies for wheel...
* Building wheel...
Successfully built poetry-1.3.2-py3-none-any.whl
~/c/p/b/t/poetry-1.3.2 (main|✔) $ unzip -l dist/poetry-1.3.2-py3-none-any.whl | rg console | head -n 1
        0  01-01-1980 00:00   poetry/console/__init__.py
~/c/p/b/t/poetry-1.3.2 (main|✔) $ python -m venv venv
~/c/p/b/t/poetry-1.3.2 (main|✔) $ venv/bin/python -m pip install dist/poetry-1.3.2-py3-none-any.whl
[...]
Successfully installed attrs-22.2.0 cachecontrol-0.12.11 certifi-2022.12.7 cffi-1.15.1 charset-normalizer-3.0.1 cleo-2.0.1 crashtest-0.4.1 distlib-0.3.6 dulwich-0.20.50 filelock-3.9.0 html5lib-1.1 idna-3.4 importlib-metadata-6.0.0 jaraco.classes-3.2.3 jsonschema-4.17.3 keyring-23.13.1 lockfile-0.12.2 more-itertools-9.0.0 msgpack-1.0.4 packaging-23.0 pexpect-4.8.0 pkginfo-1.9.6 platformdirs-2.6.2 poetry-1.3.2 poetry-core-1.4.0 poetry-plugin-export-1.2.0 ptyprocess-0.7.0 pycparser-2.21 pyrsistent-0.19.3 rapidfuzz-2.13.7 requests-2.28.2 requests-toolbelt-0.10.1 shellingham-1.5.0.post1 six-1.16.0 tomlkit-0.11.6 trove-classifiers-2023.1.20 urllib3-1.26.14 virtualenv-20.17.1 webencodings-0.5.1 xattr-0.10.1 zipp-3.12.0
~/c/p/b/t/poetry-1.3.2 (main|✔) $ venv/bin/poetry
Poetry (version 1.3.2)
[...]

I'm afraid the problem lies elsewhere.

@neersighted
Copy link

The correct venue to report this is https://bugs.freebsd.org; the issue lies in the FreeBSD port.

@yurivict
Copy link
Author

Weird things happen.

When the build is done in poetry-1.3.2 - the resulting wheel is ok.
But when the build is done in work/poetry-1.3.2 - the resulting wheel is empty. Its file size is only 4303 bytes.

Here is the script that reproduces it:

USE_WORK=yes

if [ $USE_WORK = yes ]; then
        rm -rf work
        mkdir work
        (cd work && tar xzf ../poetry-1.3.2.tar.gz)
        DIR=work/poetry-1.3.2
else
        rm -rf poetry-1.3.2
        tar xzf poetry-1.3.2.tar.gz
        DIR=poetry-1.3.2
fi

(cd $DIR && python3.9 -m build -n -w)

ls -l $DIR/dist/poetry-1.3.2-py3-none-any.whl

Output with USE_WORK=yes:

$ ./b.sh 
* Getting build dependencies for wheel...
* Building wheel...
Successfully built poetry-1.3.2-py3-none-any.whl
-rw-r--r--  1 yuri  users  4303 Jan 29 12:35 work/poetry-1.3.2/dist/poetry-1.3.2-py3-none-any.whl

Output with USE_WORK=no:

$ ./b.sh 
* Getting build dependencies for wheel...
* Building wheel...
Successfully built poetry-1.3.2-py3-none-any.whl
-rw-r--r--  1 yuri  users  218886 Jan 29 12:36 poetry-1.3.2/dist/poetry-1.3.2-py3-none-any.whl

@layday
Copy link
Member

layday commented Jan 29, 2023

Are you git ignoring "work" or something?

@dimbleby
Copy link

Why -n?

@yurivict
Copy link
Author

yurivict commented Jan 29, 2023

There is no git - this is from the tarball.

-n is just a flag that the ports framework uses. I don't know why.

Resulting wheel is different - this is the problem.

@dimbleby
Copy link

Nevertheless, layday's guess sounds good. If you're working anywhere near a .gitignore that might see work, this all would be consistent with python-poetry/poetry#5547

@yurivict
Copy link
Author

That was it, thanks.
It was picking .gitignore due to the idiosyncratic behavior of Poetry.

Thank you for your help!

@jameshilliard
Copy link
Contributor

FYI python-poetry/poetry-core#611 should fix this.

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

No branches or pull requests

5 participants