What are valid values for platforms in python setup.py?
<p>The official documentation <a href="http://docs.python.org/2/distutils/apiref.html" rel="nofollow">mentions this parameter</a> but says nothing about possible values.</p>

<p>Is it necessary to use <code>Operating System</code> key in <code>classifiers</code> ?</p>

<p>Well its not needed every time. But if you are doing something w.r.t platform and you don't intend to support all platforms in your program, then you need to base your program on platform.</p>

<p>Following are the os names that are currently registered in python</p>

<pre><code>'posix', 'nt', 'os2', 'ce', 'java', 'riscos'
</code></pre>

<p>sys.builtin_module_names will list all the platforms that your python version supports. Again it will bring the modules based on your platform during installation.</p>

<p>you can base your program based on os.name</p>

<pre><code>if os.name == 'nt':
    # do something for Windows
elif os.name == 'posix':
    # do something for all Linux and Mac platforms
elif os.name == 'os2':
    # do something
elif os.name == 'ce':
    # do something
elif os.name == 'java':
    # do something for java based platforms
elif os.name == 'riscos':
    # do something
</code></pre>

python distutils