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

Exporting requirements-dev.txt without python_full_version #8034

Closed
Jkrox opened this issue Oct 9, 2024 · 1 comment
Closed

Exporting requirements-dev.txt without python_full_version #8034

Jkrox opened this issue Oct 9, 2024 · 1 comment

Comments

@Jkrox
Copy link

Jkrox commented Oct 9, 2024

uv version: 0.4.9

command executed: uv export --extra dev --no-hashes -o requirements-dev.txt . I got the following thing:

requirements-dev.txt

# This file was autogenerated via `uv export`.
aiohappyeyeballs==2.4.3 ; python_full_version >= '3.12'
aiohttp==3.10.8 ; python_full_version >= '3.12'
aiosignal==1.3.1 ; python_full_version >= '3.12'
annotated-types==0.7.0 ; python_full_version >= '3.12'
anyio==4.6.0 ; python_full_version >= '3.12'
attrs==24.2.0 ; python_full_version >= '3.12'
certifi==2024.8.30 ; python_full_version >= '3.12'
charset-normalizer==3.3.2 ; python_full_version >= '3.12'
click==8.1.7 ; python_full_version >= '3.12'
colorama==0.4.6 ; (python_full_version >= '3.12' and sys_platform == 'win32') or (python_full_version >= '3.12' and platform_system == 'Windows')
dnspython==2.7.0 ; python_full_version >= '3.12'
email-validator==2.2.0 ; python_full_version >= '3.12'
fastapi==0.115.0 ; python_full_version >= '3.12'
fastapi-cli==0.0.5 ; python_full_version >= '3.12'
frozenlist==1.4.1 ; python_full_version >= '3.12'
h11==0.14.0 ; python_full_version >= '3.12'
httpcore==1.0.6 ; python_full_version >= '3.12'
httptools==0.6.1 ; python_full_version >= '3.12'
httpx==0.27.2 ; python_full_version >= '3.12'
idna==3.10 ; python_full_version >= '3.12'
jinja2==3.1.4 ; python_full_version >= '3.12'
markdown-it-py==3.0.0 ; python_full_version >= '3.12'
markupsafe==3.0.0 ; python_full_version >= '3.12'
mdurl==0.1.2 ; python_full_version >= '3.12'
multidict==6.1.0 ; python_full_version >= '3.12'
packaging==24.1 ; python_full_version >= '3.12'
psutil==6.0.0 ; python_full_version >= '3.12'
pydantic==2.9.2 ; python_full_version >= '3.12'
pydantic-core==2.23.4 ; python_full_version >= '3.12'
pygments==2.18.0 ; python_full_version >= '3.12'
python-dotenv==1.0.1 ; python_full_version >= '3.12'
python-multipart==0.0.12 ; python_full_version >= '3.12'
pyyaml==6.0.2 ; python_full_version >= '3.12'
requests==2.32.3 ; python_full_version >= '3.12'
rich==13.9.2 ; python_full_version >= '3.12'
ruff==0.6.9 ; python_full_version >= '3.12'
shellingham==1.5.4 ; python_full_version >= '3.12'
sniffio==1.3.1 ; python_full_version >= '3.12'
starlette==0.38.6 ; python_full_version >= '3.12'
typer==0.12.5 ; python_full_version >= '3.12'
typing-extensions==4.12.2 ; python_full_version >= '3.12'
urllib3==2.2.3 ; python_full_version >= '3.12'
uvicorn==0.31.0 ; python_full_version >= '3.12'
uvloop==0.20.0 ; python_full_version >= '3.12' and platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'
watchfiles==0.24.0 ; python_full_version >= '3.12'
websockets==13.1 ; python_full_version >= '3.12'
yarl==1.13.1 ; python_full_version >= '3.12'

I'm trying to do uv pip freeze > requirements-dev.txt but with the dev stuff.

pyproject.toml

[project]
name = "test"
version = "0.1.0"
description = "test"
requires-python = ">=3.12"
dependencies = [
    "aiohappyeyeballs==2.4.3",
    "aiohttp==3.10.8",
    "aiosignal==1.3.1",
    "attrs==24.2.0",
    "certifi==2024.8.30",
    "charset-normalizer==3.3.2",
    "fastapi[standard]>=0.115.0",
    "frozenlist==1.4.1",
    "idna==3.10",
    "multidict==6.1.0",
    "packaging==24.1",
    "psutil>=6.0.0",
    "pydantic>=2.9.2",
    "python-dotenv==1.0.1",
    "requests==2.32.3",
    "urllib3==2.2.3",
    "websockets==13.1",
    "yarl==1.13.1",
]

[tool.uv]
dev-dependencies = [
    "ruff>=0.6.9",
]
@Jkrox
Copy link
Author

Jkrox commented Oct 9, 2024

I was able to solve the issue, just update uv, now uv 0.4.20, and use the following command:

uv export --only-dev --no-hashes | awk '{print $1}' FS=' ;' > requirements-dev.txt.

or if you want to export with no dev dependencies, use this command:

uv export --no-dev --no-hashes | awk '{print $1}' FS=' ;' > requirements.txt.

References:

the option --only-dev was added exactly in the version 0.4.11.

@Jkrox Jkrox closed this as completed Oct 9, 2024
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

1 participant