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

Allow uv sync --no-build-isolation #5742

Closed
chrisrodrigue opened this issue Aug 2, 2024 · 4 comments · Fixed by #5829
Closed

Allow uv sync --no-build-isolation #5742

chrisrodrigue opened this issue Aug 2, 2024 · 4 comments · Fixed by #5829
Assignees
Labels
configuration Settings and such needs-decision Undecided if this should be done preview Experimental behavior

Comments

@chrisrodrigue
Copy link

chrisrodrigue commented Aug 2, 2024

System Information

home = C:\WinPython\python-3.12.4.amd64
implementation = CPython
uv = 0.2.33
version_info = 3.12.4

Issue

uv fails to find build dependencies in the current virtual environment when utilizing an offline workflow.

The follow commands can reproduce the issue. Note that I create a virtual environment that inherits the packages from the WinPython distribution.

PS C:\Users\user\git\project> uv venv --system-site-packages
Using Python 3.12.4 interpreter at: C:\WinPython\python-3.12.4.amd64\python.exe
Creating virtualenv at: .venv
Activate with: .venv\Scripts\activate
PS C:\Users\user\git\project> .venv\Scripts\activate
(project) PS C:\Users\user\git\project> uv pip list
(project) PS C:\Users\user\git\project> python -m pip list
Package                       Version
----------------------------- -------------------
about-time                    4.2.1
absl-py                       2.0.0
accelerate                    0.28.0
adbc-driver-manager           0.11.0
adodbapi                      2.6.1.3
affine                        2.3.1
aiofiles                      23.2.1
aiohttp                       3.9.5
aiosignal                     1.3.1
aiosqlite                     0.20.0
alabaster                     0.7.16
alembic                       1.13.1
alive-progress                3.1.5
altair                        5.3.0
altair-data-server            0.4.1
altair-transform              0.2.0
aniso8601                     9.0.1
annotated-types               0.6.0
ansicolors                    1.1.8
anyio                         4.4.0
anywidget                     0.9.12
appdirs                       1.4.4
argon2-cffi                   23.1.0
argon2-cffi-bindings          21.2.0
array_api_compat              1.7.1
arrow                         1.2.2
asgi-csrf                     0.9
asgiref                       3.8.1
asn1crypto                    1.5.1
asteval                       0.9.31
astroid                       3.1.0
astropy                       6.1.0
astropy-iers-data             0.2024.4.29.0.28.48
asttokens                     2.4.1
async-lru                     2.0.4
async-timeout                 4.0.3
atomicwrites                  1.4.0
attrs                         23.2.0
autograd                      1.6.2
autopep8                      2.0.4
azure-core                    1.30.1
azure-cosmos                  4.6.0
azure-identity                1.16.0
Babel                         2.15.0
baresql                       0.8.0
bcrypt                        4.0.1
beautifulsoup4                4.12.2
binaryornot                   0.4.4
black                         24.4.2
bleach                        6.1.0
blinker                       1.7.0
bokeh                         3.4.1
botorch                       0.9.5
branca                        0.7.2
Brotli                        1.1.0
build                         1.2.1
cachelib                      0.13.0
cachetools                    5.3.3
Cartopy                       0.23.0
certifi                       2024.6.2
cffi                          1.16.0
cftime                        1.6.3
chardet                       5.2.0
charset-normalizer            3.3.2
clarabel                      0.9.0
click                         8.1.7
click-default-group           1.2.4
click-plugins                 1.1.1
cligj                         0.7.2
cloudpickle                   3.0.0
clr-loader                    0.2.6
clrmagic                      0.0.1a2
cma                           3.2.2
colorama                      0.4.6
colorcet                      3.1.0
colorlog                      6.8.2
comm                          0.2.2
contourpy                     1.2.1
cookiecutter                  2.6.0
coverage                      7.5.3
cryptography                  41.0.5
cvxopt                        1.3.2
cvxpy                         1.5.0
cycler                        0.12.1
Cython                        3.0.10
cytoolz                       0.12.3
dash                          2.17.0
dash-core-components          2.0.0
dash-html-components          2.0.0
dash-table                    5.0.0
dask                          2024.5.2
dask-expr                     1.1.2
dask-image                    2024.5.3
datasette                     0.64.6
datasette-graphql             2.2
datashader                    0.16.2
db.py                         0.5.4b1
deap                          1.4.1
debugpy                       1.8.0
decorator                     4.4.2
defusedxml                    0.7.1
Deprecated                    1.2.13
diff-match-patch              20200713
dill                          0.3.7
dirty-cat                     0.4.1
distlib                       0.3.8
distributed                   2024.5.2
distro                        1.8.0
Django                        5.0.6
dnspython                     2.6.1
docopt                        0.6.2
docstring-to-markdown         0.13
docutils                      0.20.1
duckdb                        1.0.0
ecos                          2.0.13
email_validator               2.1.1
entrypoints                   0.4
et-xmlfile                    1.1.0
executing                     2.0.1
fast-histogram                0.14
fastapi                       0.111.0
fastapi-cli                   0.0.4
fastjsonschema                2.18.0
filelock                      3.14.0
filterpy                      1.4.5
fiona                         1.9.5
flake8                        7.0.0
Flask                         3.0.3
Flask-Mail                    0.9.1
Flask-Session                 0.5.0
Flask-SQLAlchemy              3.0.5
flit                          3.9.0
flit_core                     3.9.0
folium                        0.16.0
fonttools                     4.51.0
formlayout                    1.2.1a1
fqdn                          1.5.1
frozenlist                    1.4.1
fsspec                        2024.3.1
future                        0.18.2
fuzzywuzzy                    0.18.0
GDAL                          3.7.3
geographiclib                 2.0
geopandas                     0.14.4
geopy                         2.4.1
gitdb                         4.0.10
GitPython                     3.1.32
gpytorch                      1.11
grapheme                      0.6.0
graphene                      3.3
graphql-core                  3.2.3
graphql-relay                 3.2.0
greenlet                      3.0.3
guidata                       3.5.0
h11                           0.14.0
h2                            4.1.0
h5py                          3.10.0
hatchling                     1.24.2
holoviews                     1.19.0
hpack                         4.0.0
html5lib                      1.1
httpcore                      1.0.5
httpie                        3.2.2
httptools                     0.6.1
httpx                         0.27.0
huggingface-hub               0.23.0
hupper                        1.12
hvplot                        0.10.0
Hypercorn                     0.16.0
hyperframe                    6.0.1
hypothesis                    6.100.5
idna                          3.7
imageio                       2.33.1
imageio-ffmpeg                0.4.8
imagesize                     1.4.1
imbalanced-learn              0.12.3
importlib_metadata            7.1.0
inflection                    0.5.1
iniconfig                     2.0.0
intervaltree                  3.0.2
ipycanvas                     0.13.2
ipykernel                     6.29.4
ipyleaflet                    0.19.1
ipympl                        0.9.4
ipython                       8.25.0
ipython-genutils              0.2.0
ipython-sql                   0.5.0
ipywidgets                    8.1.2
isoduration                   20.11.0
isort                         5.13.2
itsdangerous                  2.2.0
janus                         1.0.0
jaraco.classes                3.4.0
jaraco.context                5.3.0
jaraco.functools              4.0.1
jaxtyping                     0.2.22
jedi                          0.19.1
jellyfish                     1.0.3
Jinja2                        3.1.2
joblib                        1.4.2
json5                         0.9.14
jsonpatch                     1.33
jsonpointer                   2.4
jsonschema                    4.19.2
jsonschema-specifications     2023.12.1
julia                         0.6.2
jupyter                       1.0.0
jupyter_bokeh                 4.0.5
jupyter_client                8.6.2
jupyter-console               6.6.3
jupyter_core                  5.7.2
jupyter-events                0.10.0
jupyter-leaflet               0.19.1
jupyter-lsp                   2.2.5
jupyter_server                2.14.1
jupyter_server_terminals      0.5.3
jupyterlab                    4.2.2
jupyterlab_pygments           0.3.0
jupyterlab_server             2.27.2
jupyterlab_widgets            3.0.11
keras                         3.3.3
keyring                       25.2.1
kiwisolver                    1.4.5
kornia                        0.7.2
kornia_rs                     0.1.3
langchain                     0.2.5
langchain-core                0.2.7
langchain-text-splitters      0.2.1
langsmith                     0.1.77
lazy_loader                   0.4
lightning                     2.2.1
lightning-utilities           0.10.0
linear-operator               0.5.1
linkify-it-py                 2.0.2
llvmlite                      0.43.0
lmfit                         1.3.1
locket                        1.0.0
lxml                          5.2.2
Mako                          1.2.0
Markdown                      3.5.1
markdown-it-py                2.2.0
MarkupSafe                    2.1.1
matplotlib                    3.9.0
matplotlib-inline             0.1.7
maturin                       1.5.1
mccabe                        0.7.0
mdit-py-plugins               0.3.5
mdurl                         0.1.2
mercantile                    1.2.1
mergedeep                     1.3.4
missingno                     0.5.1
mistune                       2.0.5
mizani                        0.11.4
ml-dtypes                     0.4.0
mlxtend                       0.22.0
more-itertools                10.2.0
moviepy                       1.0.3
mpl-scatter-density           0.7
mpld3                         0.5.8
mpmath                        1.3.0
msal                          1.24.1
msal-extensions               1.0.0
msgpack                       1.0.4
msvc_runtime                  14.40.33807
multidict                     6.0.5
multipledispatch              1.0.0
mutagen                       1.47.0
mypy                          1.10.0
mypy-extensions               1.0.0
mysql-connector-python        8.0.21
namex                         0.0.8
nbclient                      0.10.0
nbconvert                     7.16.1
nbformat                      5.10.4
nest-asyncio                  1.6.0
netCDF4                       1.6.5
networkx                      3.3
nltk                          3.8.1
notebook                      7.2.1
notebook_shim                 0.2.4
ntlm-auth                     1.5.0
numba                         0.60.0
numexpr                       2.10.0
numpy                         1.26.4
numpydoc                      1.6.0
openai                        1.33.0
opencv-python                 4.10.0.82
openpyxl                      3.1.2
opt-einsum                    3.3.0
optree                        0.11.0
optuna                        3.6.1
orjson                        3.9.15
ortools                       9.8.3296
outcome                       1.3.0.post0
overrides                     7.7.0
packaging                     24.1
pandas                        2.2.2
pandocfilters                 1.5.0
panel                         1.4.4
papermill                     2.6.0
param                         2.1.0
paramiko                      2.8.0
parso                         0.8.4
partd                         1.4.0
pathspec                      0.11.0
patsy                         0.5.6
pdfrw                         0.4.post2
pep8                          1.7.1
pexpect                       4.8.0
pg8000                        1.23.0
pickleshare                   0.7.5
pillow                        10.3.0
PIMS                          0.6.1
Pint                          0.23
pip                           24.0
pkginfo                       1.9.6
platformdirs                  4.2.2
plotly                        5.22.0
plotnine                      0.13.6
PlotPy                        2.3.0
pluggy                        1.5.0
ply                           3.11
pmdarima                      2.0.4
polars                        0.20.31
portalocker                   2.7.0
portpicker                    1.5.0
ppci                          0.5.9
prettytable                   3.3.0
priority                      2.0.0
proglog                       0.1.10
prometheus-client             0.18.0
prompt-toolkit                3.0.43
protobuf                      4.25.1
psutil                        5.9.8
psygnal                       0.11.1
ptpython                      3.0.26
ptyprocess                    0.7.0
PuLP                          2.6.0
pure-eval                     0.2.2
pyarrow                       16.1.0
PyAudio                       0.2.14
pybars3                       0.9.7
pybind11                      2.12.0
pycodestyle                   2.11.1
pycosat                       0.6.6
pycparser                     2.22
pycryptodomex                 3.20.0
pyct                          0.5.0
pydantic                      2.7.1
pydantic_core                 2.18.2
pydeck                        0.9.1
pydocstyle                    6.3.0
pydub                         0.25.1
pyepsg                        0.4.0
pyerfa                        2.0.1.4
pyflakes                      3.2.0
pygame                        2.5.2
Pygments                      2.18.0
PyJWT                         2.8.0
pylint                        3.1.0
pylint-venv                   3.0.3
pyls-spyder                   0.4.0
PyMeta3                       0.5.1
pymongo                       4.7.2
pymoo                         0.6.1.1
Pympler                       1.0.1
PyNaCl                        1.5.0
pynndescent                   0.5.12
pyodbc                        5.1.0
Pyomo                         6.7.2
pypandoc                      1.5
pyparsing                     3.1.2
pypdf                         3.15.2
pypng                         0.20220715.0
pyproj                        3.6.1
pyproject_hooks               1.1.0
PyQt5                         5.15.10
PyQt5-Qt5                     5.15.2
PyQt5-sip                     12.13.0
pyqtgraph                     0.13.7
PyQtWebEngine                 5.15.6
PyQtWebEngine-Qt5             5.15.2
pyro-api                      0.1.2
pyro-ppl                      1.9.0
pyserial                      3.5
pyshp                         2.3.1
PySimpleGUI                   4.60.4
PySocks                       1.7.1
pytest                        8.2.0
python-barcode                0.15.1
python-dateutil               2.8.2
python-dotenv                 1.0.1
python-json-logger            2.0.7
python-lsp-black              2.0.0
python-lsp-jsonrpc            1.1.2
python-lsp-server             1.11.0
python-multipart              0.0.9
python-slugify                6.1.2
pythonnet                     3.0.3
PythonQwt                     0.12.1
pytoolconfig                  1.3.1
pytorch-lightning             2.2.1
pytz                          2023.3
pytz-deprecation-shim         0.1.0.post0
pyviz_comms                   3.0.2
pywin32                       306
pywin32-ctypes                0.2.2
pywinpty                      2.0.12
pywinusb                      0.4.2
PyYAML                        6.0.1
pyzmq                         26.0.3
QDarkStyle                    3.2.3
qpsolvers                     4.3.0
qrcode                        7.4.2
qstylizer                     0.2.2
QtAwesome                     1.3.1
qtconsole                     5.5.2
QtPy                          2.4.1
quantecon                     0.5.3
Quart                         0.19.4
rapidfuzz                     3.5.2
rasterio                      1.3.10
readme-renderer               35.0
redis                         4.3.1
referencing                   0.31.1
regex                         2023.10.3
reportlab                     4.2.0
requests                      2.31.0
requests-ntlm                 1.1.0
requests-toolbelt             1.0.0
retrying                      1.3.4
rfc3339-validator             0.1.4
rfc3986                       2.0.0
rfc3986-validator             0.1.1
rich                          13.7.1
rope                          1.12.0
rpds-py                       0.13.2
Rtree                         1.1.0
Rx                            3.1.1
safetensors                   0.4.2
scikit-image                  0.23.2
scikit-learn                  1.5.0
scipy                         1.13.1
scramp                        1.4.1
scs                           3.2.4.post1
seaborn                       0.13.2
Send2Trash                    1.8.2
setuptools                    69.5.1
shapely                       2.0.4
shellingham                   1.5.0.post1
simplegeneric                 0.8.1
simplejson                    3.19.2
simpy                         4.0.1
six                           1.16.0
slicerator                    1.1.0
smmap                         5.0.0
sniffio                       1.3.0
snowballstemmer               2.2.0
snuggs                        1.4.7
sortedcontainers              2.4.0
sounddevice                   0.4.6
soupsieve                     2.5
Sphinx                        7.2.6
sphinx-rtd-theme              2.0.0
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jquery          4.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.9
spyder                        5.5.5
spyder-kernels                2.5.2
SQLAlchemy                    2.0.28
sqlite_bro                    0.13.1
sqlite-fts4                   1.0.3
sqlite-utils                  3.36
sqlparse                      0.4.3
sspyrs                        0.3
stack-data                    0.6.3
starlette                     0.37.2
statsmodels                   0.14.2
streamlit                     1.35.0
streamz                       0.6.3
swifter                       1.3.4
sympy                         1.12.1
tabulate                      0.9.0
tbats                         1.1.0
tblib                         1.7.0
tenacity                      8.1.0
terminado                     0.18.1
text-unidecode                1.3
textdistance                  4.5.0
threadpoolctl                 3.5.0
three-merge                   0.1.1
tifffile                      2023.7.18
tinycss2                      1.1.1
tokenizers                    0.15.1
toml                          0.10.2
tomli                         2.0.1
tomli_w                       1.0.0
tomlkit                       0.12.3
toolz                         0.12.0
torch                         2.2.2
torchaudio                    2.2.2
torchmetrics                  1.3.2
torchvision                   0.17.2
tornado                       6.4
tqdm                          4.66.4
traitlets                     5.14.1
traittypes                    0.2.1
transformers                  4.38.2
trio                          0.25.1
trove-classifiers             2023.2.20
twine                         4.0.1
typeguard                     2.13.3
typer                         0.12.3
typing_extensions             4.9.0
tzdata                        2022.7
tzlocal                       4.2
uc-micro-py                   1.0.1
ujson                         5.8.0
umap-learn                    0.5.1
uncertainties                 3.1.7
uri-template                  1.2.0
urllib3                       2.0.3
uvicorn                       0.29.0
vega-datasets                 0.9.0
virtualenv                    20.26.2
waitress                      2.1.2
wasmer                        1.1.0
wasmer-compiler-cranelift     1.1.0
wasmer-compiler-singlepass    1.1.0
watchdog                      2.2.0
watchfiles                    0.21.0
wcwidth                       0.2.13
webcolors                     1.12
webencodings                  0.5.1
websocket-client              1.8.0
websockets                    12.0
Werkzeug                      3.0.3
whatthepatch                  1.0.2
wheel                         0.43.0
widgetsnbextension            4.0.10
winpython                     8.2.20240618
wordcloud                     1.9.3
wrapt                         1.14.1
wsproto                       1.2.0
xarray                        2024.6.0
XlsxWriter                    3.1.9
xlwings                       0.24.7
xmltodict                     0.13.0
xyzservices                   2023.10.1
yapf                          0.40.1
yarl                          1.7.2
yt-dlp                        2023.7.6
zict                          3.0.0
zipp                          3.17.0
zstandard                     0.22.0

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(project) PS C:\Users\user\git\project> uv sync --offline
warning: `uv sync` is experimental and may change without warning
Resolved 1 package in 38ms
error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: project @ file:///C:/Users/user/git/project
  Caused by: Failed to build: `project @ file:///C:/Users/user/git/project`
  Caused by: Failed to install requirements from build-system.requires (resolve)
  Caused by: No solution found when resolving: flit-core
  Caused by: Because flit-core was not found in the cache and you require flit-core, we can conclude that the requirements are unsatisfiable.

