pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.86k stars 1.86k forks source link

Double requirements given: django #168

Closed jungornti closed 7 years ago

jungornti commented 7 years ago

Hello again, i have found new problem, after pipenv install i got a message:

Double requirement given: django (from -r /tmp/tmpc1V61X-requirements.txt (line 43)) (already in Django==1.10.5 (from -r /tmp/tmpc1V61X-requirements.txt (line 29)), name='django')

Additionnaly, i noticed that Pipfile transformed to new look (pymorphy2's extras section).

Pipenv version: installed from master (updating prompt example a771b7a)]

How to reproduce the problem:

  1. create Pipfile
  2. run pipenv install

Source Pipfile:

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

[dev-packages]
django-debug-toolbar = "*"
pytest = "*"
pytest-django = "*"
coverage = "*"
tox = "*"
mock = "*"

[packages]
celery = "*"
Django = "*"
django-allauth = "*"
django-ckeditor = "*"
django-cleanup = "*"
django-cmstemplates = "*"
django-codemirror-widget = "*"
django-el-pagination = "*"
django-widget-tweaks = "*"
easy-thumbnails = "*"
envvars = "*"
hiredis = "*"
ipython = "*"
lxml = "*"
psycopg2 = "*"
pymorphy2-dicts-ru = "*"
pymorphy2 = {extras = ["fast,"]}
pytils = "*"
redis = "*"
rules = "*"
dj-database-url = "*"
pillow = "*"

Resulting Pipfile after pipenv install:

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

[dev-packages]
django-debug-toolbar = "*"
pytest = "*"
pytest-django = "*"
coverage = "*"
tox = "*"
mock = "*"

[packages]
celery = "*"
django-allauth = "*"
django-ckeditor = "*"
django-cleanup = "*"
django-cmstemplates = "*"
django-codemirror-widget = "*"
django-el-pagination = "*"
django-widget-tweaks = "*"
easy-thumbnails = "*"
envvars = "*"
hiredis = "*"
ipython = "*"
lxml = "*"
psycopg2 = "*"
pymorphy2-dicts-ru = "*"
pytils = "*"
redis = "*"
rules = "*"
dj-database-url = "*"
pillow = "*"
django = "*"

[packages.pymorphy2]
extras = [ "fast",]

Generated requirements.txt file:

envvars==0.3.0 --hash=sha256:337c8364bd8f4d1d9a58a8557c9a3603b07958d4edd852326a3fd9565513f7ee
vine==1.1.3 --hash=sha256:739b19304065de99bd1f4665abe461b449b1022c1e4f89a7925db9d50e9741ea
ipython-genutils==0.1.0 --hash=sha256:6218e9abd612fb5acfb175ea7c7b026006de4df9691d9a73c9b390cfa1a41c2b
django-cleanup==0.4.2 --hash=sha256:d43878039588218ab45aa5f64ef822eb6499bbd7ca8ef0d5263ff6b90dc13062
billiard==3.5.0.2 --hash=sha256:3eb01a8fe44116aa6d63d2010515ef1526e40caee5f766f75b2d28393332dcaa
pygments==2.2.0 --hash=sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d
django-ckeditor==5.2.1 --hash=sha256:d7ed04b3e31edf62dc5d7f03e883f09d431aba85224ae962d95ca0f72c3b910f
pytils==0.3 --hash=sha256:1ed01c48803b123c9eea0c7e876243549562bd09c7355a7c1ff8636e6ccbc7f6
python-openid==2.2.5 --hash=sha256:38ba6f7fa152c72bbf67ba9dd4fc07c7b940ee6a94bb2dc8734ea9e2e4661a8a
prompt-toolkit==1.0.10 --hash=sha256:32a8929dbfa17c49f81d7838b167c1a965f5263e3727eed3060d50c9b11f3244
pyparsing==2.1.10 --hash=sha256:67101d7acee692962f33dd30b5dce079ff532dd9aa99ff48d52a3dad51d2fe84
pymorphy2-dicts==2.4.393442.3710985 --hash=sha256:70d3e33fa28108a2dfcded787c7a5946c6ab88bb669b3afb20f8c447aadec924
appdirs==1.4.0 --hash=sha256:85e58578db8f29538f3109c11250c2a5514a2fcdc9890d9b2fe777eb55517736
oauthlib==2.0.1 --hash=sha256:132ad46df25e53a84b33f1fd43f80e973cda2cb018cc0168d7d0c8c4d5cef9b5
lxml==3.7.2 --hash=sha256:f302a725802b56c173bbef29131cc753413e47749fcf96d7a4bde4e6ffd25dee
pymorphy2-dicts-ru==2.4.394633.4298366 --hash=sha256:9b34612452df565ef463d04fb2353758fe2335ec80fc55b7d7fd0ebba76ea5da
amqp==2.1.4 --hash=sha256:5e0871a93433f941e444c2b859da095f05034d2ac1b7c084529cfd0b6f8eef18
psycopg2==2.6.2 --hash=sha256:70490e12ed9c5c818ecd85d185d363335cc8a8cbf7212e3c185431c79ff8c05c
six==1.10.0 --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
redis==2.10.5 --hash=sha256:97156b37d7cda4e7d8658be1148c983984e1a975090ba458cc7e244025191dbd
ptyprocess==0.5.1 --hash=sha256:464cb76f7a7122743dd25507650db89cd447c51f38e4671602b3eaa2e38e05ae
celery==4.0.2 --hash=sha256:0e5b7e0d7f03aa02061abfd27aa9da05b6740281ca1f5228a54fbf7fe74d8afa
kombu==4.0.2 --hash=sha256:385bf38e6de7f3851f674671dbfe24572ce999608d293a85fb8a630654d8bd9c
olefile==0.44 --hash=sha256:61f2ca0cd0aa77279eb943c07f607438edf374096b66332fae1ee64a6f0f73ad
django-allauth==0.30.0 --hash=sha256:231f1e980dee8ee56be4f64e6a4b77cb32b41d977e6ea6bd310b2c8c0bc354bb
django-widget-tweaks==1.4.1 --hash=sha256:0e8e3b7ebd1aafb2250d0f7614cfbad27017b3c727858ee3aee23748dd1f147d
backports.shutil-get-terminal-size==1.0.0 --hash=sha256:0975ba55054c15e346944b38956a4c9cbee9009391e41b86c68990effb8c1f64
rules==1.2 --hash=sha256:2c4b3542bcc34f9f8d39111a61e8fd9e37cfb72e01b7d947d097018ba405767e
Django==1.10.5 --hash=sha256:4541a60834f28f308ee7b6e96400feca905fb0de473eb9dad6847e98a36d86d4
dj-database-url==0.4.2 --hash=sha256:e16d94c382ea0564c48038fa7fe8d9c890ef1ab1a8ec4cb48e732c124b9482fd
DAWG==0.7.8 --hash=sha256:ceca8a90ed3aca30d31a3ca1d56267df1d4d2afab1d79f8554fc97c36bb6e967
ipython==5.2.0 --hash=sha256:c0f3cfc9e84874eb2286002aa66a564e1ce46bd96c997b7d024092e5b4fd14e8
pexpect==4.2.1 --hash=sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018
pickleshare==0.7.4 --hash=sha256:c9a2541f25aeabc070f12f452e1f2a8eae2abd51e1cd19e8430402bdf4c1d8b5
dawg-python==0.7.2 --hash=sha256:4941d5df081b8d6fcb4597e073a9f60d5c1ccc9d17cd733e8744d7ecfec94ef3
decorator==4.0.11 --hash=sha256:73cbaadb8bc4e3c65fe1100773d56331a2d756cc0f5c7b9d8d5d5223fe04f600
pathlib2==2.2.1 --hash=sha256:31b7bac38144612b18fb55adc4285e34a766ae64fdb1200c72e0b0cdd632ef4b
packaging==16.8 --hash=sha256:99276dc6e3a7851f32027a68f1095cd3f77c148091b092ea867a351811cfe388
enum34==1.1.6 --hash=sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79
django-cmstemplates==0.3.3 --hash=sha256:6d0233745689ed129a0ddd559a531c2536959173760b559bfcc11199ca518a4a
pytz==2016.10 --hash=sha256:a1ea35e87a63c7825846d5b5c81d23d668e8a102d3b1b465ce95afe1b3a2e065
wcwidth==0.1.7 --hash=sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c
django
easy-thumbnails==2.3 --hash=sha256:d6113cf1e1ece85216ab8cd62c352da21853c9ef31341161d904801d347d7aee
django-el-pagination==3.0.1 --hash=sha256:af12e779b0a6539e2c5f267115a017f5ae399970a4225671d8affa4cd258055a
traitlets==4.3.1 --hash=sha256:50522e46dd7b66c80686d50ff1b774000f1d2a80c84b2bcfbd657d588e99a368
requests-oauthlib==0.7.0 --hash=sha256:87e1c05c1b4b4220af0c7ff4e6572ff7fba8032166cb1a12d2e1acd4a5fdaf4f
hiredis==0.2.0 --hash=sha256:6224af25f7140a4c1f95cb17c3707e3c2de34fbf6bea1c3c1969c005fd4a9ff7
setuptools==34.1.0 --hash=sha256:edd9d39782fe38b9c533002b2e6fdf06498793cbd29266accdcc519431d4b7ba
django-codemirror-widget==0.4.1 --hash=sha256:4d24ef00c61677171117e7c8d49d8281cc08bd3fd6be6a4ea584def08edcb9b8
pymorphy2==0.8 --hash=sha256:549a1141abe01093242b9e11a1f60110ee4818f7fe57c9bb363e504339f382f5
requests==2.13.0 --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
docopt==0.6.2 --hash=sha256:d07f7a5321bad9e198465cda3fe89bbefc2784bb67ea59c2faa7a8f838fd8d73
simplegeneric==0.8.1 --hash=sha256:d5013ba138edde8100172897e50c3096177287cb9ad2f714cefe12ef0bf78eb0
pillow==4.0.0 --hash=sha256:a57f32a2f09ed61800e687aec0b2eebb095499116f50eff99e27e03ed9a8d776
scandir==1.4 --hash=sha256:aa4705b089660d419ecea91f3f38f704fdb46006a6ecb53732a224c24ec4dab3

Thanks!

nateprewitt commented 7 years ago

Hrmm, so https://pypi.python.org/simple lists the package name as django while every other resource has it as Django. This is causing our name normalization to get a different name casing than what pip is sending back. It currently looks like this is only happening for Django.

jungornti commented 7 years ago

Is it possible to instead of automatically normalize package names, throw some obvious error about that casing is wrong?

Explicit is better than implicit → the dev will see the error and fix Pipfile?

singleton11 commented 7 years ago

@jungornti, not in this case, I have to use pip-tools, which is not such comfortable, pipenv's behavior looks like modern package managers and I want to avoid manual work for dependency management, by the way it should be automated

nateprewitt commented 7 years ago

Tentatively fixed in 3.2.14 (#172). Please let us know if you encounter any further occurrences.

sephii commented 7 years ago

I'm having more or less the same issue on pipenv 3.4.2. The following Pipfile:

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

[dev-packages]
django-debug-toolbar = "*"
django-extensions = "*"
tox = "*"
Werkzeug = "*"

[packages]
psycopg2 = "*"
django-cms = "*"
djangocms-column = "*"

Results in the following Pipfile.lock (you can see django appears both as django and Django, with different versions):

{
    "default": {
        "django-sekizai": {
            "version": "==0.10.0",
            "hash": "sha256:cbd48e7be29e8cc4108476b9420d7c391fc509a504bc20b60616b116ba6ea51e"
        },
        "django-cms": {
            "version": "==3.4.2",
            "hash": "sha256:4d6f440b537d045398431b5e960b1450a98030e148c4bb0d01e97695ec63bfc7"
        },
        "django": {
            "version": "==1.9.12",
            "hash": "sha256:a59f85a2b007145006915f6134ec3b9c09e68e4377e0a6fd3529d6c56d6aeb04"
        },
        "djangocms-admin-style": {
            "version": "==1.2.6.2",
            "hash": "sha256:3613101d122ef91f198e2220395fc6024bcecf46cc99b9d00e7266a4619bf09e"
        },
        "django-treebeard": {
            "version": "==4.1.0",
            "hash": "sha256:f13c9a612a554ee0784632961904870efcf05f58282cd158da84ee88120fbafb"
        },
        "psycopg2": {
            "version": "==2.7",
            "hash": "sha256:e0313fb08c883ebc772d11c9ecf0b4ecf8946a37ed6fb3d2b6ad96f833a1af2b"
        },
        "djangocms-column": {
            "version": "==1.7.0",
            "hash": "sha256:06b73e18868fe40a364f33dbee99f20ffcd6a768ec14b5525794ef337a6cd542"
        },
        "django-formtools": {
            "version": "==2.0",
            "hash": "sha256:369443cdbff1cc8803e08f239c105dc76627239e7dad781060f76f93b919cf84"
        },
        "django-classy-tags": {
            "version": "==0.8.0",
            "hash": "sha256:f6d12f5a4df3e387795a0d9ef2836af389cae9a1fbebda035dac043d4722b1f7"
        },
        "Django": {
            "version": "==1.10.6",
            "hash": "sha256:2cfb83859bfaa10e2bd586340bead27c69fdcaa21fa683a008cc712482c26726"
        }
    },
    "develop": {
        "virtualenv": {
            "version": "==15.1.0",
            "hash": "sha256:39d88b533b422825d644087a21e78c45cf5af0ef7a99a1fc9fbb7b481e5c85b0"
        },
        "django-extensions": {
            "version": "==1.7.7",
            "hash": "sha256:ae69b1e33815d0baab7c14114af05840812f395a758bd45e80cf32548fbd6981"
        },
        "tox": {
            "version": "==2.6.0",
            "hash": "sha256:0001379c6dc21e69902e0279e7f91d420857bbb70901203564fb9e118c376dab"
        },
        "py": {
            "version": "==1.4.32",
            "hash": "sha256:2d4bba2e25fff58140e6bdce1e485e89bb59776adbe01d490baa6b1f37a3dd6b"
        },
        "django-debug-toolbar": {
            "version": "==1.6",
            "hash": "sha256:62f95c09c0faa4b2deac7edba69a84d0d8ad794e79ce24d86c7cd004c91053d8"
        },
        "Werkzeug": {
            "version": "==0.11.15",
            "hash": "sha256:c6f6f89124df0514d886782c658c3e12f2caaa94da34cee3fd82eebf4ebf052b"
        },
        "sqlparse": {
            "version": "==0.2.3",
            "hash": "sha256:740a023ef38ce11bbb99a9d143856f56ef4ec5b0d7a853f58c02c65b035114c4"
        },
        "six": {
            "version": "==1.10.0",
            "hash": "sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1"
        },
        "pluggy": {
            "version": "==0.4.0",
            "hash": "sha256:d2766caddfbbc8ef641d47da556d2ae3056860ce4d553aa04009e42b76a09951"
        },
        "Django": {
            "version": "==1.10.6",
            "hash": "sha256:2cfb83859bfaa10e2bd586340bead27c69fdcaa21fa683a008cc712482c26726"
        }
    },
    "_meta": {
        "sources": [
            {
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ],
        "requires": {},
        "hash": {
            "sha256": "cbcca3de6cd1499e7c49d5b59364625e71a62a2402c1c67317ab9ff3e65cd675"
        }
    }
}

And running pipenv install --dev unsurprisingly results in: Double requirement given: django==1.9.12 (from -r /tmp/tmpG2J7MX-requirements.txt (line 31)) (already in Django==1.10.6 (from -r /tmp/tmpG2J7MX-requirements.txt (line 18)), name='django').

nateprewitt commented 7 years ago

Hey @sephii, this is addressed in 3.5.0 which I'll be pushing a release for in the next hour or so. Thanks for letting us know!