cenkalti / putio.py

A python wrapper for put.io APIv2
http://put.io
MIT License
72 stars 41 forks source link

putio.py 8.1.4 has a bad pip version #38

Closed DepthDeluxe closed 6 years ago

DepthDeluxe commented 6 years ago

It looks like the current version of putio.py, 8.1.4 has an invalid version. Likely due to the following code in setup.py. The version is now 0.

try:
    version = read('VERSION').strip()
except FileNotFoundError:
    version = '0'

Example after running pip install putio.py==8.1.4

(venv) ➜  putsync2 git:(master) ✗ pip install putio.py==8.1.4
Collecting putio.py==8.1.4
...
Successfully installed putio.py-0
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) ➜  putsync2 git:(master) ✗ pip show putio.py
Name: putio.py
Version: 0
Summary: Python client for put.io API v2
Home-page: https://github.com/cenk/putio.py
Author: Cenk Altı
Author-email: cenkalti@gmail.com
License: UNKNOWN
Location: /home/colin/Documents/putsync2/build/venv/lib/python3.6/site-packages
Requires: six, requests, tus.py
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) ➜  putsync2 git:(master) ✗

When installing the previous version, I see the valid version (pip install putio.py==8.1.0)

(venv) ➜  putsync2 git:(master) ✗ pip install putio.py==8.1.0
Collecting putio.py==8.1.0
...
Successfully installed putio.py-8.1.0
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) ➜  putsync2 git:(master) ✗ pip show putio.py
Name: putio.py
Version: 8.1.0
Summary: Python client for put.io API v2
Home-page: https://github.com/cenk/putio.py
Author: Cenk Altı
Author-email: cenkalti@gmail.com
License: UNKNOWN
Location: /home/colin/Documents/putsync2/build/venv/lib/python3.6/site-packages
Requires: requests, six, tus.py
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
DepthDeluxe commented 6 years ago

Perhaps the setup.py should throw an exception when that version value is missing?

DepthDeluxe commented 6 years ago

@cenkalti looks like you pushed a new version today.

cenkalti commented 6 years ago

Yesterday, I have automated uploading the package to PyPI via Travis. When Travis build is triggered, the package version is read from the git tag and written into VERSION file by Travis. See: https://github.com/cenkalti/putio.py/blob/f94e942884981979702b207431e1c22f65470f3d/.travis.yml#L6

However, I still want the package to be installed from sources other than PyPI. That's why I make it to fallback to 0 instead of raising exception. Do you have other suggestion to the problem?

0 seems to me like "development version". I think the correct way of downloading the package should be PyPI.

DepthDeluxe commented 6 years ago

I think before_deploy gets triggered after the package build. I think you want to use before_script instead which will trigger before your build script executes.

My guess is the file is getting written after your package build so it is using the 0 version.

I see what you mean about the dev version, that def makes sense. You can’t even test/develop the package otherwise. Another option could be trying to read the hash of the latest git commit so at least there is a unique version when you build.

On Tue, Mar 20, 2018 at 1:15 AM Cenk Altı notifications@github.com wrote:

Yesterday, I have automated uploading the package to PyPI via Travis. When Travis build is triggered, the package version is read from the git tag and written into VERSION file by Travis. See: https://github.com/cenkalti/putio.py/blob/f94e942884981979702b207431e1c22f65470f3d/.travis.yml#L6

However, I still want the package to be installed from sources other than PyPI. That's why I make it to fallback to 0 instead of raising exception. Do you have other suggestion to the problem?

0 seems to me like "development version". I think the correct way of downloading the package should be PyPI.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cenkalti/putio.py/issues/38#issuecomment-374510827, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwOCySoxXzzSAvxVrE_7wnD7dBYuu-iks5tgLqngaJpZM4SxKpK .

-- -- Colin

DepthDeluxe commented 6 years ago

If the environment variable is actually there, another option could be just directly referencing it in the setup.py

import os os.environ.get(‘TRAVIS_VERSION’, 0)

On Tue, Mar 20, 2018 at 7:10 AM Colin Heinzmann colin@heinzmann.me wrote:

I think before_deploy gets triggered after the package build. I think you want to use before_script instead which will trigger before your build script executes.

My guess is the file is getting written after your package build so it is using the 0 version.

I see what you mean about the dev version, that def makes sense. You can’t even test/develop the package otherwise. Another option could be trying to read the hash of the latest git commit so at least there is a unique version when you build.

On Tue, Mar 20, 2018 at 1:15 AM Cenk Altı notifications@github.com wrote:

Yesterday, I have automated uploading the package to PyPI via Travis. When Travis build is triggered, the package version is read from the git tag and written into VERSION file by Travis. See: https://github.com/cenkalti/putio.py/blob/f94e942884981979702b207431e1c22f65470f3d/.travis.yml#L6

However, I still want the package to be installed from sources other than PyPI. That's why I make it to fallback to 0 instead of raising exception. Do you have other suggestion to the problem?

0 seems to me like "development version". I think the correct way of downloading the package should be PyPI.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cenkalti/putio.py/issues/38#issuecomment-374510827, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwOCySoxXzzSAvxVrE_7wnD7dBYuu-iks5tgLqngaJpZM4SxKpK .

-- -- Colin

-- -- Colin

cenkalti commented 6 years ago

Oh, now I understand the problem. The VERSION file was not included in the package. Fixed in 2ca9c0dc8f0e998a705db734cd0dd6d6ba2071e1. Now, you should be able to install 8.1.5 from PyPI without any problem.

I am closing this issue. Feel free to write if you have questions.