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

Key error raised on requirements subcommand when VCS dependency is specified #256

Closed
fridex opened this issue Jan 26, 2023 · 5 comments · Fixed by #257
Closed

Key error raised on requirements subcommand when VCS dependency is specified #256

fridex opened this issue Jan 26, 2023 · 5 comments · Fixed by #257
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@fridex
Copy link
Collaborator

fridex commented Jan 26, 2023

Describe the bug

Given the following Pipfile:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
selinon = {git = "https://github.com/selinon/selinon"}

[dev-packages]

Running the following command:

micropipenv --verbose req --only-direct

I get the following error:

Traceback (most recent call last):
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1464, in <module>
    return_code = main()
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1451, in main
    handler(**arguments)
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1301, in requirements
    sections = sections or get_requirements_sections(
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1097, in get_requirements_sections
    result["default"] = {
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1098, in <dictcomp>
    dependency_name: _parse_pipfile_dependency_info(pipfile_entry)
  File "/Users/fridolin.pokorny/git/fridex/selinon/demo-worker/./micropipenv.py", line 1064, in _parse_pipfile_dependency_info
    result = {"version": pipfile_entry["version"]}
KeyError: 'version'

Expected behavior

Requirements should be generated respecting VCS dependency stated in the provided Pipfile.

@goern
Copy link
Member

goern commented Jan 26, 2023

Heya @fridex thanks for opening the issue, sounds like a bug to me ...

/kind bug
/priority critical-urgent
/assign @VannTen

@sesheta sesheta added the kind/bug Categorizes issue or PR as related to a bug. label Jan 26, 2023
@sesheta sesheta added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jan 26, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Board Jan 26, 2023
@VannTen
Copy link
Member

VannTen commented Jan 26, 2023

If we accept the new scope proposed in #249 (point 1), this is out of scope. (because micropipenv should parse Pipfile.lock, not attempt to resolve Pipfile to Pipfile.lock)

@fridex
Copy link
Collaborator Author

fridex commented Jan 26, 2023

If we accept the new scope proposed in #249 (point 1), this is out of scope. (because micropipenv should parse Pipfile.lock, not attempt to resolve Pipfile to Pipfile.lock)

This corresponds to the requirements feature. In some cases, users might want to convert Pipfile to requirements style output (see also pipenv requrements command).

The reported bug affects micropipenv requirements --only-direct in which case users want only direct dependencies converted to the requirements style file - hence Pipfile has to be parsed for that.

@fridex
Copy link
Collaborator Author

fridex commented Jan 26, 2023

#249

Ah, sorry - opened another issue.

Ideally yes, if there is only one standard for defining requirements and lockfiles, this would not be needed. But I would expect it will take some time (years?) to have the lockfile standard accepted and used widely. In the meantime, micropipenv could be helpful.

@frenzymadness
Copy link
Collaborator

Does any of you plan to propose a fix for this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants