Skip to content

Instantly share code, notes, and snippets.

@thiagopbueno
Last active May 24, 2023 04:58
Show Gist options
  • Save thiagopbueno/e14a91ae71843bf3e6d8e40c7e5205d3 to your computer and use it in GitHub Desktop.
Save thiagopbueno/e14a91ae71843bf3e6d8e40c7e5205d3 to your computer and use it in GitHub Desktop.
Setuptools template for open-source Python projects.
import os
from setuptools import setup, find_packages
def read(filename):
filepath = os.path.join(os.path.dirname(__file__), filename)
file = open(filepath, 'r')
return file.read()
setup(
name='',
version='',
author='Thiago P. Bueno',
author_email='[email protected]',
description='',
long_description=read('README.md'),
long_description_content_type="text/markdown",
license='GNU General Public License v3.0',
keywords=[],
url='',
packages=find_packages(),
scripts=[],
install_requires=[],
include_package_data=True,
zip_safe=False,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Artificial Intelligence'
],
)

Setuptools commands cheatsheet

Getting help

$ python3 setup.py --help
$ python3 setup.py --help-commands

Installing a package in development mode (locally)

$ python3 setup.py develop

Building and installing a package (globally)

$ python3 setup.py build install

Create a source distribution and upload

$ python3 setup.py sdist
$ twine upload dist/*.py

Cleaning temporary files

$ python3 setup.py clean

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment