provide setup.py
zink-chimaera opened this issue · 2 comments
zink-chimaera commented
For automatic installation and requirement management a setup.py would be a nice enhancement for people not that familiar with python or that can't (or just won't) RTFM. ¯_(ツ)_/¯
MayeulC commented
I've never used those; I'll look into it. Is that a prerequisite for pypi?
zink-chimaera commented
I've never published a package on pypi but as far as I know, yes [1]. This enables installing your code into your interpreter, i.e. via pip.
Here is an untested MWE. If you'd like to test it, just add it as setup.py to $project_folder and install it via
pip install -e $project_folder
-e leaves a reference to your folder so you can still edit your code without needing to reinstall
setup.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
from setuptools import setup, find_packages
def read(file_name):
return open(os.path.join(os.path.dirname(__file__), file_name)).read()
setup(
name="humble_downloader", # your package name (i.e. for import)
version="1.33.7",
maintainer="Mayeul Cantan",
maintainer_email="your@mail.org",
author="Brian Schkerke, Mayeul Cantan",
author_email="N/A, your@mail.org"
description="An automated utility to download your Humble Bundle purchases.",
license="MIT",
keywords="humble bundle download games",
url="https://github.com/MayeulC/hb-downloader",
packages=find_packages(exclude=["*test*", "*TEST*"]),
install_requires=[
'requests',
'pyyaml',
],
long_description=read('README.md'),
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
"Natural Language :: English"
],
zip_safe=True,
)
[1] https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/