Coder Social home page Coder Social logo

mmorys / pyenv-mirror Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huntzhan/pyenv-mirror

0.0 0.0 0.0 6.87 MB

Help building a pyenv local mirror! (NOT MAINTAIN ANYMORE)

Shell 17.02% JavaScript 0.15% Python 24.41% CSS 45.71% HTML 10.92% Roff 1.79%

pyenv-mirror's Introduction

Introduction

Help building a pyenv local mirror!

Install

pip install pyenv-mirror

Usage

$ pyenv-mirror --help                                                                
Usage:
    pyenv-mirror create-mirror
    pyenv-mirror download-package <pkg-name> [<python-build-path>]

create-mirror

$ ls
$ pyenv-mirror create-mirror
$ ls
pyenv-local-mirror

Create a directory named pyenv-local-mirror in current working directory. The structure of pyenv-local-mirror is almost identical to yyuu/yyuu.github.com, except that all the so-called "packages" located in pyenv-local-mirror/pythons were removed.

download-package

pyenv-mirror download-package downloads all related files of a package to current working directory. pyenv-mirror download-package <pkg-name> [<python-build-path>]:

  • <pkg-name>, same as the arguement following pyenv install.
  • <python-build-path>, the path of python-build directory. If you installed pyenv through homebrew, you might need to pass the path of above directory explicitly. If omitted, the path is default to $PYENV_ROOT/plugins/python-build/share/python-build.
$ pyenv-mirror download-package 2.7 '/usr/local/Cellar/pyenv/20160310/plugins/python-build/share/python-build'
Downloading https://www.openssl.org/source/openssl-1.0.2g.tar.gz#b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33
Downloading http://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43
Downloading http://www.python.org/ftp/python/2.7/Python-2.7.tgz#5670dd6c0c93b0b529781d070852f7b51ce6855615b16afcd318341af2910fb5
$ ls
Python-2.7.tgz        openssl-1.0.2g.tar.gz readline-6.3.tar.gz

Start The Mirror

  1. cd pyenv-local-mirror.
  2. Define your PYTHON_BUILD_MIRROR_URL in ./pythons/install-pyenv.sh.
  3. Customize HTTP port by changing PORT of ./pythons/run-http-server.sh. By default, PORT equals to 8999.
  4. Execute script ./pythons/run-http-server.sh.

Update Pyenv Index Page

  1. cd pyenv-local-mirror/pythons.
  2. Download Different Pythons (e.g. 2.7.x, 3.5.x) into source dir.
  3. Exec bash update.sh
  4. Open /pythons/index.html to see available Pythons info.

Install And Bind pyenv To Local Mirror

$ wget -O - '<your PYTHON_BUILD_MIRROR_URL>/scripts/install-pyenv.sh' | bash

Above command would install pyenv to $PYENV_ROOT. If omitted, $PYENV_ROOT defaults to ~/.pyenv.

After that, add

export PYTHON_BUILD_MIRROR_URL=$<your PYTHON_BUILD_MIRROR_URL>/pythons

to your configuration file so that pyenv could download the packages from your local mirror.

Incremental Update on Python Versions

When you need to install a new Python into your local Pyenv, e.g., 2.7.11, usually, you can do as following:

pyenv install 2.7.11

However, as newer Pythons come into being, local Pyenv does have the index to download them. Therefore, a safer way to install Pythons for local Pyenv would be like:

  1. Download index of needed version, e.g., 2.7.13, from here into a directory, say xxx_dir
  2. cd xxx_dir
  3. pyenv install 2.7.13
  4. rm the index file, 2.7.13

pyenv-mirror's People

Contributors

guangyi-z avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.