Python : faire un package
Par pepin le samedi, décembre 26 2020, 19:35 - Python - Lien permanent
Pour faire un package python, il faut créer un fichier setup.py :
import setuptools setuptools.setup( name="simplanimator", # Replace with your own username version="0.0.2", author="Me First Name Last Name", author_email="me@tlc.com", description="SimplAnimator, a class to animate graph based on mathplotlib", url="", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], python_requires='>=3.6', )
Et nous mettons notre package dans un dossier "simplanimator" juste au même niveau que le "setup.py".
Nous pouvons ensuite installer le package avec :
sudo python3 setup.py install
ou pour une installation mono utilisateur :
python3 setup.py install --user