question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect index in lockfile

See original GitHub issue

Issue description

When using a custom index for a package that is also on PyPI, but with different versions, it uses the custom index for the version (which is the higher version, so this is correct), but the lock file tags it as coming from the PyPI index. The version that is locked does not exist on the pypi index, and the PyPI versions do not exist on the custom index.

Expected result

I expected it to get the latest version, and annotate the lockfile with the correct index that the version was retrieved from.

Actual result

Locking works cleanly, but produced the odd output in the lockfile.

Steps to replicate

Use this Pipfile

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

[[source]]
name = "aspiredu"
verify_ssl = true
url = "https://pypi.fury.io/OHXIw-9Umgf3jlbpG5ULSp97w456Q/aspiredu/"

[dev-packages]

[packages]
django-enumfields = "*"

[requires]
python_version = "3.7"

to lock and get this Pipfile.lock

{
    "_meta": {
        "hash": {
            "sha256": "8e1f91149b67ec93c8a959eb66c89860a7dcfba35b07c058890607a0bc16eb7c"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            },
            {
                "name": "aspiredu",
                "url": "https://pypi.fury.io/OHXIw-9Umgf3jlbpG5ULSp97w456Q/aspiredu/",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django-enumfields": {
            "hashes": [
                "sha256:b32faacf10ac20201dc2910a5f440d8132e7cae80e689e14a97bd1394e3a8dd4"
            ],
            "index": "pypi",
            "version": "==0.10.1+aspiredu1"
        }
    },
    "develop": {}
}

$ pipenv --support

Pipenv version: '2018.11.14'

Pipenv location: '/home/ryan/.local/lib/python3.6/site-packages/pipenv'

Python location: '/home/ryan/.pyenv/versions/3.6.6/bin/python3.6'

Python installations found:

  • 3.7.1: /home/ryan/.pyenv/versions/3.7.1/bin/python3
  • 3.7.1: /home/ryan/.pyenv/versions/3.7.1/bin/python3.7m
  • 3.7.0: /home/ryan/.pyenv/versions/3.7.0/bin/python3
  • 3.7.0: /home/ryan/.pyenv/versions/3.7.0/bin/python3.7m
  • 3.6.7: /home/ryan/.pyenv/versions/3.6.7/bin/python3
  • 3.6.7: /home/ryan/.pyenv/versions/3.6.7/bin/python3.6m
  • 3.6.6: /home/ryan/.pyenv/versions/3.6.6/bin/python3
  • 3.6.6: /home/ryan/.pyenv/versions/3.6.6/bin/python3.6m
  • 3.6.6: /usr/bin/python3
  • 3.6.6: /usr/bin/python3.6m
  • 2.7.15rc1: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-38-generic',
 'platform_system': 'Linux',
 'platform_version': '#41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018',
 'python_full_version': '3.6.6',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • LS_COLORS
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • GDM_LANG
  • DISPLAY
  • QT_STYLE_OVERRIDE
  • COLORTERM
  • PYENV_VIRTUALENV_INIT
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • MANDATORY_PATH
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • GNOME_TERMINAL_SCREEN
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • PWD
  • HOME
  • TEXTDOMAIN
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • GTK_MODULES
  • TERM
  • SHELL
  • VTE_VERSION
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • GNOME_TERMINAL_SERVICE
  • XDG_SEAT
  • SHLVL
  • PYENV_SHELL
  • LANGUAGE
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • SESSION_MANAGER
  • LESSOPEN
  • GTK_IM_MODULE
  • OLDPWD
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/ryan/bin:/home/ryan/.local/bin:/home/ryan/.pyenv/plugins/pyenv-virtualenv/shims:/home/ryan/.pyenv/shims:/home/ryan/.pyenv/bin:/home/ryan/.local/bin:/home/ryan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/ryan/Code/aspiredu/pipenv-indices

Contents of Pipfile (‘/home/ryan/Code/aspiredu/pipenv-indices/Pipfile’):

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

[[source]]
name = "aspiredu"
verify_ssl = true
url = "https://pypi.fury.io/OHXIw-9Umgf3jlbpG5ULSp97w456Q/aspiredu/"

[dev-packages]

[packages]
django-enumfields = "*"

[requires]
python_version = "3.7"

Contents of Pipfile.lock (‘/home/ryan/Code/aspiredu/pipenv-indices/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "8e1f91149b67ec93c8a959eb66c89860a7dcfba35b07c058890607a0bc16eb7c"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            },
            {
                "name": "aspiredu",
                "url": "https://pypi.fury.io/OHXIw-9Umgf3jlbpG5ULSp97w456Q/aspiredu/",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django-enumfields": {
            "hashes": [
                "sha256:b32faacf10ac20201dc2910a5f440d8132e7cae80e689e14a97bd1394e3a8dd4"
            ],
            "index": "pypi",
            "version": "==0.10.1+aspiredu1"
        }
    },
    "develop": {}
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
nickwilliams-eventbritecommented, Nov 30, 2018

I’m also seeing this problem. Here’s a bit more info:

Our project Pipfiles have two sources at the top:

[[source]]
url = "https://our.jenkins.server/job/wheelhouse-index/Indexes/16.04/simple/"
verify_ssl = true
name = "our_wheelhouse"

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

Our private wheelhouse holds closed-source projects that we don’t release publicly. When we run pipenv lock on a project, every dependency in the Pipfile.lock ends up having "index": "our_wheelhouse" in it, including all the open source projects that actually come from PyPi. This is despite the fact that we don’t mirror anything in our private wheelhouse: It contains only our closed-source projects.

The order of the [[source]]s does not matter. If we put PyPi first, our private wheelhouse is still listed as the index for every dependency, even those on PyPi.

Interestingly, it doesn’t seem to affect anything. Future installs using the lock file still work fine. There are no errors. But this is clearly not accurate data in the lock file, and I’m concerned that, in future pipenv versions, it could break something.

0reactions
fridexcommented, Jan 8, 2021

Observed this a few times as well. This behavior breaks integration with other tools in our cases (e.g. micropipenv).

Read more comments on GitHub >

github_iconTop Results From Across the Web

git index.lock File exists when I try to commit, but cannot delete ...
It could very well be a permissions problem where Git assumes that since it can't create the file it already exists. Have you...
Read more >
Understanding and Using Git's index.lock File | Pluralsight
The index.lock file prevents changes to your local repository from happening from outside of the currently running git process so as to ensure ......
Read more >
Index.lock problem when commiting inside Visual Studio for ...
Restarting my computer and using no other editor or Git Process, i.e. going straight to Visual Studio. Checking for the index.lock file, it...
Read more >
Git Error: Unable to create index.lock | The First Byte
Here's an error I recently came accross in Git when trying to push a commit. If Git is giving you something about being...
Read more >
Problem with write.lock file generated by Lucene
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1108) at org.neo4j.index.impl.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found