kiwix / container-images

10 stars 4 forks source link

Provide copies of our pypi/npmjs published versions #139

Open kelson42 opened 4 years ago

kelson42 commented 4 years ago

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

kelson42 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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

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[bot] commented 4 years ago

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.