More Related Content Similar to Python eggs (RO) (20) More from Alin Voinea (16) Python eggs (RO)2. Cuprins
● Index egg-uri Python
● Structura unui egg Python
● Utilitare şi şabloane pentru crearea unui egg
● Distribuirea unui egg
● Automatizare
● Proxy eggs server / PyPI mirror
● Custom / Private eggs server
3. 1. Python Package Index (pypi)
“O metoda* mai simpla de a distribui şi instala
un pachet python”
pypi.python.org
*similar cu RPM, DEB, APK, IPK, etc
4. 1. Python Package Index (pypi)
$ pip* install helloworld
$ pip* install http://eggrepo.com/helloworld
*easy_install
7. 3.1 ZopeSkel
$ pip install zopeskel
$ zopeskel --list-templates
$ zopeskel basic_namespace
8. 3.1 Custom ZopeSkel templates
$ pip install eea.package
$ zopeskel --list-templates
$ zopeskel eea
9. 4. Distribuirea unui egg python
● Direct Install
$ python setup.py install
● Upload PyPI
$ python setup.py register -r pypi
$ python setup.py sdist upload
$ pip install hello.world
10. 4.1 setup.py
$ vim setup.py
from setuptools import setup
setup(
name=”hello.world”,
version=”1.0”,
…
)
11. 4.1 setup.py
● Metadata:
○ https://docs.python.org/3/distutils/setupscript.html#meta-data
● Classifiers:
○ https://pypi.python.org/pypi?%3Aaction=list_classifiers
15. 5.2 jarn.mkrelease
“Python egg releaser”
$ pip install jarn.mkrelease
$ vim /home/user/.mkrelease
[defaults]
distdefault = eea
[aliases]
all =
pypi
plone
$ mkrelease -d all hello.world
16. 5.3 eea.eggmonkey
“Automate releasing eggs with jarn.mkrelease”
$ vim buildout.cfg
[buildout]
extensions +=
mr.developer
eea.eggmonkey
$ bin/monkey -d eea hello.world
$ bin/print_unreleased_packages
18. 7. Custom eggs server
“ClueReleaseManager”
$ vim buildout.cfg
[buildout]
find-links = http://eggrepo.eea.europa.eu/simple
$ python setup.py register -r http://eggrepo.eea.europa.eu
19. 8. Legături externe
● http://taskman.eionet.europa.eu/projects/zope/wiki/WebDevelopmentCycle
● http://taskman.eionet.europa.eu/projects/zope/wiki/HowToReleaseAnEgg
● http://taskman.eionet.europa.eu/projects/zope/wiki/Eggmonkey
● https://docs.python.org/3.1/distutils/uploading.html
● http://mrtopf.de/blog/en/a-small-introduction-to-python-eggs/
● https://docs.python.org/3/distutils/packageindex.html
● https://docs.python.org/3/distutils/setupscript.html#meta-data
● https://pypi.python.org/pypi?%3Aaction=list_classifiers
● https://docs.python.org/3/distutils/packageindex.html#pypirc
● https://pypi.python.org/pypi/zest.releaser
● https://pypi.python.org/pypi/jarn.mkrelease
● https://pypi.python.org/pypi/eea.eggmonkey
● https://pypi.python.org/pypi/collective.eggproxy
● https://pypi.python.org/pypi/ClueReleaseManager
● http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install