From 9ca74397b46abd3a8b6278015a2889eb49746493 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 6 May 2020 17:24:18 -0600 Subject: [PATCH] Adding setup for pip packaging --- .gitignore | 5 +++++ .travis.yml | 2 +- Dockerfile | 4 ++-- MANIFEST.in | 3 +++ setup.py | 25 +++++++++++++++++++++++++ run => whoogle-search | 4 ++-- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 MANIFEST.in create mode 100644 setup.py rename run => whoogle-search (87%) diff --git a/.gitignore b/.gitignore index 3c4f674..20747c7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ __pycache__/ *.pem config.json test/static + +# pip stuff +build/ +dist/ +*.egg-info/ diff --git a/.travis.yml b/.travis.yml index 3775cce..8695c53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ before_install: install: - pip install -r requirements.txt script: - - ./run test + - ./whoogle-search test diff --git a/Dockerfile b/Dockerfile index 46f11f5..546eede 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,6 @@ WORKDIR /usr/src/app COPY . . RUN pip install --no-cache-dir -r requirements.txt -RUN chmod +x ./run +RUN chmod +x ./whoogle-search -CMD ["./run"] +CMD ["./whoogle-search"] diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3c53610 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +graft app/static +graft app/templates +global-exclude *.pyc diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3c70d98 --- /dev/null +++ b/setup.py @@ -0,0 +1,25 @@ +import setuptools + +long_description = open('README.md', 'r').read() + +requirements = list(open('requirements.txt', 'r')) + +setuptools.setup( + author='Ben Busby', + author_email='benbusby@protonmail.com', + name='whoogle-search', + version='0.1.0', + scripts=['whoogle-search'], + include_package_data=True, + install_requires=requirements, + description='Self-hosted, ad-free, privacy-respecting alternative to Google search', + long_description=long_description, + long_description_content_type='text/markdown', + url='https://github.com/benbusby/whoogle-search', + packages=setuptools.find_packages(), + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + ], +) diff --git a/run b/whoogle-search similarity index 87% rename from run rename to whoogle-search index e878ca4..65bf823 100755 --- a/run +++ b/whoogle-search @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# ./run # Runs the full web app -# ./run test # Runs the testing suite +# ./whoogle-search # Runs the full web app +# ./whoogle-search test # Runs the testing suite SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"