Skip to content

Commit

Permalink
Renamed main file and created setup.py
Browse files Browse the repository at this point in the history
renamed lowercase slimhttp to slimHTTP to better reflect the projects name, also to make it a bit clearer what you're importing. Added a __init__ to be able to import this folder as-is when git cloning and use it the same way as after doing pip install.
  • Loading branch information
Torxed committed Jul 12, 2020
1 parent 20fa540 commit e0ce19f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**/*__pycache__
**/*_build
**/**__pycache__
**/**dist
**/**build
**/**egg-info
**/**slimHTTP
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .slimHTTP import *
38 changes: 38 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import setuptools, glob, os, shutil

with open("README.md", "r") as fh:
long_description = fh.read()

## Build steps (prerequisits)
# TODO: Perhaps not rename it core.py when copying in the lib?
# Probably doesn't matter to much, but looks odd.
# Can we re-use the __init__.py from main repo?
if not os.path.isdir('slimHTTP'):
os.makedirs('./slimHTTP')
if not os.path.isfile('./slimHTTP/core.py'):
shutil.copy2('./slimHTTP.py', './slimHTTP/core.py')
if not os.path.isfile('./slimHTTP/__init__.py'):
with open('./slimHTTP/__init__.py', 'w') as __init__:
__init__.write('from .core import *\n')
if not os.path.isdir('./slimHTTP/examples'):
shutil.copytree('./examples', './slimHTTP/examples')

setuptools.setup(
name="slimHTTP",
version="1.0.1rc3",
author="Anton Hvornum",
author_email="anton@hvornum.se",
description="A minimalistic non-threaded HTTP server written in Python. Supports REST & WebSockets¹.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Torxed/slimHTTP",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX",
"Operating System :: Microsoft",
],
python_requires='>=3.8',
package_data={'slimHTTP': glob.glob('examples/*.py')},
)
File renamed without changes.

0 comments on commit e0ce19f

Please sign in to comment.