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

package_data are not installed when installing pytzwhere with pip in a venv #45

Closed
seahawk1986 opened this issue Jul 25, 2017 · 5 comments

Comments

@seahawk1986
Copy link
Contributor

Hello,
when installing tzwhere in a venv with pip using Python 3.6 (or 3.5) both json files 'tz_world.json' and 'tz_world_shortcuts.json' are missing:

$ python3 -m venv test_pytzwhere
$ source test_pytzwhere/bin/activate
(test_pytzwhere) $ pip install tzwhere
(test_pytzwhere) $ tree test_pytzwhere/lib/python3.6/site-packages/tzwhere*
test_pytzwhere/lib/python3.6/site-packages/tzwhere
├── __init__.py
├── __pycache__
│   ├── __init__.cpython-36.pyc
│   └── tzwhere.cpython-36.pyc
└── tzwhere.py
test_pytzwhere/lib/python3.6/site-packages/tzwhere-3.0.1-py3.6.egg-info
├── PKG-INFO
├── SOURCES.txt
├── dependency_links.txt
├── installed-files.txt
├── requires.txt
└── top_level.txt

Removing the Line "include_package_data=True," from the setup.py (https://github.com/pegler/pytzwhere/blob/master/setup.py#L19) seems to fix the problem - is this needed by anything else?

@LowieHuyghe
Copy link

I'm having the same problem and would love to see it fixed!
Would it be possible to submit a pull request with your changes? Thanks in advance!

@seahawk1986
Copy link
Contributor Author

I dug a little deeper into the setuptools documentation (https://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=include_package_data#including-data-files) - the missing entries in the MANIFEST.in for those files seem to be the real cause for the missing files:

if using the setuptools-specific include_package_data argument, files specified by package_data will not be automatically added to the manifest unless they are listed in the MANIFEST.in file.

So including those files to the MANIFEST.in seems to be the better solution (the file tzwhere/tz_world.csv mentioned in MANIFEST.in has been removed in df871d2 )

#46 should fix the installation of those files.

linwoodc3 added a commit to linwoodc3/pytzwhere that referenced this issue Aug 14, 2017
…pegler#8.  Closes pegler#45. This is also an update to pegler#46 and @seahawks code to include the files on the MANIFEST file..
@pegler pegler closed this as completed in c7a9cc9 Aug 22, 2017
@pegler
Copy link
Owner

pegler commented Aug 22, 2017

Thanks @linwoodc3 and @seahawk1986 for the pull requests. I ended up using @linwoodc3's since it added compression. I just pushed version 3.0.2 to PyPI

@linwoodc3
Copy link
Contributor

linwoodc3 commented Aug 24, 2017

I'm an idiot. Careless mistake. I left the test name in the Manifest file.

This...

tzwhere/worldtest.json.gz

Needs to change to this...

include tzwhere/tz_world.json.gz

That's why the file is missing....

screen shot 2017-08-23 at 10 53 47 pm

@pegler
Copy link
Owner

pegler commented Aug 24, 2017

@linwoodc3 I just pushed v 3.0.3 with the fix

famanson pushed a commit to esplorio/pytzwhere that referenced this issue Mar 5, 2019
* 'master' of https://github.com/pegler/pytzwhere:
  Update README to include example for forceTZ
  add worldtest.json.gz to manifest.  bump version
  bump to 3.0.2
  Reduces size of module bt 1/3.  Achieves 94% code coverage, relating to pegler#8.  Closes pegler#45. This is also an update to pegler#46 and @seahawks code to include the files on the MANIFEST file..
  add json files to MANIFEST.in, remove obsolete .csv file
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

4 participants