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

Pipenv install doesn't copy data defined in package_data (setup.py) #2697

Closed
santiagobasulto opened this issue Aug 2, 2018 · 5 comments
Closed
Labels
OS: Windows This issue affects the Windows Operating System. Type: Possible Bug This issue describes a possible bug in pipenv.

Comments

@santiagobasulto
Copy link

santiagobasulto commented Aug 2, 2018

Issue description

Hello folks, I created a simple package for demonstration purposes and included some data with the package_data directive (in my setup.py). The package was working fine both on linux and Mac, but wasn't copying over the data files on Windows. I fixed it by including a MAINFEST.in file and an __init__.py file in my directory. But the standard solution wasn't working fine.

Here's the code: https://github.com/santiagobasulto/party-parrot/tree/0.0.2

I've fixed my command in 0.0.3 with the above mentioned hack, so use 0.0.2 for testing.

Expected result

To copy the data and work well like in Linux and Mac.

Actual result

Data files were not copied.

Steps to replicate

Using windows:

$ pipenv install party-parrot==0.0.2  # this version is the one with issues
$ pipenv shell
$ party

(this works with party-parrot@0.0.3 but not with party-parrot@0.0.2.

@uranusjr
Copy link
Member

uranusjr commented Aug 3, 2018

Hmm, this seems to work for me. There is an ugly exception when I try to end the program, but that seems unrelated?

Screencast (GIF): https://d.pr/i/nj8Lh2

What is the versions of Python, pip, and setuptools you use? I suspect pypa/sampleproject#30 could be related too. I would also second the suggestion mentioned in the issue—use MANIFEST.in instead. The design of package_data is very very broken.

@santiagobasulto
Copy link
Author

But you're on a Mac right? The issue is only on Windows. Both mac and linux work well.

@uranusjr
Copy link
Member

uranusjr commented Aug 3, 2018

Oh, yes, sorry I missed the OS-dependant part. That would be very strange though… Pipenv delegates the installation part completely to pip, and since all operating systems are (should be) using the same artifacts (the wheel) in this case, it would be very surprising if that fails only on Windows, given how mature pip is. I will try to investigate when I have access to a Windows machine, but I highly suspect something other than Pipenv is causing the problem.

@uranusjr uranusjr added Type: Possible Bug This issue describes a possible bug in pipenv. OS: Windows This issue affects the Windows Operating System. labels Aug 3, 2018
@santiagobasulto
Copy link
Author

I just tried installing it with pip directly and it did work on Windows. There's a bug on my code that makes the command fail, but the data files are indeed copied correctly.

@techalchemy
Copy link
Member

I actually didn't have any trouble installing this with pipenv on windows:

PS C:\Users\Dan.Ryan\git\tmp> pipenv install party-parrot==0.0.2
Creating a virtualenv for this project…
Pipfile: C:\Users\Dan.Ryan\git\tmp\Pipfile
Using c:\program files\python37\python.exe (3.7.0) to create virtualenv…
Already using interpreter c:\program files\python37\python.exe
Using base prefix 'c:\\program files\\python37'
New python executable in C:\Users\Dan.Ryan\.virtualenvs\tmp-c5yu54up\Scripts\python.exe
Installing setuptools, pip, wheel...done.

Virtualenv location: C:\Users\Dan.Ryan\.virtualenvs\tmp-c5yu54up
Creating a Pipfile for this project…
Installing party-parrot==0.0.2…
Collecting party-parrot==0.0.2
  Downloading https://files.pythonhosted.org/packages/92/9e/fc9197728152c5894daa303a4e696d7a83ea5c32a6bbe0e00ab381b0cf83/party_parrot-0.0.2-py2.py3-none-any.whl
Collecting asciimatics==1.9.0 (from party-parrot==0.0.2)
  Downloading https://files.pythonhosted.org/packages/e6/7a/2f4d3f52471345394e6446ac22a347cd5286a3d68c5afe34d4b0a6993191/asciimatics-1.9.0-py2.py3-none-any.whl (82kB)
Collecting Pillow>=2.7.0 (from asciimatics==1.9.0->party-parrot==0.0.2)
  Downloading https://files.pythonhosted.org/packages/39/a5/4258f77ab40d71bf7d724002a0bb166a902cb4cbdff7b866b1c3d9014547/Pillow-5.2.0-cp37-cp37m-win_amd64.whl (1.6MB)
Collecting future (from asciimatics==1.9.0->party-parrot==0.0.2)
Collecting wcwidth (from asciimatics==1.9.0->party-parrot==0.0.2)
  Using cached https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
Collecting pypiwin32; sys_platform == "win32" (from asciimatics==1.9.0->party-parrot==0.0.2)
  Downloading https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Collecting pyfiglet>=0.7.2 (from asciimatics==1.9.0->party-parrot==0.0.2)
  Downloading https://files.pythonhosted.org/packages/a2/65/4e29896298591d748f5ce4e96642b8a0a876b64ed7226b5ae65fae81e5c9/pyfiglet-0.7.5.tar.gz (767kB)
Collecting pywin32>=223 (from pypiwin32; sys_platform == "win32"->asciimatics==1.9.0->party-parrot==0.0.2)
  Using cached https://files.pythonhosted.org/packages/f4/fb/ba9e519d90b63090005bcdee900d318d895d475c627dc1bc0f77b27abad0/pywin32-223-cp37-cp37m-win_amd64.whl
Building wheels for collected packages: pyfiglet
  Running setup.py bdist_wheel for pyfiglet: started
  Running setup.py bdist_wheel for pyfiglet: finished with status 'done'
  Stored in directory: C:/Users/Dan.Ryan/AppData/Local/pipenv/pipenv/Cache\wheels\80\31\20\3a9bf5ea4f00490abc4dbb439258de6be793871f0969035530
Successfully built pyfiglet
Installing collected packages: Pillow, future, wcwidth, pywin32, pypiwin32, pyfiglet, asciimatics, party-parrot
Successfully installed Pillow-5.2.0 asciimatics-1.9.0 future-0.16.0 party-parrot-0.0.2 pyfiglet-0.7.5 pypiwin32-223 pywin32-223 wcwidth-0.1.7

Adding party-parrot==0.0.2 to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (2d7ba9)!
Installing dependencies from Pipfile.lock (2d7ba9)…
  ================================ 8/8 - 00:00:01
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
PS C:\Users\Dan.Ryan\git\tmp>

And the command itself works for me too:

image

It did take some time to install but I can't replicate this, and either way I don't see what we can really do to address it on our end (we just invoke pip, we don't handle any of this ourselves). There might be some improvements in the next release. Closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Windows This issue affects the Windows Operating System. Type: Possible Bug This issue describes a possible bug in pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants