-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Pipfile sections are sorted before adding packages with extras #6171
Comments
Is this a bug report or a feature request? |
I believe its a bug report with the |
It's a bug report, I already have a (currently failing) test case to validate it. I also could try and tackle it |
@aradkdj @matteius @oz123 I had a dive on this issue and encountered several problems.
def _sort_category(self, category):
# toml tables won't maintain sorted dictionary order
# so construct the table in the order that we need
table = tomlkit.table()
for key, value in sorted(category.items()):
table.add(key, value)
return table
|
Issue description
When
sort_pipfile
is set toture
, if you install a new package with extras, it gets put at the end of the respective section instead of being sorted. If you previously had a package with extras at the end of the section, that one will get sorted but the new package with extras you're installing will still be put at the end of the section.Expected result
The recently installed package gets sorted within its section.
Actual result
The recently installed package gets put at the end of the section.
Steps to replicate
pipenv install psycopg[c]
). It will get put at the end of the section instead of between asgiref and zenpy.Pipfile
pipenv install sqlalchemy[async]
). The previous package with extras will be sorted and this new one will be put at the end of the section.Pipfile
$ pipenv --support
Pipenv version:
'2023.12.1'
Pipenv location:
'/home/user/.local/lib/python3.12/site-packages/pipenv'
Python location:
'/usr/bin/python3'
OS Name:
'posix'
User pip version:
'23.3.2'
user Python installations found:
PEP 508 Information:
System environment variables:
SHELL
SESSION_MANAGER
SNAP_REVISION
PYENV_SHELL
HISTCONTROL
XDG_MENU_PREFIX
SNAP_REAL_HOME
TERMINAL_EMULATOR
SNAP_USER_COMMON
HOSTNAME
HISTSIZE
SSH_AUTH_SOCK
MEMORY_PRESSURE_WRITE
TERM_SESSION_ID
SNAP_INSTANCE_KEY
XMODIFIERS
DESKTOP_SESSION
BAMF_DESKTOP_FILE_HINT
EDITOR
SNAP_EUID
PWD
XDG_SESSION_DESKTOP
LOGNAME
XDG_SESSION_TYPE
SYSTEMD_EXEC_PID
XAUTHORITY
DESKTOP_STARTUP_ID
SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS
SNAP_CONTEXT
GJS_DEBUG_TOPICS
GDM_LANG
HOME
USERNAME
LANG
LS_COLORS
XDG_CURRENT_DESKTOP
VIRTUAL_ENV
MEMORY_PRESSURE_WATCH
WAYLAND_DISPLAY
SNAP_ARCH
SNAP_INSTANCE_NAME
SNAP_USER_DATA
INVOCATION_ID
MANAGERPID
SNAP_REEXEC
SNAP_UID
STEAM_FRAME_FORCE_CLOSE
GJS_DEBUG_OUTPUT
GNOME_SETUP_DISPLAY
XDG_ACTIVATION_TOKEN
XDG_SESSION_CLASS
TERM
LESSOPEN
USER
SNAP
SNAP_COMMON
SNAP_VERSION
DISPLAY
SHLVL
SNAP_LIBRARY_PATH
SNAP_COOKIE
QT_IM_MODULE
VIRTUAL_ENV_PROMPT
SNAP_DATA
XDG_RUNTIME_DIR
PS1
PYENV_ROOT
DEBUGINFOD_URLS
SNAP_NAME
JOURNAL_STREAM
XDG_DATA_DIRS
PATH
GDMSESSION
DBUS_SESSION_BUS_ADDRESS
MAIL
GIO_LAUNCHED_DESKTOP_FILE_PID
GIO_LAUNCHED_DESKTOP_FILE
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/home/user/.pyenv/versions/3.10.14/bin:/home/user/.local/share/virtualenvs/pythonProject-bFLmJOh0/bin:/home/user/.pyenv/shims:/home/user/.pyenv/bin:/home/user/.local/bin:/home/user/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin
SHELL
:/bin/bash
EDITOR
:/usr/bin/nano
LANG
:en_US.UTF-8
PWD
:/home/user/Documents/learning/pythonProject
VIRTUAL_ENV
:/home/user/.local/share/virtualenvs/pythonProject-bFLmJOh0
Contents of
Pipfile
('/home/user/Documents/learning/pythonProject/Pipfile'):Contents of
Pipfile.lock
('/home/user/Documents/learning/pythonProject/Pipfile.lock'):The text was updated successfully, but these errors were encountered: