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

Can not install django-phonenumber-field properly with pipenv #200

Closed
sobolevn opened this issue Jan 18, 2018 · 10 comments
Closed

Can not install django-phonenumber-field properly with pipenv #200

sobolevn opened this issue Jan 18, 2018 · 10 comments
Milestone

Comments

@sobolevn
Copy link

Original issue: pypa/pipenv#1322

When installing django-phonenumber-field strange issue happens.
When running direct pipenv install django-phonenumber-field everything works fine.
But when another developer tries to install the requirements from Pipfile, for some reason package phonenumberslite is missing.

I feel like this line in setup.py is the cause of this issue: https://github.com/stefanfoulis/django-phonenumber-field/blob/master/setup.py#L8

Here are the Pipfile and Pipfile.lock:

[[source]]

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


[packages]

django-phonenumber-field = "*"


[dev-packages]
{
    "_meta": {
        "hash": {
            "sha256": "1d4c4482eaa30ae2c0c4f7a2391984c1572af4984fa202fd3b5bbfbe37f6f7ac"
        },
        "host-environment-markers": {
            "implementation_name": "cpython",
            "implementation_version": "3.6.4",
            "os_name": "posix",
            "platform_machine": "x86_64",
            "platform_python_implementation": "CPython",
            "platform_release": "15.6.0",
            "platform_system": "Darwin",
            "platform_version": "Darwin Kernel Version 15.6.0: Fri Feb 17 10:21:18 PST 2017; root:xnu-3248.60.11.4.1~1/RELEASE_X86_64",
            "python_full_version": "3.6.4",
            "python_version": "3.6",
            "sys_platform": "darwin"
        },
        "pipfile-spec": 6,
        "requires": {},
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "babel": {
            "hashes": [
                "sha256:ad209a68d7162c4cff4b29cdebe3dec4cef75492df501b0049a9433c96ce6f80",
                "sha256:8ce4cb6fdd4393edd323227cba3a077bceb2a6ce5201c902c65e730046f41f14"
            ],
            "version": "==2.5.3"
        },
        "django": {
            "hashes": [
                "sha256:52475f607c92035d4ac8fee284f56213065a4a6b25ed43f7e39df0e576e69e9f",
                "sha256:d96b804be412a5125a594023ec524a2010a6ffa4d408e5482ab6ff3cb97ec12f"
            ],
            "version": "==2.0.1"
        },
        "django-phonenumber-field": {
            "hashes": [
                "sha256:d96c274a6aa9afd4eb4fe922e475a45706d997b2bea22b87f3afc9fb0012db84"
            ],
            "version": "==2.0.0"
        },
        "pytz": {
            "hashes": [
                "sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48",
                "sha256:feb2365914948b8620347784b6b6da356f31c9d03560259070b2f30cff3d469d",
                "sha256:59707844a9825589878236ff2f4e0dc9958511b7ffaae94dc615da07d4a68d33",
                "sha256:d0ef5ef55ed3d37854320d4926b04a4cb42a2e88f71da9ddfdacfde8e364f027",
                "sha256:c41c62827ce9cafacd6f2f7018e4f83a6f1986e87bfd000b8cfbd4ab5da95f1a",
                "sha256:8cc90340159b5d7ced6f2ba77694d946fc975b09f1a51d93f3ce3bb399396f94",
                "sha256:dd2e4ca6ce3785c8dd342d1853dd9052b19290d5bf66060846e5dc6b8d6667f7",
                "sha256:699d18a2a56f19ee5698ab1123bbcc1d269d061996aeb1eda6d89248d3542b82",
                "sha256:fae4cffc040921b8a2d60c6cf0b5d662c1190fe54d718271db4eb17d44a185b7"
            ],
            "version": "==2017.3"
        }
    },
    "develop": {}
}
Describe your environment
  1. OS Type: macos
  2. Python version: 3.6.4
  3. Pipenv version: 9.0.1
Expected result

I expect that django-phonenumber-field and all its dependencies will be installed.

Actual result

phonenumberslite is not installed.

Steps to replicate
  1. pipenv install django-phonenumber-field
  2. pipenv run pip freeze, you will see something like:
Babel==2.5.3
Django==2.0.1
django-phonenumber-field==2.0.0
phonenumberslite==8.8.9
pytz==2017.3
  1. pipenv --rm (we simulate a situation when we have to use Pipfile for installing dependencies)
  2. pipenv install
  3. pipenv run pip freeze, you will see something like this:
Babel==2.5.3
Django==2.0.1
django-phonenumber-field==2.0.0
pytz==2017.3
@WhyNotHugo
Copy link
Contributor

Looks like there's some funny logic in setup.py.

If either phonenumbers or phonenumberslite are installed, then they are not listed as requirements. This kinda of falls into a loop if you try to think about whether it's required or not.

Maybe it's best to document that either of these are required, and leave it up to the developer to install whichever they prefer.

@pauloxnet
Copy link
Contributor

Similar issue using https://github.com/jazzband/pip-tools

@sobolevn
Copy link
Author

@pauloxnet because pipenv uses pip-tools internally.

@oza4h07
Copy link

oza4h07 commented Mar 19, 2018

Hi,

What happens if:
pipenv uninstall django-phonenumber-field
pipenv install phonenumbers
pipenv install django-phonenumber-field

Best regards

@alex-oleshkevich
Copy link

@oza4h07 , pipenv installs phonenumbers only if it in root deps.
pipenv install django-phonenumber-field does not include it.

@stefanfoulis
Copy link
Owner

Probably #211 fixes this issue. But I suspect that will upset people who want to use the lite version of the library. So maybe we should just remove the dependency and document the dependency and let the developer choose (like @WhyNotHugo suggested).

@Azd325
Copy link

Azd325 commented Aug 14, 2018

For me it installs also randomly phonenumbers-lite. phonenumbers only if it is defined in the Pipfile

@stefanfoulis
Copy link
Owner

This should be fixed now in 2.0.1. Please confirm.

@Azd325
Copy link

Azd325 commented Aug 20, 2018

For me it seems that the new version resolve this issue.

@stefanfoulis
Copy link
Owner

🎉 🦄

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

No branches or pull requests

7 participants