| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Python base egg with developer environment
The setup script is the centre of all activity in building, distributing, and installing modules using the Distutils or enchanted version- setuptools. We will use setuptools couse it is better.
Setuptools example:
from setuptools import setup, find_packages
setup(
name='myegg',
version='1.0.0',
install_requires=[
],
packages=find_packages(exclude=['tests']),
entry_points={
'console_scripts': [
'myegg = myegg.commands:run'
]
},
test_suite='tests'
)Python egg has a great Unit tests support. It will automaticaly find and run tests from tests package.
./test.shpython setup.py testYou can install your egg localy in developer mode. Then you will be able to frequently edit your code and not have to re-install your package to run it.
Installation requiries virtualenv (virtualenv is a tool to create isolated Python environments):
pip install virtualenv./install.shvirtualenv -p python
bin/python setup.py developNot you can use bin scripts from entry_points:
bin/myapp'HELLO WORLD'
The .egg file is a distribution format for Python packages. It’s just an alternative to a source code distribution or Windows exe. But note that for pure Python, the egg file is completely cross-platform.
./build.shpython setup.py bdist_eggYou fill find you .egg in dist directory: dist/myegg-1.0.0-py2.7.egg
For bash script to use python 3 change python.txt content to python3
| Back | FazBrowse Home | New Git URL |