If I'm going to create a python package, I'll define a setup.py
file that has something like this:
from setuptools import setup
setup(name='funniest',
version='0.1',
description='The funniest joke in the world',
url='http://github.com/storborg/funniest',
author='Flying Circus',
author_email='[email protected]',
license='MIT',
packages=['funniest'],
install_requires=[
'markdown',
],
zip_safe=False)
Is there a rule of good practice on how to refer to packages declared as dependencies in the code?
For example in a file in my package, I should use import markdown
in the beginning.
Or, when using a function from the package markdown
I should use markdown.x()
.
I will explain the motivation of the question. In% with%% of% is R
however this function has side-effects (it loads all functions for the user's global environment) and should not be used within packages. In import
I do not know how it is, so I'm asked. (Read this before voting to close)