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

Fix pipenv upgrades when star requirement is used #8452

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Nov 23, 2023

Closes #8449.

@herrbenesch
Copy link

herrbenesch commented Nov 27, 2023

@deivid-rodriguez thanks for the fix! How are you planning on proceeding with this? I'm asking because I don't know you processes there.
EDIT: If I can help bringing this forward, let me know.

@deivid-rodriguez
Copy link
Contributor Author

deivid-rodriguez commented Nov 27, 2023

No problem, this fix is ready. It needs to be approved by someone else in the team, and then I'll deploy and merge it as soon as I can. Most of the team is slowly getting back from thanksgiving, but we should be able to get this out soon.

@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/pipenv-star-requirement branch from 9c5561f to b109751 Compare November 27, 2023 19:13
@deivid-rodriguez
Copy link
Contributor Author

I just deployed this fix, in case you are able to verify it's now working as expected!

@deivid-rodriguez deivid-rodriguez merged commit 71165c2 into main Nov 27, 2023
81 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/pipenv-star-requirement branch November 27, 2023 19:51
@herrbenesch
Copy link

@deivid-rodriguez thanks for the quick processing.
I just tested to run the updater and now the error looks differently:

Traceback
(Dependabot::SharedHelpers::HelperSubprocessFailed)
updater | 2023/11/28 07:19:29 ERROR <job_755330528> Creating a virtualenv for this project...
updater | Pipfile: /home/dependabot/dependabot-updater/repo/Pipfile
updater | Using /usr/local/.pyenv/versions/3.11.5/bin/python3 (3.11.5) to create virtualenv...
updater | created virtual environment CPython3.11.5.final.0-64 in 1277ms
updater |   creator CPython3Posix(dest=/home/dependabot/.local/share/virtualenvs/repo-zexEiEfi, clear=False, no_vcs_ignore=False, global=False)
updater |   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/dependabot/.local/share/virtualenv)
updater |     added seed packages: pip==23.3.1, setuptools==68.2.2, wheel==0.41.3
updater |   activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
updater | 
updater | ✔ Successfully created virtual environment!
updater | Virtualenv location: /home/dependabot/.local/share/virtualenvs/repo-zexEiEfi
updater | Traceback (most recent call last):
updater |   File "/usr/local/.pyenv/versions/3.11.5/bin/pipenv", line 8, in <module>
updater |     sys.exit(cli())
updater |              ^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
updater |     return self.main(*args, **kwargs)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
updater |     return super().main(*args, **kwargs, windows_expand_args=False)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
updater |     rv = self.invoke(ctx)
updater |          ^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
updater |     return _process_result(sub_ctx.command.invoke(sub_ctx))
updater |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
updater |     return ctx.invoke(self.callback, **ctx.params)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
updater |     return __callback(*args, **kwargs)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
updater |     return ctx.invoke(f, obj, *args, **kwargs)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
updater |     return __callback(*args, **kwargs)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/cli/command.py", line 251, in upgrade
updater |     upgrade(
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/routines/update.py", line 140, in upgrade
updater |     project.add_pipfile_entry_to_pipfile(
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/project.py", line 1197, in add_pipfile_entry_to_pipfile
updater |     self.write_toml(p)
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/project.py", line 943, in write_toml
updater |     data = convert_toml_outline_tables(data, self)
updater |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/utils/toml.py", line 76, in convert_toml_outline_tables
updater |     result = convert_tomlkit_table(table_data)
updater |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/utils/toml.py", line 56, in convert_tomlkit_table
updater |     result[key.key] = table
updater |     ~~~~~~^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/items.py", line 1521, in __setitem__
updater |     self._value[key] = value
updater |     ~~~~~~~~~~~^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/container.py", line 667, in __setitem__
updater |     self._replace(old_key, key, value)
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/container.py", line 688, in _replace
updater |     self._replace_at(idx, new_key, value)
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/container.py", line 721, in _replace_at
updater |     self._insert_at(i, new_key, value)
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/container.py", line 449, in _insert_at
updater |     or "\n" in previous_item.trivia.trail
updater |                ^^^^^^^^^^^^^^^^^^^^
updater |   File "/usr/local/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pipenv/vendor/tomlkit/items.py", line 498, in trivia
updater |     return self._trivia
updater |            ^^^^^^^^^^^^
updater | AttributeError: 'Null' object has no attribute '_trivia'. Did you mean: 'trivia'?
updater | 2023/11/28 07:19:29 ERROR <job_755330528> /home/dependabot/common/lib/dependabot/shared_helpers.rb:427:in `run_shell_command'

@deivid-rodriguez
Copy link
Contributor Author

Thanks! Yeah, that's a different issue and I think it's a problem in pipenv. I think it should get fixed by pypa/pipenv#6024.

@deivid-rodriguez
Copy link
Contributor Author

Yeah, I just confirmed that the pipenv PR fixes this issue. Will try to speed up resolution because we're seeing this error quite a lot.

@deivid-rodriguez
Copy link
Contributor Author

Your issue should now be fixed @herrbenesch, are you able to confirm?

@herrbenesch
Copy link

@deivid-rodriguez works now. Thanks a lot for pushing for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependabot encountered an unknown error
3 participants