Skip to content

Commit

Permalink
Merge pull request #23 from praise-internet/fix-setup-wheel
Browse files Browse the repository at this point in the history
Fix setup wheel
  • Loading branch information
mborho authored Jul 11, 2018
2 parents 9e3ff45 + 1ea8233 commit 36b816c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion metadoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__copyright__ = 'Copyright 2016, Paul Solbach'
__author__ = 'Paul Solbach'
__license__ = 'MIT'
__version__ = '0.9.0'
__version__ = '0.9.1'

import asyncio
import time
Expand Down
24 changes: 19 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from subprocess import call
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
from setuptools.command.sdist import sdist as _sdist
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel

with open('./README.md') as f:
long_description = f.read()

requirements_txt = open("./requirements.txt").read()
main_py = open('metadoc/__init__.py').read()
Expand All @@ -23,17 +27,27 @@ def run(self):
self.execute(_post_install, (), msg="Installing nltk sets!")
_install.run(self)

class CustomInstall(_install):
class CustomInstall(_sdist):

def run(self):
call(["pip install -r ./requirements.txt --no-clean"], shell=True)
self.execute(_post_install, (), msg="Installing nltk sets!")
_install.run(self)
_sdist.run(self)


class BdistEggInstall(_bdist_wheel):

def run(self):
call(["pip install -r ./requirements.txt --no-clean"], shell=True)
self.execute(_post_install, (), msg="Installing nltk sets!")
_bdist_wheel.run(self)

setup(
name='metadoc',
version=metadata["version"],
description="Post-truth era news article metadata service.",
long_description="",
long_description=long_description,
long_description_content_type='text/markdown',
classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Programming Language :: Python :: 3.5",
"Topic :: Internet :: WWW/HTTP",
Expand All @@ -46,9 +60,9 @@ def run(self):
keywords=["scraping", "metadata", "news article"],
author=metadata["author"],
author_email='[email protected]',
url='https://github.com/psolbach/metadoc',
url='https://github.com/praise-internet/metadoc',
license=metadata["license"],
cmdclass={'install': CustomInstall, 'develop': DevInstall, 'bdist_wheel': CustomInstall},
cmdclass={'sdist': CustomInstall, 'develop': DevInstall, 'bdist_wheel': BdistEggInstall},
packages=find_packages(exclude=['tests']),
install_requires=requirements_txt.strip().split("\n"),
include_package_data=True,
Expand Down

0 comments on commit 36b816c

Please sign in to comment.