lionheart / python-harvest

A Python wrapper for the Harvest time-tracking API.
Apache License 2.0
55 stars 49 forks source link

pip? #2

Closed finoptimal-dev closed 9 years ago

finoptimal-dev commented 10 years ago

Sorry I'm still kind of new to Python. Is there a pip install command available for this module? I tried Harvest-Time-Tracking-API-Client, which is what shows up upon "pip search harvest", but it didn't work.

Thanks!

olange commented 9 years ago

Hello. I encountered the same problem:

$ pip install Harvest-Time-Tracking-API-Client
Downloading/unpacking Harvest-Time-Tracking-API-Client
  Could not find any downloads that satisfy the requirement Harvest-Time-Tracking-API-Client
  Some externally hosted files were ignored (use --allow-external Harvest-Time-Tracking-API-Client to allow).
Cleaning up...
No distributions at all found for Harvest-Time-Tracking-API-Client

As a workaround, I included a carbon copy of harvest/harvest.py in my sources. But it is a rather desperate workaround. It would be nice if it could be retrieved with pip install Harvest-Time-Tracking-API-Client.

olange commented 9 years ago

By the way, adding the --allow-external Harvest-Time-Tracking-API-Client and --allow-unverified Harvest-Time-Tracking-API-Client Harvest-Time-Tracking-API-Client options does not help either:

$ pip install --allow-external Harvest-Time-Tracking-API-Client --allow-unverified Harvest-Time-Tracking-API-Client Harvest-Time-Tracking-API-Client
Downloading/unpacking Harvest-Time-Tracking-API-Client
  Could not find any downloads that satisfy the requirement Harvest-Time-Tracking-API-Client
Cleaning up...
No distributions at all found for Harvest-Time-Tracking-API-Client
Storing debug log for failure in ~/.pip/pip.log
olange commented 9 years ago

Looking at ~/.pip/pip.log, I found these interesting messages:

…
Could not parse version from link: https://github.com/lionheart/python-harvest/archive/master.zip (from https://github.com/lionheart/python-harvest)
Skipping link https://github.com/lionheart/python-harvest/archive/master.zip (from https://github.com/lionheart/python-harvest); wrong project name (not harvest-time-tracking-api-client)
…

I've never submitted a package to PyPI, but I would guess that changing the name attribute in the setup.py file from Harvest Time Tracking API Client to harvest-time-tracking-api-client might fix this issue:

…
setup(
    name='harvest-time-tracking-api-client',
    …

Optionally, creating a tag named 1.0.1 (that matches the version number found in the VERSION file) would also remove the warning «Could not parse version from link»:

python-harvest (master) $ git tag 1.0.1 -m "Adding tag 1.0.1 for upload on PyPI."
python-harvest (master) $ git push --tags origin master

HTH

olange commented 9 years ago

Sorry, I forgot to mention: I'm using Mac OS X 10.10.1 (Yosemite), Python 2.7.6 and the latest python-harvest (as of commit 74f8875b64017c23748037846cdbb7c8e05a1af9).

dlo commented 9 years ago

cc/ @gxela