-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support disabling workspace and dev installation of uv pip install
#10991
Comments
As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
Does |
As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
AAAAAAhhhh 🤦 .... You are a lifesaver @konstin ! I totally, totally missed it when I looked at the commands available and I have not realized it does what I am doing by manually removing the workspaces... I checked it and it seems I can get it to work, with few small other tweaks (for example I need to add There are few more tweaks I have to add but generally speaking it does, indeed, solve my problem. Thank you ! |
Maybe we should add the word "workspace" somewhere in the help for |
## Summary See: #10991 (comment)
Yes. That would be great :) But actually ... I found a bug with how |
@charliermarsh @konstin => Issue here: #10999 |
…#46139) As part of #46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
…apache#46139) As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
…apache#46139) As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
…apache#46139) As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
…apache#46139) As part of apache#46045 we are moving all providers to the new structure, each with it's own pyproject.toml. However we noticed that constraint generation is somewhat broken during the move: * providers moved to the new structure disappeared from pypi constraints * http provider in SOME PRs started to appear in "source constraints" Both should not happen: * pypi constraints should contain all providers (latest versions in PyPI) * source providers should contain no providers - only their dependencies There are two reasons for those two issues, and this PR fixes both: 1) The PyPI providers were removed because `uv pip install .` without editable flag is currently - pretty unexpectedly - installing local workspaced providers rather than install them from PyPI and there are no controls to disable it. Workaround for that is that during constraint generation we remove temporarily all providers from workspace definition in the pyproject.toml - this way providers are installed from PyPI. Feature request to handle it has been raised in the astral-sh/uv#10991 2) The http provider was added to the constraint in PRs where the http provider is a required dependency (for example in discord provider). Since the http provider is not yet migrated, discord installation in workspace will pull it from PyPI rather than from the local workspace. This has been fixed by simply migrating the http provider to the new structure,
Summary
While moving Airlfow to use workspace (which is great feature of uv) - apache/airflow#46045 I foud out that
uv pip install
behaviour for NON EDITABLE installation when project has workspace defined inpyproject.toml
is somewhat broken. It's not a really a bug, just the behaviour is different to what you would expect and it lacks control of what you would like to install there.A bit of context
On of the usages of
uv
we have in airflow, is to prepare constraints resulting in:There are good reasons we are doing it - mostly we do it in order to produce a somewhat reproducible installation for our users when we release airlfow - and the version we do in
main
is more of "let's see if it still works" - we only actually use thosepypi
constraints when we release airflow - so we have a variant of such constraints for every release of airlfow and every python version supported frozen in our GitHub repository so our users can refer to it if they want to somewhat reproducibly install airflow with dependencies and providers that we tested at the moment of release of Airflow.We do it with a command (auto-generated) similar to this:
The problem
The problem is that this does not really pull the providers from pypi as expected - but uses the ones which are defined in the workspace.
Our workspace looks more or less like this:
And the problem is tha when I run pip install command above, it will install and use all the providers and all the devel dependencies defined in the pyproject.toml - and not "bare" "airlfow" package + all the packages I requested to install.
For example - this is what happens when I run another version of this:
When you look at this - even if I requested a non-editable version of "airflow" from sources, it still instas editable versions of packages referred to by the workspace - even though what I REALLY want in this case I would like to install those packages from PyPI.
This might or might not be a reasonable default, not sure. Depends what your philosophy of workspace is - the fact that you have
pyproject.toml
locally that determines workspace, might mean that you want to use the workspace-packages even in non-editable mode, And this is fine.But the real problem is that I currently have no way to add parameters to
uv pip install
to change this behaviour. I miss specifically those two:Also others (
--only-dev
) thatuv sync
supports.Now - why can't I use
uv sync
? One could think that I could use:or
But I really can't - because in this case I do NOT want to install the provider packages from my workspace - I want to install them from pypi AND I want to explicitly specify which provider packages I want to use, individually, so
uv pip install
is much more suitable for it.Currently what I am doing to workaround it is I modify the
pyproject.toml
dynamically before running theuv pip install
command and remove all providers from the workspace definition. This works as expected. The above command will install packages from PyPI rather than from local workspace and life is good. But it's a nasty hack.Would you please consider adding extra flags to
pip
install to control the workspace/dev installation behaviour whenuv pip install ,
is run for project which is workspace-enabled inpyproject.toml
?This is behaviour observed in 0.5.11 (latest at the time of this issue writing) version.
Example
No response
The text was updated successfully, but these errors were encountered: