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

requires-python and markers: lock OK, install fails #480

Closed
1 task done
pawamoy opened this issue May 25, 2021 · 2 comments
Closed
1 task done

requires-python and markers: lock OK, install fails #480

pawamoy opened this issue May 25, 2021 · 2 comments
Labels
🐛 bug Something isn't working

Comments

@pawamoy
Copy link
Contributor

pawamoy commented May 25, 2021

  • I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

This is a follow-up of #476 (sorry for all these bug reports 😅)
With just one additional package, pdm install will fail:

[project]
name = "pawamoy-testing"
version = {use_scm = true}
description = "Testing this great template"
authors = [{name = "Timothee Mazzucotelli", email = "[email protected]"}]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.6"
dynamic = ["version", "classifiers"]
classifiers = ["Development Status :: 4 - Beta"]
dependencies = []

[project.scripts]
pawamoy-testing = "pawamoy_testing.cli:main"

[project.urls]
Repository = "https://github.com/pawamoy/pawamoy-testing"
Homepage = "https://github.com/pawamoy/pawamoy-testing"

[tool.pdm]
package-dir = "src"

[tool.pdm.dev-dependencies]
docs = [
    "mkdocs-section-index~=0.3; python_version >= '3.7'",
    "mkdocstrings~=0.15; python_version >= '3.7'",
]
format = [
    "black~=20.8b1"
]

(See error in "Actual behavior" paragraph)

Note that it works if I remove the python_version >= '3.7' marker from mkdocstrings.

We could argue that since mkdocstrings is compatible with Python 3.6, one should not add the python_version >= '3.7' marker to it, however the docs will only build if the whole docs section is installed, so there's no point in installing just mkdocstrings on Python 3.6 since docs won't build anyway.

Actual behavior

% pdm use -f 3.6
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.13/bin/python (3.6)
Updating executable scripts...
% pdm install
Synchronizing working set with lock file: 12 to add, 0 to update, 0 to remove

  ✔ Install appdirs 1.4.4 successful
  ✔ Install black 20.8b1 successful
  ✔ Install click 8.0.1 successful
  ✔ Install importlib-metadata 4.0.1 successful
  ✔ Install dataclasses 0.8 successful
  ✔ Install mypy-extensions 0.4.3 successful
  ✔ Install pathspec 0.8.1 successful
  ✔ Install regex 2021.4.4 successful
  ✔ Install toml 0.10.2 successful
  ✔ Install typed-ast 1.4.3 successful
  ✔ Install typing-extensions 3.10.0.0 successful
  ✔ Install zipp 3.4.1 successful
Installing the project as an editable package...
  ✔ Install pawamoy-testing 0.1.0+d20210525 successful

🎉 All complete!


% pdm use -f 3.7
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.9/bin/python (3.7)
Updating executable scripts...
% pdm install
See /tmp/pdm-install-resolve-sxari6dq.log for detailed debug log.
[ResolutionImpossible]: [RequirementInformation(requirement=NamedRequirement(name='pytkdocs', marker=None, extras=(), specifier=<SpecifierSet('<0.12.0,>=0.2.0')>, editable=False), parent=<Candidate mkdocstrings 0.15.1 from unknown>)]
Add '-v' to see the detailed traceback
% pdm install -v
Traceback (most recent call last):
  File "/home/pawamoy/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 184, in main
    return Core().main(args)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 145, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 140, in main
    f(options.project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/commands/install.py", line 46, in handle
    actions.do_sync(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 152, in do_sync
    candidates = resolve_candidates_from_lockfile(project, requirements)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 111, in resolve_candidates_from_lockfile
    mapping, *_ = resolve(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/resolver/core.py", line 49, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 473, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 377, in resolve
    raise ResolutionImpossible(causes)
resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=NamedRequirement(name='pytkdocs', marker=None, extras=(), specifier=<SpecifierSet('<0.12.0,>=0.2.0')>, editable=False), parent=<Candidate mkdocstrings 0.15.1 from unknown>)]


% pdm use -f 3.8
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.8.10/bin/python (3.8)
Updating executable scripts...
% pdm install -v
Traceback (most recent call last):
  File "/home/pawamoy/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 184, in main
    return Core().main(args)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 145, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 140, in main
    f(options.project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/commands/install.py", line 46, in handle
    actions.do_sync(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 152, in do_sync
    candidates = resolve_candidates_from_lockfile(project, requirements)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 111, in resolve_candidates_from_lockfile
    mapping, *_ = resolve(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/resolver/core.py", line 49, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 473, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 377, in resolve
    raise ResolutionImpossible(causes)
resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=NamedRequirement(name='pytkdocs', marker=None, extras=(), specifier=<SpecifierSet('<0.12.0,>=0.2.0')>, editable=False), parent=<Candidate mkdocstrings 0.15.1 from unknown>)]

Expected behavior

Successfull installation of mkdocstrings, pytkdocs and others 😊

Environment Information

% pdm use -f 3.7            
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.9/bin/python (3.7)
Updating executable scripts...
% pdm info && pdm info --env
PDM version:        1.5.4.dev70+g952bde6                                                      
Python Interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.9/bin/python (3.7)
Project Root:       /media/data/dev/pawamoy/copier-pdm/tests/tmp                              
Project Packages:   /media/data/dev/pawamoy/copier-pdm/tests/tmp/__pypackages__/3.7           
{
  "implementation_name": "cpython",
  "implementation_version": "3.7.9",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.12.5-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT Wed, 19 May 2021 10:32:40 +0000",
  "python_full_version": "3.7.9",
  "platform_python_implementation": "CPython",
  "python_version": "3.7",
  "sys_platform": "linux"
}
@pawamoy pawamoy added the 🐛 bug Something isn't working label May 25, 2021
@frostming
Copy link
Collaborator

frostming commented May 26, 2021

(sorry for all these bug reports 😅)

Never, the reports help to make the project more robust than ever. It is even more helpful you help to test the unreleased behavior.

@pawamoy
Copy link
Contributor Author

pawamoy commented May 26, 2021

I just don't want to overwhelm you with all those bugs and questions 😄
Thank you for your dedication on this, and for fixing things so fast 🙂

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