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

Provide copies of our pypi/npmjs published versions #139

Open
kelson42 opened this issue Jun 16, 2020 · 4 comments
Open

Provide copies of our pypi/npmjs published versions #139

kelson42 opened this issue Jun 16, 2020 · 4 comments

Comments

@kelson42
Copy link
Contributor

on download.kiwix.org and download.openzim.org

@kelson42
Copy link
Contributor Author

@rgaudin For Pypi, what do you think about that?

$ cat versions.py 
#!/usr/bin/env python3

import sys    
import requests
from pkg_resources import parse_version    

def versions(pkg_name):
    url = f'https://pypi.python.org/pypi/{pkg_name}/json'
    releases = requests.get(url).json()['releases']
    return sorted(releases, key=parse_version, reverse=True)    

if __name__ == '__main__':
    print(*versions(sys.argv[1]), sep='\n')
$ for V in `python3 versions.py libzim` ; do pip3 download libzim==$V ; done
Collecting libzim==0.0.2
  File was already downloaded /tmp/test/libzim-0.0.2-cp38-cp38-manylinux1_x86_64.whl
Successfully downloaded libzim
Collecting libzim==0.0.1
  File was already downloaded /tmp/test/libzim-0.0.1.tar.gz
Successfully downloaded libzim
$ ls -la
total 12304
drwxrwxr-x  2 kelson kelson    4096 Jun 16 20:25 .
drwxrwxrwt 73 root   root   4968448 Jun 16 20:26 ..
-rw-rw-r--  1 kelson kelson    1438 Jun 16 20:25 libzim-0.0.1.tar.gz
-rw-rw-r--  1 kelson kelson 7614324 Jun 16 20:25 libzim-0.0.2-cp38-cp38-manylinux1_x86_64.whl
-rw-rw-r--  1 kelson kelson     371 Jun 16 20:24 versions.py

@kelson42
Copy link
Contributor Author

For npmjs.org, https://www.npmjs.com/package/npm-package-downloader seems to do the job, but we have quite a mess with dev versions. We need to clean-up

@rgaudin
Copy link
Member

rgaudin commented Jun 16, 2020

Would help to understand the reasoning behind this. I can hardly see the value of this:

  • Pypi is a free platform
  • It is quite reliable. I must have been bugged by a Pypi downtime 3 times in the last 15+years.
  • If Pypi is down, our tools will be affected anyway as we are tied to many dependencies
  • If Pypi disapears, we could recreate the packages from the repo.

So it could be useful to archive old version in case Pypi disapears… that sounds too speculative to invest time in seting-up and maintaining this. But I may have missed the use case.

@stale
Copy link

stale bot commented Aug 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants