Last active
August 8, 2017 15:51
-
-
Save yogeek/50ee56528015475f5c2143d69933e4f3 to your computer and use it in GitHub Desktop.
Python module management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pypi configuration file : ~/.pypirc | |
``` | |
[distutils] | |
index-servers = | |
nexus | |
[nexus] | |
repository = http://<NEXUS_URL>/repository/<PYTHON_REPOSITORY_NAME>/ | |
username = ******* | |
password = ******* | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install --user <MODULE_NAME> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project | |
# Go to the module directory (setup.py file must be there) | |
cd <MODULE_SETUP_DIR> | |
# sdist : create a source distribution | |
python setup.py sdist | |
# bdist_wheel : create a binary distribution | |
# Prerequisite : pip install wheel | |
python setup.py bdist_wheel --universal | |
# The resulting files are in ./dist directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip configuration file : ~/.pip/pip.conf | |
[global] | |
extra-index-url = http://<USERNAME>:<PASSWORD>@<NEXUS_URL>/repository/<PYTHON_REPOSITORY_NAME>/simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi | |
# Go to the module directory (setup.py file must be there) | |
cd $MODULE_SETUP_DIR | |
# twine | |
# Prerequisite : pip install --user twine | |
twine upload -r nexus dist/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment