Skip to content

Instantly share code, notes, and snippets.

@carlosmarin
Created May 12, 2018 00:51
Show Gist options
  • Save carlosmarin/5837aa41a8091d6c5ab93942cd4ed22e to your computer and use it in GitHub Desktop.
Save carlosmarin/5837aa41a8091d6c5ab93942cd4ed22e to your computer and use it in GitHub Desktop.
virtualenv -p /usr/local/bin/python2.7 pip2pi-venv
source pip2pi-venv/bin/activate
# pip install pip2pi # broken support for pip v10.x
wget https://github.com/carlosmarin/pip2pi/archive/pip-10.0.0.zip -O pip2pi-v10.0.0.zip
unzip -a pip2pi-v10.0.0.zip
python pip2pi-pip-10.0.0/setup.py install
rm -f pip2pi-v10.0.0.zip
rm -fr pip2pi-pip-10.0.0
# packages test
echo 'bson
pymongo==2.3
Flask==0.10.1
Jinja2==2.6
Werkzeug==0.8.3
wsgiref==0.1.2
python-dateutil==1.5' > requirements.txt
mkdir pypi-local-repository
pip2pi pypi-local-repository -r requirements.txt
#-------------------------------------------------------------------------
#link or place pypi-local-repository folder in Apache www root
#-------------------------------------------------------------------------
# test
pip2pi pypi-local-repository requests
pip install requests --index-url=http://localhost:8080/pypi-local-repository/simple/ --trusted-host=localhost
pip install requests==2.18.3 --index-url=http://localhost:8080/pypi-local-repository/simple/ --trusted-host=localhost
pip2pi pypi-local-repository requests==2.18.3
#-------------------------------------------------------------------------
<VirtualHost *:443>
ServerName pypi.myserver.com
DocumentRoot /data/www/pypi.myserver.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/pypi.myserver.com.pem
SSLCertificateKeyFile /etc/apache2/ssl/pypi.myserver.com.key
<Directory /data/www/pypi.myserver.com/>
AllowOverride None
Options +Indexes
IndexOptions SuppressColumnSorting
IndexIgnore ..
Order deny,allow
Allow from all
</Directory>
LogLevel warn
ErrorLog /var/log/apache2/pypi-error.log
CustomLog /var/log/apache2/pypi-access.log combined
</VirtualHost>
#-------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment