To make a python package, in setup.py
, I have the following:
setup( name='TowelStuff', version='0.1.0', author='J. Random Hacker', author_email='[email protected]', packages=['towelstuff', 'towelstuff.test'], scripts=['bin/stowe-towels.py','bin/wash-towels.py'], url='http://pypi.python.org/pypi/TowelStuff/', license='LICENSE.txt', description='Useful towel-related stuff.', long_description=open('README.txt').read(), install_requires=[ "Django >= 1.1.1", "caldav == 0.1.4", ], )
So I remade that with my own package description and information. When I build it though I get the following warning:
distutils/dist.py:267: UserWarning: Unknown distribution option:
Does install_requires
work only on certain versions?
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
The setup.py file may be the most significant file that should be placed at the root of the Python project directory. It primarily serves two purposes: It includes choices and metadata about the program, such as the package name, version, author, license, minimal dependencies, entry points, data files, and so on.
There are two ways to specify dependencies for Cloud Functions written in Python: using the pip package manager's requirements. txt file or packaging local dependencies alongside your function. Dependency specification using the Pipfile/Pipfile.
If your package is developed only by yourself (i.e. on a single machine) but you are planning to redistribute it, then setup.py / setup. cfg should be enough. If you package is developed on multiple machines and you also need to redistribute it, you will need both the requirements. txt and setup.py / setup.
You need to be using setuptools instead of distutils.
Near the top of your script, try replacing
from distutils.core import setup
with
from setuptools import setup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With