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

Not possible to use with Python < 3.7 anymore? #375

Closed
1 task done
pawamoy opened this issue Apr 3, 2021 · 5 comments
Closed
1 task done

Not possible to use with Python < 3.7 anymore? #375

pawamoy opened this issue Apr 3, 2021 · 5 comments
Labels
🐛 bug Something isn't working

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Apr 3, 2021

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

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

Install PDM with pipx using Python 3.9:

pipx install pdm --python python3.9

In a project, run pdm use -f 3.6, then pdm install -d:

Actual behavior

% pdm install -d 
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
[CalledProcessError]: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.
Add '-v' to see the detailed traceback
% pdm install -dv
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
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 179, in main
    return Core().main(args)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 142, in main
    raise err.with_traceback(traceback)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 137, in main
    f(options.project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/commands/install.py", line 40, in handle
    actions.do_sync(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 127, in do_sync
    handler.synchronize()
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/installers/synchronizers.py", line 263, in synchronize
    to_add, to_update, to_remove = self.compare_with_working_set()
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/installers/synchronizers.py", line 118, in compare_with_working_set
    environment = self.environment.marker_environment
  File "/usr/lib/python3.9/functools.py", line 969, in __get__
    val = self.func(instance)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/models/environment.py", line 330, in marker_environment
    return get_pep508_environment(self.python_executable)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/models/in_process.py", line 63, in get_pep508_environment
    return json.loads(subprocess.check_output(args))
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.

Expected behavior

I hope PDM will continue to support Python versions less than 3.7!

Environment Information

% pdm info && pdm info --env
PDM version:        1.5.0b0                                                                     
Python Interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python (3.6.9)
Project Root:       /media/data/dev/pawamoy/copier-templates-extensions                         
Project Packages:   /media/data/dev/pawamoy/copier-templates-extensions/__pypackages__/3.6      
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
[CalledProcessError]: Command '['/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.6.9/bin/python', '-I', '/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep508.py']' returned non-zero exit status 1.
Add '-v' to see the detailed traceback

😱

% pdm use -f 3.7            
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.5/bin/python (3.7.5)
Updating executable scripts...
% pdm info && pdm info --env
PDM version:        1.5.0b0                                                                     
Python Interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.7.5/bin/python (3.7.5)
Project Root:       /media/data/dev/pawamoy/copier-templates-extensions                         
Project Packages:   /media/data/dev/pawamoy/copier-templates-extensions/__pypackages__/3.7      
{
  "implementation_name": "cpython",
  "implementation_version": "3.7.5",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.11.11-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000",
  "python_full_version": "3.7.5",
  "platform_python_implementation": "CPython",
  "python_version": "3.7",
  "sys_platform": "linux"
}
@pawamoy pawamoy added the 🐛 bug Something isn't working label Apr 3, 2021
@pawamoy
Copy link
Contributor Author

pawamoy commented Apr 3, 2021

Additional info: maybe https://pypi.org/project/future-annotations/ could be used somehow.

@frostming
Copy link
Collaborator

Thanks for the catch, will just remove the types from the file.

@frostming
Copy link
Collaborator

This issue reminds me of lacking integration test cases for all supported python versions.

@pawamoy
Copy link
Contributor Author

pawamoy commented Apr 9, 2021

Would it be possible to get a 1.5.0b1 release? I started using PDM in a few projects with grouped dev-dependencies (and I love it) and I'm still supporting Python 3.6. Nothing urgent so I totally understand if you prefer waiting a bit before a new release 🙂

@frostming
Copy link
Collaborator

frostming commented Apr 10, 2021

I still have one improvement/refactor in backlog so let's target it in the next week

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