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

Add uv #657

Merged
merged 23 commits into from Feb 15, 2024
Merged

Add uv #657

merged 23 commits into from Feb 15, 2024

Conversation

mitsuhiko
Copy link
Collaborator

No description provided.

@mitsuhiko mitsuhiko merged commit 259c898 into main Feb 15, 2024
12 checks passed
@mitsuhiko mitsuhiko deleted the feature/puffin branch February 15, 2024 19:42
/// Indicates if the experimental puffin support should be used.
pub fn use_puffin(&self) -> bool {
/// Indicates if the experimental uv support should be used.
pub fn use_uf(&self) -> bool {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this got merged already but this has a typo, it should probably be use_uv not use_uf.

@avoidik
Copy link

avoidik commented Feb 16, 2024

if you're looking for a command to activate it:

$ rye config --set-bool behavior.use-uv=true

@3f6a
Copy link

3f6a commented Feb 16, 2024

Do I have to install uv separately for this to work? Or does rye bundle uv?

@mitsuhiko
Copy link
Collaborator Author

@3f6a you don't need to install it, rye bundles it.

@landtuna
Copy link

landtuna commented Feb 16, 2024

@mitsuhiko I have a build that just started failing because of the inclusion of uv. The error says "Couldn't parse /bin/ls for detecting the ld version", which is a string in the uv source code and not the rye source code. It works if I call rye config --set-bool behavior.use-uv=false before rye sync, so uv seems to be opt-out.

@cnpryer
Copy link
Contributor

cnpryer commented Feb 16, 2024

It works if I call rye config --set-bool behavior.use-uv=false before rye sync, so uv seems to be opt-out.

If you can share a minimal example to reproduce your problem it'd help others look into this for you or provide advice.

FWIW sync run with 0.24.0 in a fresh linux environment looks opt-in:

@cnpryer ➜ /workspaces/rye (main) $ curl -sSf https://rye-up.com/get | bash
This script will automatically download and install rye (latest) for you.
######################################################################## 100.0%
Welcome to Rye!

This installer will install rye to /home/codespace/.rye
This path can be changed by exporting the RYE_HOME environment variable.

Details:
  Rye Version: 0.24.0
  Platform: linux (x86_64)

✔ Continue? · yes
✔ Select the preferred package installer · pip-tools (slow but stable)
✔ Determine Rye's python Shim behavior outside of Rye managed projects · Make Rye's own Python distribution available
✔ Which version of Python should be used as default toolchain? · cpython@3.12
Installed binary to /home/codespace/.rye/shims/rye
Bootstrapping rye internals
Downloading cpython@3.12.1
Checking checksum
success: Downloaded cpython@3.12.1
Upgrading pip
Installing internal dependencies
Updated self-python installation at /home/codespace/.rye/self

@cnpryer ➜ /workspaces/rye (main) $ which rye
/home/codespace/.rye/shims/rye

@cnpryer ➜ /workspaces/rye (main) $ rye --version
rye 0.24.0
commit: 0.24.0 (8d56aa18a 2024-02-15)
platform: linux (x86_64)
self-python: cpython@3.12
symlink support: true

@cnpryer ➜ /workspaces/rye (main) $ cat ~/.rye/config.toml 
[behavior]
global-python = true

[default]
toolchain = "cpython@3.12"

@cnpryer ➜ /workspaces/rye (main) $ rye sync
Downloading cpython@3.11.1
Checking checksum
success: Downloaded cpython@3.11.1
Initializing new virtualenv in /workspaces/rye/.venv
Python version: cpython@3.11.1
Generating production lockfile: /workspaces/rye/requirements.lock
Creating virtualenv for pip-tools
Generating dev lockfile: /workspaces/rye/requirements-dev.lock
Installing dependencies
Looking in indexes: https://pypi.org/simple/
Obtaining file:///. (from -r /tmp/tmp3nxkguz3 (line 5))
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting certifi==2023.5.7 (from -r /tmp/tmp3nxkguz3 (line 1))
  Downloading certifi-2023.5.7-py3-none-any.whl.metadata (2.2 kB)
Collecting charset-normalizer==3.1.0 (from -r /tmp/tmp3nxkguz3 (line 2))
  Downloading charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (197 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 197.3/197.3 kB 6.2 MB/s eta 0:00:00
Collecting click==8.1.3 (from -r /tmp/tmp3nxkguz3 (line 3))
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 3.1 MB/s eta 0:00:00
Collecting colorama==0.4.6 (from -r /tmp/tmp3nxkguz3 (line 4))
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting ghp-import==2.1.0 (from -r /tmp/tmp3nxkguz3 (line 6))
  Downloading ghp_import-2.1.0-py3-none-any.whl (11 kB)
Collecting idna==3.4 (from -r /tmp/tmp3nxkguz3 (line 7))
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting jinja2==3.1.2 (from -r /tmp/tmp3nxkguz3 (line 8))
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 4.5 MB/s eta 0:00:00
Collecting markdown==3.3.7 (from -r /tmp/tmp3nxkguz3 (line 9))
  Downloading Markdown-3.3.7-py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.8/97.8 kB 2.5 MB/s eta 0:00:00
Collecting markupsafe==2.1.2 (from -r /tmp/tmp3nxkguz3 (line 10))
  Downloading MarkupSafe-2.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (27 kB)
Collecting mdx-gh-links==0.3 (from -r /tmp/tmp3nxkguz3 (line 11))
  Downloading mdx_gh_links-0.3-py2.py3-none-any.whl (4.4 kB)
Collecting mergedeep==1.3.4 (from -r /tmp/tmp3nxkguz3 (line 12))
  Downloading mergedeep-1.3.4-py3-none-any.whl (6.4 kB)
Collecting mkdocs==1.4.3 (from -r /tmp/tmp3nxkguz3 (line 13))
  Downloading mkdocs-1.4.3-py3-none-any.whl.metadata (6.0 kB)
Collecting mkdocs-include-markdown-plugin==4.0.4 (from -r /tmp/tmp3nxkguz3 (line 14))
  Downloading mkdocs_include_markdown_plugin-4.0.4-py3-none-any.whl.metadata (9.7 kB)
Collecting mkdocs-material==9.1.12 (from -r /tmp/tmp3nxkguz3 (line 15))
  Downloading mkdocs_material-9.1.12-py3-none-any.whl.metadata (13 kB)
Collecting mkdocs-material-extensions==1.1.1 (from -r /tmp/tmp3nxkguz3 (line 16))
  Downloading mkdocs_material_extensions-1.1.1-py3-none-any.whl (7.9 kB)
Collecting mkdocs-simple-hooks==0.1.5 (from -r /tmp/tmp3nxkguz3 (line 17))
  Downloading mkdocs_simple_hooks-0.1.5-py3-none-any.whl (4.6 kB)
Collecting mkdocs-version-annotations==1.0.0 (from -r /tmp/tmp3nxkguz3 (line 18))
  Downloading mkdocs_version_annotations-1.0.0-py3-none-any.whl (6.5 kB)
Collecting packaging==23.1 (from -r /tmp/tmp3nxkguz3 (line 19))
  Using cached packaging-23.1-py3-none-any.whl.metadata (3.1 kB)
Collecting pygments==2.15.1 (from -r /tmp/tmp3nxkguz3 (line 20))
  Downloading Pygments-2.15.1-py3-none-any.whl.metadata (2.5 kB)
Collecting pymdown-extensions==9.11 (from -r /tmp/tmp3nxkguz3 (line 21))
  Downloading pymdown_extensions-9.11-py3-none-any.whl.metadata (3.1 kB)
Collecting python-dateutil==2.8.2 (from -r /tmp/tmp3nxkguz3 (line 22))
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 8.0 MB/s eta 0:00:00
Collecting pyyaml==6.0 (from -r /tmp/tmp3nxkguz3 (line 23))
  Downloading PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.9/757.9 kB 19.5 MB/s eta 0:00:00
Collecting pyyaml-env-tag==0.1 (from -r /tmp/tmp3nxkguz3 (line 24))
  Downloading pyyaml_env_tag-0.1-py3-none-any.whl (3.9 kB)
Collecting regex==2023.5.5 (from -r /tmp/tmp3nxkguz3 (line 25))
  Downloading regex-2023.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.9/40.9 kB 1.1 MB/s eta 0:00:00
Collecting requests==2.30.0 (from -r /tmp/tmp3nxkguz3 (line 26))
  Downloading requests-2.30.0-py3-none-any.whl.metadata (4.6 kB)
Collecting six==1.16.0 (from -r /tmp/tmp3nxkguz3 (line 27))
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3==2.0.2 (from -r /tmp/tmp3nxkguz3 (line 28))
  Downloading urllib3-2.0.2-py3-none-any.whl.metadata (6.6 kB)
Collecting watchdog==3.0.0 (from -r /tmp/tmp3nxkguz3 (line 29))
  Downloading watchdog-3.0.0-py3-none-manylinux2014_x86_64.whl.metadata (36 kB)
Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.0/157.0 kB 5.2 MB/s eta 0:00:00
Downloading mkdocs-1.4.3-py3-none-any.whl (3.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 49.2 MB/s eta 0:00:00
Downloading mkdocs_include_markdown_plugin-4.0.4-py3-none-any.whl (19 kB)
Downloading mkdocs_material-9.1.12-py3-none-any.whl (7.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 58.5 MB/s eta 0:00:00
Using cached packaging-23.1-py3-none-any.whl (48 kB)
Downloading Pygments-2.15.1-py3-none-any.whl (1.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 25.8 MB/s eta 0:00:00
Downloading pymdown_extensions-9.11-py3-none-any.whl (239 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.9/239.9 kB 7.7 MB/s eta 0:00:00
Downloading regex-2023.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (780 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 780.9/780.9 kB 17.9 MB/s eta 0:00:00
Downloading requests-2.30.0-py3-none-any.whl (62 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 1.9 MB/s eta 0:00:00
Downloading urllib3-2.0.2-py3-none-any.whl (123 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.2/123.2 kB 3.2 MB/s eta 0:00:00
Downloading watchdog-3.0.0-py3-none-manylinux2014_x86_64.whl (82 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.1/82.1 kB 2.8 MB/s eta 0:00:00
Building wheels for collected packages: rye-dev
  Building editable for rye-dev (pyproject.toml) ... done
  Created wheel for rye-dev: filename=rye_dev-1.0.0-py3-none-any.whl size=3488 sha256=bc1be09d6e48424b2d9d395b4d725e9510e6bd55202515ab2ddd9cb6c2c89a7f
  Stored in directory: /tmp/pip-ephem-wheel-cache-a_e4aaz7/wheels/97/54/f5/d849319cdfa096e074df352654ee2e7c919da8951f090690c6
Successfully built rye-dev
Installing collected packages: mkdocs-simple-hooks, mdx-gh-links, ghp-import, watchdog, urllib3, six, rye-dev, requests, regex, pyyaml-env-tag, pyyaml, python-dateutil, pymdown-extensions, pygments, packaging, mkdocs-version-annotations, mkdocs-material-extensions, mkdocs-material, mkdocs-include-markdown-plugin, mkdocs, mergedeep, markupsafe, markdown, jinja2, idna, colorama, click, charset-normalizer, certifi
Successfully installed certifi-2023.5.7 charset-normalizer-3.1.0 click-8.1.3 colorama-0.4.6 ghp-import-2.1.0 idna-3.4 jinja2-3.1.2 markdown-3.3.7 markupsafe-2.1.2 mdx-gh-links-0.3 mergedeep-1.3.4 mkdocs-1.4.3 mkdocs-include-markdown-plugin-4.0.4 mkdocs-material-9.1.12 mkdocs-material-extensions-1.1.1 mkdocs-simple-hooks-0.1.5 mkdocs-version-annotations-1.0.0 packaging-23.1 pygments-2.15.1 pymdown-extensions-9.11 python-dateutil-2.8.2 pyyaml-6.0 pyyaml-env-tag-0.1 regex-2023.5.5 requests-2.30.0 rye-dev-1.0.0 six-1.16.0 urllib3-2.0.2 watchdog-3.0.0
Done!

@landtuna
Copy link

@cnpryer - this reproduces the issue:

FROM redhat/ubi8:8.9

WORKDIR /WORK

ADD pyproject.toml /WORK

RUN curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION='--yes' bash && \
    source ~/.rye/env && \
    cd /WORK && \
    rye sync --no-dev
[project]
name = "example"
version = "0.1.0"
description = "demonstrate uv issue"
authors = [
]
dependencies = [
]

[project.scripts]
hello = "example:hello"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/example"]

@cnpryer
Copy link
Contributor

cnpryer commented Feb 17, 2024

I see. I believe this is a quick fix.

Might be worth reporting at https://github.com/astral-sh/uv, but I'd like to look at it again this weekend if I have some time.

Edit: So fast... looks like uv 0.1.3 might resolve the issue you encountered as well astral-sh/uv#1433

j178 pushed a commit to j178/rye that referenced this pull request Feb 18, 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

Successfully merging this pull request may close these issues.

None yet

6 participants