hint: Packages were unavailable because the network was disabled

However, I can install using uv pip install -e . --no-build-isolation

(project) PS C:\Users\user\git\project> uv pip install -e . --no-build-isolation
Resolved 1 package in 19ms
   Built project @ file:///C:/Users/user/git/project
Prepared 1 package in 346ms
Installed 1 package in 62ms
 + project==0.1.0 (from file:///C:/Users/user/git/project)
(project) PS C:\Users\user\git\project> uv pip list
Package Version Editable project location
------- ------- -------------------------
project 0.1.0   C:\Users\user\git\project
@charliermarsh charliermarsh added preview Experimental behavior configuration Settings and such needs-decision Undecided if this should be done labels Aug 2, 2024
@konstin
Copy link
Member

konstin commented Aug 5, 2024

We should consider giving --no-build-isolation the package name as argument for this use case, so it only applies to the select packages that don't support build isolation (yet).

@charliermarsh
Copy link
Member

That seems nice for the pip interface too honestly. --no-build-isolation-package for consistency, I guess.

@chrisrodrigue
Copy link
Author

chrisrodrigue commented Aug 5, 2024

An observation: uv pip list is not listing any packages even though I created the venv with the --system-site-packages option.

I expected it to list the packages from the python env found on the system path (which in this case is WinPython).

@chrisrodrigue
Copy link
Author

chrisrodrigue commented Aug 5, 2024

WinPython includes pytest==8.2.0 and flit_core==3.9.0 so I would have expected this to work:

PS C:\Users\user\git\project> uv venv --system-site-packages
Using Python 3.12.4 interpreter at: C:\WinPython\python-3.12.4.amd64\python.exe
Creating virtualenv at: .venv
Activate with: .venv\Scripts\activate
(project) PS C:\Users\user\git\project> uv pip install --offline --no-build-isolation -e .
  × No solution found when resolving dependencies:
  ╰─▶ Because pytest was not found in the cache and project==0.1.0 depends on pytest==8.2.0, we can conclude that project==0.1.0 cannot be used.
      And because only project==0.1.0 is available and you require project, we can conclude that the requirements are unsatisfiable.

      hint: Packages were unavailable because the network was disabled

Here's the pyproject.toml I was testing it with.

[build-system]
requires = ["flit_core>=3.9.0"]
build-backend = "flit_core.buildapi"

[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["pytest==8.2.0"]

It does work if I remove pytest from the dependencies, which I think suggests that it is finding flit_core in the inherited system site-packages.

(project) PS C:\Users\user\git\project> uv pip install --offline --no-build-isolation -e .
Resolved 1 package in 56ms
   Built project @ file:///C:/Users/user/git/project
Prepared 1 package in 387ms
Installed 1 package in 73ms
 + project==0.1.0 (from file:///C:/Users/user/git/project)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such needs-decision Undecided if this should be done preview Experimental behavior
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants