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

Sync fails with requires-python = ">= 3.11" #91

Closed
bofm opened this issue May 2, 2023 · 3 comments
Closed

Sync fails with requires-python = ">= 3.11" #91

bofm opened this issue May 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@bofm
Copy link

bofm commented May 2, 2023

Steps to Reproduce

rye init -p 3.11 test1
cd test1
rye add flask
rye sync

Expected Result

should work

Actual Result

$ rye init -p 3.11 test1
success: Initialized project in /Users/s/tmp/FFKn/test1
$ cd test1
$ rye pin cpython@3.11
pinned 3.11.1 in /Users/s/tmp/FFKn/test1/.python-version
$ rye add flask
Added flask~=2.3.2 as regular dependency
$ rye sync
Downloading cpython@3.11.1
success: Downloaded cpython@3.11.1
Initializing new virtualenv in /Users/s/tmp/FFKn/test1/.venv
Python version: cpython@3.11.1
Generating production lockfile: /Users/s/tmp/FFKn/test1/requirements.lock
Traceback (most recent call last):
  File "/Users/s/.rye/self/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "/Users/s/.rye/self/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 439, in resolve
    raise ResolutionImpossible(self.state.backtrack_causes)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=RequiresPythonRequirement('>=3.11'), parent=EditableCandidate('file:///.'))]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/s/.rye/self/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
  File "/Users/s/.rye/self/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/piptools/scripts/compile.py", line 592, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/Users/s/.rye/self/lib/python3.10/site-packages/piptools/resolver.py", line 593, in resolve
    is_resolved = self._do_resolve(
  File "/Users/s/.rye/self/lib/python3.10/site-packages/piptools/resolver.py", line 625, in _do_resolve
    resolver.resolve(
  File "/Users/s/.rye/self/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 101, in resolve
    raise error from e
pip._internal.exceptions.UnsupportedPythonVersion: Package 'test1' requires a different Python: 3.10.9 not in '>=3.11'
Error: could not write production lockfile for project

Caused by:
    failed to generate lockfile

Version Info

rye 0.1.0
commit: unknown (d31b4853a 2023-05-01)
platform: macos (aarch64)
self-python: cpython@3.10

Stacktrace

No response

@bofm
Copy link
Author

bofm commented May 2, 2023

I tried to debug this by myself, but I couldn't quickly figure out the exact pip-compile command which Rye ran in the subprocess. It would be helpful if Rye printed the subprocess commands before executing them when --verbose flag is set.

This command works and generated a proper requirements.txt:

/Users/s/.rye/self/bin/python3 /Users/s/.rye/self/bin/pip-compile --resolver=backtracking --no-annotate --strip-extras --allow-unsafe --no-header -o requirements.txt pyproject.toml

@bofm
Copy link
Author

bofm commented May 2, 2023

It looks like this command fails:

/Users/s/.rye/self/bin/python3 /Users/s/.rye/self/lib/python3.10/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /private/var/folders/w8/hjmgsmvn55z2m19l8pvxkc940000gn/T/pip-build-env-1bmy7o1u/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- hatchling

rye lock gives the same result.

@mitsuhiko mitsuhiko added the bug Something isn't working label May 2, 2023
@mitsuhiko
Copy link
Collaborator

Pretty sure this is the same as #82. It picks up on the internal Python version in pip-compile that powers the internal rye virtualenv. Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants