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

typing-extensions 4.0 sdist issue #27

Closed
dtrodrigues opened this issue Nov 23, 2021 · 5 comments
Closed

typing-extensions 4.0 sdist issue #27

dtrodrigues opened this issue Nov 23, 2021 · 5 comments

Comments

@dtrodrigues
Copy link

import typing_extensions fails from the sdist for 4.0. This works for 3.x

[root@b2fff8624d4d ~]# python3 -m pip install  --no-binary :all: typing-extensions==4.0.0
Collecting typing-extensions==4.0.0
  Using cached typing_extensions-4.0.0.tar.gz (37 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: typing-extensions
  Building wheel for typing-extensions (pyproject.toml) ... done
  Created wheel for typing-extensions: filename=typing_extensions-4.0.0-py3-none-any.whl size=22635 sha256=217b105e4382e579581f72d69a2390a59625aa55787f6f3c83f48e88e935c988
  Stored in directory: /root/.cache/pip/wheels/23/1c/b9/a6843f8ee0b06cae64a7fa6dcc1af022bc4fd3ba707147db2d
Successfully built typing-extensions
Installing collected packages: typing-extensions
Successfully installed typing-extensions-4.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@b2fff8624d4d ~]# python3 -c 'import typing_extensions'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'typing_extensions'
[root@b2fff8624d4d ~]# pip uninstall -y typing-extensions
Found existing installation: typing-extensions 4.0.0
Uninstalling typing-extensions-4.0.0:
  Successfully uninstalled typing-extensions-4.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@b2fff8624d4d ~]# python3 -m pip install --no-binary :all: typing-extensions==3.10.0.2
Collecting typing-extensions==3.10.0.2
  Using cached typing_extensions-3.10.0.2.tar.gz (46 kB)
  Preparing metadata (setup.py) ... done
Skipping wheel build for typing-extensions, due to binaries being disabled for it.
Installing collected packages: typing-extensions
    Running setup.py install for typing-extensions ... done
Successfully installed typing-extensions-3.10.0.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@b2fff8624d4d ~]# python3 -c 'import typing_extensions'
[root@b2fff8624d4d ~]# echo $?
0
[root@b2fff8624d4d ~]# uname -a 
Linux b2fff8624d4d 4.4.0-210-generic python/typing#242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@b2fff8624d4d ~]# cat /etc/redhat-release 
Fedora release 34 (Thirty Four)
[root@b2fff8624d4d ~]# python3 --version
Python 3.9.7
[root@b2fff8624d4d ~]# python3 -m pip --version
pip 21.3.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
@sobolevn
Copy link
Member

Related #30

@AA-Turner
Copy link
Member

AA-Turner commented Nov 25, 2021

When I proposed the build system changes it seemed like you could trick flit by overriding the module name to include the (non standard) src_py3 directory.

https://github.com/python/typing/blob/28b64f4fea5d9a1c3b3df7dd306892615f0ff728/typing_extensions/pyproject.toml#L65-L67

It seems though that this has stopped working, and I'm not entirely sure why.

A potential work-around would be to update the build instructions in CONTRIBUTING.md to something like:

  • pip3 install -U build
  • cd typing_extensions
  • rm -rf dist/ && cp -r src_py3/ src/
  • python -m build .
  • rm -rf src/

This builds from a src directory, which flit does support, although is sligtly more work for whoever makes a release.

Another alternative would be to rename src_py3 to src, but that does have some drawbacks (you need to use git log --follow not git log)

A

@AA-Turner
Copy link
Member

(the reason typing_extensions isn't being found in the original bug report is I suspect it has been installed as src_py3.typing_extensions -- or at least that was what was happening locally on my testing.

A

@JelleZijlstra
Copy link
Member

Thanks for investigating this! Let's just rename src/ so we follow a standard layout.

@JelleZijlstra
Copy link
Member

4.0.1 has been released with a working sdist.

@srittau srittau transferred this issue from python/typing May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants