astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
23.32k stars 669 forks source link

uv Doesnt install daphne correctly #1448

Closed nofalx closed 8 months ago

nofalx commented 8 months ago

How to produce?

Make file below

install:
    python$(PYTHON_VERSION) -m venv env
    . env/bin/activate && pip --version
    . env/bin/activate && python -m pip install --upgrade pip
    . env/bin/activate && pip--version
    . env/bin/activate && python  -m pip install uv
    . env/bin/activate && uv pip install -r requirements.txt

for the file env/bin/daphne

uv will produce this output

#!/project/env/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from daphne.cli import CommandLineInterface.entrypoint
if __name__ == "__main__":
    sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
    sys.exit(CommandLineInterface.entrypoint())

pip without uv will produce this output

#!/project/env/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from daphne.cli import CommandLineInterface
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(CommandLineInterface.entrypoint())

The issue

The issue lays in the from daphne.cli import CommandLineInterface.entrypoint as this is an invalid python code to import

charliermarsh commented 8 months ago

This was fixed by #1622.